summaryrefslogtreecommitdiffstats
path: root/playerwidget.h
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-02-17 10:59:01 +0100
committerArno <arno@disconnect.de>2018-02-17 10:59:01 +0100
commit8b3e1bcfbf90659c31b0d311359f2f66305631cf (patch)
tree134f613ce239f18d7dfc2dd6785d5906df8fb478 /playerwidget.h
parent613f1e254738ee4b9e23c7dee14e901d50abfb49 (diff)
downloadBeetPlayer-8b3e1bcfbf90659c31b0d311359f2f66305631cf.tar.gz
BeetPlayer-8b3e1bcfbf90659c31b0d311359f2f66305631cf.tar.bz2
BeetPlayer-8b3e1bcfbf90659c31b0d311359f2f66305631cf.zip
Make use of the new CollectionView classes
This removes pretty much any function. This commit compiles, but it's completely useless. It can't even play a song, but it does display what view we're populating on the splash screen, and the view buttons work :)
Diffstat (limited to 'playerwidget.h')
-rw-r--r--playerwidget.h52
1 files changed, 5 insertions, 47 deletions
diff --git a/playerwidget.h b/playerwidget.h
index 93efc2c..60e0df9 100644
--- a/playerwidget.h
+++ b/playerwidget.h
@@ -24,6 +24,8 @@ class BeetPlayerProxy;
class BeetView;
class QSystemTrayIcon;
class WebDownloader;
+class QStackedWidget;
+class QSplashScreen;
class PlayerWidget : public QWidget {
Q_OBJECT
@@ -32,43 +34,24 @@ class PlayerWidget : public QWidget {
enum PopulateType { FilterType, IdType, EmptyType };
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, LengthRole = Qt::UserRole + 8, UrlRole = Qt::UserRole + 9, RemoteRole = Qt::UserRole + 10 };
enum ModelType { Webradio, Favorites, Folders, DoNotCare };
- explicit PlayerWidget(QWidget *parent = 0);
+ explicit PlayerWidget(QSplashScreen *splash, QWidget *parent = nullptr);
~PlayerWidget();
const QMediaPlayer* player() const { return mPlayer; }
public slots:
- void doPopulateByArtist();
- void doPopulateByAlbum();
- void doPopulateByGenre();
- void doPopulateBySong();
- void doPopulateByDate();
- void doPopulateByFolder();
- void doPopulateByWebradio();
- void doPopulateByFavorites();
- void doModelChanged();
- void viewDoubleClicked(const QModelIndex &idx);
void rightCurrentChanged(const QModelIndex &cur, const QModelIndex &prev);
void leftCurrentChanged(const QModelIndex &cur, const QModelIndex &prev);
void doPlay();
void doStop();
void doPause();
void doPlayOrPause();
- void doSelectFiles();
- void doDeselect();
- void doDeleteFiles();
void volumeUp();
void volumeDown();
- void dirUp();
- void dirHome();
void showVolume();
- void doFilter();
- void clearFilter();
void reindex();
void addToPlayList();
void addToPlayListAndClear();
void removeFromPlayList();
- void removeFromFavorites();
- void addToFavorites();
void clearPlayList();
void shufflePlayList();
void randomPlay();
@@ -77,8 +60,6 @@ class PlayerWidget : public QWidget {
void searchMusicbrainzRight();
void searchMusicbrainzLeft();
void webDlDone();
- void filterFromPlaylist();
- void editWebradio();
void doMetadataChange(const QString &key, const QVariant &value);
void updateStreamData();
@@ -105,15 +86,8 @@ class PlayerWidget : public QWidget {
void streamDataNeedsUpdate();
private:
- void setupGui();
+ void setupGui(QSplashScreen *splash);
void createActions();
- void populateByArtist(QStandardItem *parent, const QString &filter);
- void populateByAlbum(QStandardItem *parent, const QVariant &filter, int type);
- void populateBySong(QStandardItem *parent, const QVariant &filter, int type);
- void populateByDate(QStandardItem *parent);
- void populateByGenre(QStandardItem *parent, const QString &filter);
- void populateByWebradio(QStandardItem *parent);
- void populateByFavorites(QStandardItem *parent);
void recurse(const QModelIndex &parent);
void addSong(const QModelIndex &idx);
void play(const QString &fullPath);
@@ -123,15 +97,7 @@ class PlayerWidget : public QWidget {
void adjustVolume(int by);
void fillWithText(QTextEdit *te, const TagLib::FileRef &fr);
void setNowPlaying(const QString &what);
- QLineEdit *mSearch;
- QLineEdit *mDir;
QMediaPlayer *mPlayer;
- BeetView *mView;
- QStandardItemModel *mViewModel;
- QStandardItemModel *mSearchModel;
- QStandardItemModel *mCurrentModel;
- QStandardItemModel *mFolderModel;
- QStandardItemModel *mWebRadioModel;
QLabel *mNowPlayingL;
QSlider *mSongSlider;
QLabel *mPos;
@@ -146,26 +112,18 @@ class PlayerWidget : public QWidget {
QAction *mPlayA;
QAction *mStopA;
QAction *mPauseA;
- QAction *mSearchA;
- QAction *mViewByArtistA;
- QAction *mSelectFilesA;
- QAction *mDeselectAllA;
- QAction *mDeleteFilesA;
- QAction *mRefreshA;
- QAction *mRemoveFromFavoritesA;
qint64 mDurSecs;
quint64 mPlayListLength;
- QString mCurDir;
QString mCurWinTitle;
QString mCurToolTip;
QSystemTrayIcon *mTrayIcon;
QTimer *mVolumeTimer;
bool mStarting;
- QStackedLayout *mSearchDirStack;
WebDownloader *mWebDownloader;
QMap<QString, QVariant> mOtherMeta;
bool mIsStream;
int mModelType;
+ QStackedWidget *mCollectionStack;
};
#endif // PLAYERWIDGET_H