Sayonara Player
Public Types | Public Member Functions | Protected Member Functions | List of all members
Library::TrackModel Class Reference

The TrackModel class. More...

#include <TrackModel.h>

Inheritance diagram for Library::TrackModel:
Library::ItemModel SearchableModel< Model > SearchableModelInterface

Public Types

using ExtraTriggerMap = QMap< QChar, QString >
 

Public Member Functions

 TrackModel (QObject *parent, AbstractLibrary *library)
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
int rowCount (const QModelIndex &parent) const override
 
Cover::Location cover (const IndexSet &indexes) const override
 
int searchable_column () const override
 the index of the searchable column. This is the column where the text is searched for a certain searchstring
 
Id id_by_index (int row) const override
 return the current id for a given row More...
 
QString searchable_string (int row) const override
 here, the searchable string can even be refined. Maybe we just want to search within a substring indicated by the row More...
 
const IdSetselections () const override
 returns a set of the selected ids
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
bool set_header_data (const QStringList &names)
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QModelIndexList search_results (const QString &substr) override
 
virtual bool is_selected (int id) const final
 
virtual IndexSet selected_indexes () const
 
Gui::CustomMimeDatacustom_mimedata () const
 
void refresh_data (int *n_rows_before=nullptr, int *n_rows_after=nullptr)
 
virtual bool has_items () const override
 
virtual ExtraTriggerMap getExtraTriggers ()
 
virtual ::Library::SearchModeMask search_mode () const final
 

Protected Member Functions

const MetaDataListmimedata_tracks () const override
 return the tracks which belong to the selections. If an album is selected for example, all tracks of that album should be returned More...
 
AbstractLibrarylibrary ()
 
const AbstractLibrarylibrary () const
 

Detailed Description

The TrackModel class.

Member Function Documentation

◆ cover()

Cover::Location Library::TrackModel::cover ( const IndexSet indexes) const
overridevirtual

◆ flags()

Qt::ItemFlags Library::TrackModel::flags ( const QModelIndex &  index) const
override

AbstractSearchTableModel

◆ id_by_index()

Id Library::TrackModel::id_by_index ( int  row) const
overridevirtual

return the current id for a given row

Parameters
row
Returns

Implements Library::ItemModel.

◆ mimedata_tracks()

const MetaDataList& Library::TrackModel::mimedata_tracks ( ) const
overrideprotectedvirtual

return the tracks which belong to the selections. If an album is selected for example, all tracks of that album should be returned

Returns

Implements Library::ItemModel.

◆ searchable_string()

QString Library::TrackModel::searchable_string ( int  row) const
overridevirtual

here, the searchable string can even be refined. Maybe we just want to search within a substring indicated by the row

Parameters
row
Returns

Implements Library::ItemModel.