#ifndef PLAYERWIDGET_H #define PLAYERWIDGET_H #include class QStandardItemModel; class QStandardItem; class QLineEdit; class QLabel; class QSlider; class QTextEdit; class QMediaPlayer; class QToolBar; class BeetPlayerProxy; class BeetView; class PlayerWidget : public QWidget { Q_OBJECT public: enum ItemType { Artist, Album, Song, Genre }; enum CustomRoles { TypeRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2, FullPathRole = Qt::UserRole + 3, GenreRole = Qt::UserRole + 4, ArtistRole = Qt::UserRole + 5, TitleRole = Qt::UserRole + 6, AlbumRole = Qt::UserRole + 7 }; explicit PlayerWidget(QWidget *parent = 0); public slots: void populate(); void doFilter(); void clearFilter(); void reindex(); void addToPlayList(); void removeFromPlayList(); void clearPlayList(); void shufflePlayList(); private: void setupGui(); void createActions(); void populateByArtist(QStandardItem *parent, const QString &filter); void populateBySong(QStandardItem *parent, const QString &filter); void populateByGenre(QStandardItem *parent, const QString &filter); void recurse(const QModelIndex &parent); void addSong(const QModelIndex &idx); QLineEdit *mFilter; QMediaPlayer *mPlayer; BeetView *mView; QStandardItemModel *mViewModel; QStandardItemModel *mSearchModel; QStandardItemModel *currentModel; QLabel *mNowPlayingL; QSlider *mSlider; QTextEdit *mCurrentTE; BeetView *mPlayListView; QStandardItemModel *mPlayListModel; QToolBar *mToolBar; }; #endif // PLAYERWIDGET_H