disable previous and next button
if there is no corresponding media; set play/pause symbol via model property instead of via qml.
This commit is contained in:
parent
a29e8d7a64
commit
6eabd3cb75
5 changed files with 75 additions and 8 deletions
|
|
@ -11,8 +11,9 @@ class MusicModel : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QObject* pCurrentItem READ getCurrentItem NOTIFY currentItemChanged)
|
||||
//Q_PROPERTY(QObject* pHasNext READ hasNext NOTIFY hasNextChanged)
|
||||
//Q_PROPERTY(QObject* pHasPrevious READ hasPrevious NOTIFY hasPreviousChanged)
|
||||
Q_PROPERTY(bool pHasNext READ hasNext NOTIFY hasNextChanged)
|
||||
Q_PROPERTY(bool pHasPrevious READ hasPrevious NOTIFY hasPreviousChanged)
|
||||
Q_PROPERTY(bool pIsPlaying READ isPlaying NOTIFY isPlayingChanged)
|
||||
|
||||
signals:
|
||||
void navigateTo(NavigationItemModel *item);
|
||||
|
|
@ -22,6 +23,9 @@ signals:
|
|||
void stop();
|
||||
void previous();
|
||||
void next();
|
||||
void hasPreviousChanged();
|
||||
void hasNextChanged();
|
||||
void isPlayingChanged();
|
||||
|
||||
public:
|
||||
MusicModel(VlcInstance* instance, QObject *parent = Q_NULLPTR);
|
||||
|
|
@ -40,9 +44,16 @@ public:
|
|||
VlcMediaList *getMedia();
|
||||
|
||||
bool isPlaying();
|
||||
bool hasNext();
|
||||
bool hasPrevious();
|
||||
|
||||
public slots:
|
||||
void onNextMediaSet(VlcMedia* media);
|
||||
|
||||
private:
|
||||
bool mIsPlaying = false;
|
||||
bool mHasNext = false;
|
||||
bool mHasPrevious = false;
|
||||
NavigationItemModel* mCurrentItem = Q_NULLPTR;
|
||||
VlcMediaList* mMedia = Q_NULLPTR;
|
||||
VlcInstance* mVlc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue