blob: 15da4fa9bd4b88d40e5655cca8cb80358a9b2df7 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
#ifndef PLAYERWIDGET_H
#define PLAYERWIDGET_H
#include <QWidget>
#include <QMediaPlayer>
#include <QSystemTrayIcon>
#include <QModelIndexList>
#include <QMap>
#include <taglib/fileref.h>
class QStandardItemModel;
class QStandardItem;
class QLineEdit;
class QLabel;
class QSlider;
class QTextEdit;
class QTextBrowser;
class QMediaPlayer;
class QToolBar;
class QAction;
class QActionGroup;
class QTimer;
class QStackedLayout;
class BeetPlayerProxy;
class BeetView;
class QSystemTrayIcon;
class WebDownloader;
class QStackedWidget;
class QSplashScreen;
class QTabWidget;
class PlayerWidget : public QWidget {
Q_OBJECT
public:
explicit PlayerWidget(QSplashScreen *splash, QWidget *parent = nullptr);
~PlayerWidget();
const QMediaPlayer* player() const { return mPlayer; }
const QActionGroup* bottomAG() const { return mBottomTBG; }
public slots:
void rightCurrentChanged(const QModelIndex &cur, const QModelIndex &prev);
void doPlay();
void doStop();
void doPause();
void doPlayOrPause();
void doContinue();
void volumeUp();
void volumeDown();
void showVolume();
void reindex();
void addToPlayList();
void addToPlayListAndClear();
void removeFromPlayList();
void clearPlayList();
void shufflePlayList();
void randomPlay();
void playCurrent(const QModelIndex &index);
void printList();
void searchMusicbrainz(const QModelIndex &idx);
void webDlDone();
void doMetadataChange(const QString &key, const QVariant &value);
void updateStreamData();
void mute(bool triggered);
void volumeChanged(int volume);
void next();
void previous();
void setPosition(int pos);
void slide(int value);
void continuePlaying(QMediaPlayer::MediaStatus state);
void readSettings();
void writeSettings();
void aboutDlg();
void gotoAlbum();
void setCollectionIndex(int collectionIndex, bool isWebradio);
void addToFavorites(const QModelIndexList &idxs);
void clearAndAddAllFavorites();
signals:
void viewModeChanged(const QString &viewMode);
void playModeChanged(const QString &playMode);
void numFilesChanged(int numFiles);
void playListLengthChanged(qint64 secs);
void message(const QString &msg);
void modelChanged();
void setWinTitle(const QString &title);
void streamDataNeedsUpdate();
void currentPlayListChanged(const QModelIndex &cur);
private:
void setupGui(QSplashScreen *splash);
void createActions();
void recurse(const QModelIndex &parent);
void addSong(const QModelIndex &idx);
void play(const QString &fullPath);
void playUrl(const QModelIndex &idx);
void advance(int numSongs);
void adjustVolume(int by);
void fillWithText(QTextEdit *te, const TagLib::FileRef &fr);
void setNowPlaying(const QString &what);
QMediaPlayer *mPlayer;
QLabel *mNowPlayingL;
QSlider *mSongSlider;
QLabel *mPos;
QSlider *mVolumeSlider;
QLabel *mVolumePos;
QTextEdit *mCurrentTE;
QTextBrowser *mLeftTE;
QTextEdit *mRightTE;
BeetView *mSongView;
BeetView *mWebRadioView;
QStandardItemModel *mSongModel;
QStandardItemModel *mWebRadioModel;
QToolBar *mToolBar;
QAction *mPlayA;
QAction *mStopA;
QAction *mPauseA;
QAction *mViewByAlbumsA;
int mDurSecs;
qint64 mPlayListLength;
QString mCurWinTitle;
QString mCurToolTip;
QSystemTrayIcon *mTrayIcon;
QTimer *mVolumeTimer;
bool mStarting;
WebDownloader *mWebDownloader;
QMap<QString, QVariant> mOtherMeta;
QStackedWidget *mCollectionStack;
QTabWidget *mPlaylistTab;
QActionGroup *mBottomTBG;
};
#endif // PLAYERWIDGET_H
|