![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <PlayListPlayer.h>
Public Member Functions | |
CPlayListPlayer (void) | |
~CPlayListPlayer (void) override | |
bool | OnMessage (CGUIMessage &message) override |
int | GetMessageMask () override |
Should return the message mask that it wishes to receive messages for. | |
void | OnApplicationMessage (KODI::MESSAGING::ThreadMessage *pMsg) override |
This gets called whenever a message matching the registered message mask is processed. | |
bool | PlayNext (int offset=1, bool autoPlay=false) |
Play the next (or another) entry in the current playlist. | |
bool | PlayPrevious () |
Play the previous entry in the current playlist. | |
bool | PlayItemIdx (int itemIdx) |
bool | Play () |
bool | Play (const CFileItemPtr &pItem, const std::string &player, bool forceSelection=false) |
Creates a new playlist for an item and starts playing it. | |
bool | Play (int index, const std::string &player, bool replace=false, bool playPreviousOnFail=false, bool forceSelection=false) |
Start playing a particular entry in the current playlist. | |
int | GetCurrentItemIdx () const |
Returns the index of the current item in active playlist. | |
void | SetCurrentItemIdx (int index) |
Change the current item in the active playlist. | |
int | GetNextItemIdx () |
int | GetNextItemIdx (int offset) const |
Get the index in the playlist that is offset away from the current index in the current playlist. Obeys any repeat settings (eg repeat one will return the current index regardless of offset) | |
void | SetCurrentPlaylist (Id playlistId) |
Set the active playlist. | |
Id | GetCurrentPlaylist () const |
Get the currently active playlist. | |
CPlayList & | GetPlaylist (Id playlistId) |
Get a particular playlist object. | |
const CPlayList & | GetPlaylist (Id playlistId) const |
int | RemoveDVDItems () |
Removes any item from all playlists located on a removable share. | |
void | Reset () |
Resets the current song and unplayable counts. Does not alter the active playlist. | |
void | ClearPlaylist (Id playlistId) |
void | Clear () |
void | SetShuffle (Id playlistId, bool shuffle, bool notify=false) |
Set shuffle state of a playlist. If the shuffle state changes, the playlist is shuffled or unshuffled. Has no effect if Party Mode is enabled. | |
bool | IsShuffled (Id playlistId) const |
Return whether a playlist is shuffled. If partymode is enabled, this always returns false. | |
bool | HasPlayedFirstFile () const |
Return whether or not something has been played yet from the current playlist. | |
void | SetRepeat (Id playlistId, RepeatState state, bool notify=false) |
Set repeat state of a playlist. If called while in Party Mode, repeat is disabled. | |
RepeatState | GetRepeat (Id playlistId) const |
void | Add (Id playlistId, const CPlayList &playlist) |
void | Add (Id playlistId, const CFileItemPtr &pItem) |
void | Add (Id playlistId, const CFileItemList &items) |
void | Insert (Id playlistId, const CPlayList &playlist, int iIndex) |
void | Insert (Id playlistId, const CFileItemPtr &pItem, int iIndex) |
void | Insert (Id playlistId, const CFileItemList &items, int iIndex) |
void | Remove (Id playlistId, int iPosition) |
void | Swap (Id playlistId, int indexItem1, int indexItem2) |
bool | IsSingleItemNonRepeatPlaylist () const |
bool | OnAction (const CAction &action) |
![]() | |
virtual | ~IMsgTargetCallback ()=default |
Protected Member Functions | |
bool | Repeated (Id playlistId) const |
Returns true if the given is set to repeat all. | |
bool | RepeatedOne (Id playlistId) const |
Returns true if the given is set to repeat one. | |
void | ReShuffle (Id playlistId, int iPosition) |
void | AnnouncePropertyChanged (Id playlistId, const std::string &strProperty, const CVariant &value) |
Protected Attributes | |
bool | m_bPlayedFirstFile |
bool | m_bPlaybackStarted |
int | m_iFailedSongs |
std::chrono::time_point< std::chrono::steady_clock > | m_failedSongsStart |
int | m_iCurrentSong |
Id | m_iCurrentPlayList {Id::TYPE_NONE} |
CPlayList * | m_PlaylistMusic |
CPlayList * | m_PlaylistVideo |
CPlayList * | m_PlaylistEmpty |
std::map< Id, RepeatState > | m_repeatState |
KODI::PLAYLIST::CPlayListPlayer::CPlayListPlayer | ( | void | ) |
|
override |
void KODI::PLAYLIST::CPlayListPlayer::Add | ( | Id | playlistId, |
const CFileItemList & | items ) |
void KODI::PLAYLIST::CPlayListPlayer::Add | ( | Id | playlistId, |
const CFileItemPtr & | pItem ) |
|
protected |
void KODI::PLAYLIST::CPlayListPlayer::Clear | ( | ) |
int KODI::PLAYLIST::CPlayListPlayer::GetCurrentItemIdx | ( | ) | const |
Returns the index of the current item in active playlist.
Id KODI::PLAYLIST::CPlayListPlayer::GetCurrentPlaylist | ( | ) | const |
|
overridevirtual |
Should return the message mask that it wishes to receive messages for.
The message mask is defined in "messaging/ApplicationMessenger.h" pick the next one available when creating a new
Implements KODI::MESSAGING::IMessageTarget.
int KODI::PLAYLIST::CPlayListPlayer::GetNextItemIdx | ( | ) |
Get the index in the playlist that is offset away from the current index in the current playlist. Obeys any repeat settings (eg repeat one will return the current index regardless of offset)
Get a particular playlist object.
id | Id of playlist |
RepeatState KODI::PLAYLIST::CPlayListPlayer::GetRepeat | ( | Id | playlistId | ) | const |
bool KODI::PLAYLIST::CPlayListPlayer::HasPlayedFirstFile | ( | ) | const |
Return whether or not something has been played yet from the current playlist.
void KODI::PLAYLIST::CPlayListPlayer::Insert | ( | Id | playlistId, |
const CFileItemList & | items, | ||
int | iIndex ) |
void KODI::PLAYLIST::CPlayListPlayer::Insert | ( | Id | playlistId, |
const CFileItemPtr & | pItem, | ||
int | iIndex ) |
void KODI::PLAYLIST::CPlayListPlayer::Insert | ( | Id | playlistId, |
const CPlayList & | playlist, | ||
int | iIndex ) |
Return whether a playlist is shuffled. If partymode is enabled, this always returns false.
playlist | the playlist to query for shuffle state, PLAYLIST::TYPE_MUSIC or PLAYLIST::TYPE_VIDEO. |
bool KODI::PLAYLIST::CPlayListPlayer::IsSingleItemNonRepeatPlaylist | ( | ) | const |
|
overridevirtual |
This gets called whenever a message matching the registered message mask is processed.
There are no ordering guarantees here so implementations should never rely on a certain ordering of messages.
Cleaning up any pointers stored in the message payload is not specified and is decided by the implementer of the message. In general prefer to delete any data in this method to keep the callsites cleaner and simpler but if data is to be passed back it's perfectly valid to handle it any way that fits the situation as long as it's documented along with the message.
To return a simple value the result parameter of
Implements KODI::MESSAGING::IMessageTarget.
|
overridevirtual |
Implements IMsgTargetCallback.
bool KODI::PLAYLIST::CPlayListPlayer::Play | ( | ) |
bool KODI::PLAYLIST::CPlayListPlayer::Play | ( | const CFileItemPtr & | pItem, |
const std::string & | player, | ||
bool | forceSelection = false ) |
Creates a new playlist for an item and starts playing it.
pItem | The item to play. |
player | The player name. |
forceSelection | for Blurays, force simple menu to change playlist (default to false) |
bool KODI::PLAYLIST::CPlayListPlayer::Play | ( | int | index, |
const std::string & | player, | ||
bool | replace = false, | ||
bool | playPreviousOnFail = false, | ||
bool | forceSelection = false ) |
Start playing a particular entry in the current playlist.
index | the index of the item to play. This value is modified to ensure it lies within the current playlist. |
replace | whether this item should replace the currently playing item. See CApplication::PlayFile (defaults to false). |
playPreviousOnFail | whether to go back to the previous item if playback fails (default to false) |
forceSelection | for Blurays, force simple menu to change playlist (default to false) |
Play the next (or another) entry in the current playlist.
offset | The offset from the current entry (defaults to 1, i.e. the next entry). |
autoPlay | Whether we should start playing if not already (defaults to false). |
bool KODI::PLAYLIST::CPlayListPlayer::PlayPrevious | ( | ) |
Play the previous entry in the current playlist.
int KODI::PLAYLIST::CPlayListPlayer::RemoveDVDItems | ( | ) |
Removes any item from all playlists located on a removable share.
Returns true if the given is set to repeat all.
playlist | Playlist to be query |
Returns true if the given is set to repeat one.
playlist | Playlist to be query |
void KODI::PLAYLIST::CPlayListPlayer::Reset | ( | ) |
Resets the current song and unplayable counts. Does not alter the active playlist.
Change the current item in the active playlist.
index | item index in playlist. Set only if the index is within the range of the current playlist. |
void KODI::PLAYLIST::CPlayListPlayer::SetRepeat | ( | Id | playlistId, |
RepeatState | state, | ||
bool | notify = false ) |
Set repeat state of a playlist. If called while in Party Mode, repeat is disabled.
playlist | the playlist to set repeat state for, PLAYLIST::TYPE_MUSIC or PLAYLIST::TYPE_VIDEO. |
state | set to RepeatState::NONE, RepeatState::ONE or RepeatState::ALL |
notify | notify the user with a Toast notification |
void KODI::PLAYLIST::CPlayListPlayer::SetShuffle | ( | Id | playlistId, |
bool | shuffle, | ||
bool | notify = false ) |
Set shuffle state of a playlist. If the shuffle state changes, the playlist is shuffled or unshuffled. Has no effect if Party Mode is enabled.
playlist | the playlist to (un)shuffle, PLAYLIST::TYPE_MUSIC or PLAYLIST::TYPE_VIDEO. |
shuffle | set true to shuffle, false to unshuffle. |
notify | notify the user with a Toast notification (defaults to false) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |