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:
parent
757327ceac
commit
54235f298e
23 changed files with 2574 additions and 2 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue