summaryrefslogtreecommitdiffstats
path: root/playerwidget.h
blob: 4de2e3806348d6929cc615dc991e97d4162620e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef PLAYERWIDGET_H
#define PLAYERWIDGET_H

#include <QWidget>

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 };
        explicit PlayerWidget(QWidget *parent = 0);

    public slots:
        void populate();
        void doFilter();
        void clearFilter();
        void reindex();

    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);
        QLineEdit *mFilter;
        QMediaPlayer *mPlayer;
        BeetView *mView;
        QStandardItemModel *mViewModel;
        QStandardItemModel *mSearchModel;
        QLabel *mNowPlayingL;
        QSlider *mSlider;
        QTextEdit *mCurrentTE;
        BeetView *mPlayListView;
        QStandardItemModel *mPlayListModel;
        QToolBar *mToolBar;
};

#endif // PLAYERWIDGET_H