connected stop, previous and next button;
STILL MISSING: check whether there is a next/previous medium and only then show/enable buttons
This commit is contained in:
parent
d6c806d41d
commit
61b8734b62
4 changed files with 33 additions and 4 deletions
|
|
@ -49,6 +49,24 @@ void MusicModel::playPause()
|
|||
emit pause();
|
||||
}
|
||||
|
||||
void MusicModel::stopMusic()
|
||||
{
|
||||
if(mIsPlaying){
|
||||
mIsPlaying = false;
|
||||
emit stop();
|
||||
}
|
||||
}
|
||||
|
||||
void MusicModel::playNext()
|
||||
{
|
||||
emit next();
|
||||
}
|
||||
|
||||
void MusicModel::playPrevious()
|
||||
{
|
||||
emit previous();
|
||||
}
|
||||
|
||||
NavigationItemModel *MusicModel::getCurrentItem()
|
||||
{
|
||||
return mCurrentItem;
|
||||
|
|
|
|||
|
|
@ -11,12 +11,17 @@ 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)
|
||||
|
||||
signals:
|
||||
void navigateTo(NavigationItemModel *item);
|
||||
void currentItemChanged();
|
||||
void play();
|
||||
void pause();
|
||||
void stop();
|
||||
void previous();
|
||||
void next();
|
||||
|
||||
public:
|
||||
MusicModel(VlcInstance* instance, QObject *parent = Q_NULLPTR);
|
||||
|
|
@ -26,6 +31,9 @@ public:
|
|||
|
||||
Q_INVOKABLE void navigateBack();
|
||||
Q_INVOKABLE void playPause();
|
||||
Q_INVOKABLE void stopMusic();
|
||||
Q_INVOKABLE void playNext();
|
||||
Q_INVOKABLE void playPrevious();
|
||||
|
||||
NavigationItemModel *getCurrentItem();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue