qt: add 'currentIndex' property to PlaylistController

This commit is contained in:
Prince Gupta 2024-03-14 11:56:48 +05:30 committed by Jean-Baptiste Kempf
parent 5f1e80b1b7
commit 69a449868d
2 changed files with 8 additions and 0 deletions

View File

@ -554,6 +554,12 @@ void PlaylistController::explore(const PlaylistItem& pItem)
}
}
int PlaylistController::currentIndex() const
{
Q_D(const PlaylistController);
return d->m_currentIndex;
}
void PlaylistController::play()
{
Q_D(PlaylistController);

View File

@ -105,6 +105,7 @@ public:
Q_PROPERTY(SortKey sortKey READ getSortKey WRITE setSortKey NOTIFY sortKeyChanged FINAL)
Q_PROPERTY(SortOrder sortOrder READ getSortOrder WRITE setSortOrder NOTIFY sortOrderChanged FINAL)
Q_PROPERTY(MediaStopAction mediaStopAction READ getMediaStopAction WRITE setMediaStopAction NOTIFY mediaStopActionChanged FINAL)
Q_PROPERTY(int currentIndex READ currentIndex NOTIFY currentIndexChanged FINAL)
public:
@ -162,6 +163,7 @@ public slots:
bool isEmpty() const;
int count() const;
int currentIndex() const;
SortKey getSortKey() const;
void setSortKey(SortKey sortKey);