added progress bar to show position in track
still todo: styling, positioning, output of current time and length
This commit is contained in:
parent
6eabd3cb75
commit
b013b69e8d
4 changed files with 63 additions and 6 deletions
|
|
@ -14,6 +14,7 @@ class MusicModel : public QObject
|
|||
Q_PROPERTY(bool pHasNext READ hasNext NOTIFY hasNextChanged)
|
||||
Q_PROPERTY(bool pHasPrevious READ hasPrevious NOTIFY hasPreviousChanged)
|
||||
Q_PROPERTY(bool pIsPlaying READ isPlaying NOTIFY isPlayingChanged)
|
||||
Q_PROPERTY(double pProgress READ getProgress NOTIFY progressChanged)
|
||||
|
||||
signals:
|
||||
void navigateTo(NavigationItemModel *item);
|
||||
|
|
@ -26,6 +27,7 @@ signals:
|
|||
void hasPreviousChanged();
|
||||
void hasNextChanged();
|
||||
void isPlayingChanged();
|
||||
void progressChanged();
|
||||
|
||||
public:
|
||||
MusicModel(VlcInstance* instance, QObject *parent = Q_NULLPTR);
|
||||
|
|
@ -47,13 +49,19 @@ public:
|
|||
bool hasNext();
|
||||
bool hasPrevious();
|
||||
|
||||
double getProgress();
|
||||
|
||||
public slots:
|
||||
void onNextMediaSet(VlcMedia* media);
|
||||
void onTimeChanged(int time);
|
||||
void onLengthChanged(int length);
|
||||
|
||||
private:
|
||||
bool mIsPlaying = false;
|
||||
bool mHasNext = false;
|
||||
bool mHasPrevious = false;
|
||||
int mCurrentMediaItemLength = 0;
|
||||
double mCurrentMediaItemProgress = 0;
|
||||
NavigationItemModel* mCurrentItem = Q_NULLPTR;
|
||||
VlcMediaList* mMedia = Q_NULLPTR;
|
||||
VlcInstance* mVlc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue