1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-04 01:42:44 +00:00

Add MPRIS support

Besides MPRIS support, this also adds support for hasPrevious() and
hasNext() in several parts to determine whether the
player/playlist/shuffler has a previous or next item.
This commit is contained in:
Chris Josten 2021-08-31 01:29:51 +02:00
parent 757327ceac
commit 54235f298e
23 changed files with 2574 additions and 2 deletions

View file

@ -58,11 +58,15 @@ public:
*/
int currentItemIndexInList() const;
bool hasPrevious();
/**
* @brief Determine the previous item to be played.
*/
void previous();
bool hasNext();
/**
* @brief Determine the next item to be played.
*/

View file

@ -83,6 +83,9 @@ public:
*/
virtual int nextItem() const { return -1; }
virtual bool hasPrevious() const { return false; }
virtual bool hasNext() const { return false; }
/**
* @brief Sets whether the shuffler to loop over the list if all items are played.
*/
@ -108,6 +111,8 @@ public:
virtual void previous() override;
virtual void next() override;
virtual void setIndex(int i) override;
virtual bool hasPrevious() const override;
virtual bool hasNext() const override;
protected:
int nextIndex() const;
int previousIndex() const;
@ -148,6 +153,8 @@ public:
virtual int nextItem() const override;
virtual void previous() override;
virtual void next() override;
virtual bool hasPrevious() const override;
virtual bool hasNext() const override;
protected:
int m_previous, m_current, m_next = -1;
};