xbmc
|
Public Member Functions | |
bool | OnMessage (CGUIMessage &message) override |
int | GetMessageMask () override |
Should return the message mask that it wishes to receive messages for. More... | |
void | OnApplicationMessage (KODI::MESSAGING::ThreadMessage *pMsg) override |
This gets called whenever a message matching the registered message mask is processed. More... | |
bool | PlayNext (int offset=1, bool autoPlay=false) |
Play the next (or another) entry in the current playlist. More... | |
bool | PlayPrevious () |
Play the previous entry in the current playlist. More... | |
bool | PlaySongId (int songId) |
bool | Play () |
bool | Play (const CFileItemPtr &pItem, const std::string &player) |
Creates a new playlist for an item and starts playing it. More... | |
bool | Play (int index, const std::string &player, bool replace=false, bool playPreviousOnFail=false) |
Start playing a particular entry in the current playlist. More... | |
int | GetCurrentSong () const |
Returns the index of the current item in active playlist. More... | |
void | SetCurrentSong (int index) |
Change the current item in the active playlist. More... | |
int | GetNextSong () |
int | GetNextSong (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) More... | |
void | SetCurrentPlaylist (PLAYLIST::Id playlistId) |
Set the active playlist. More... | |
PLAYLIST::Id | GetCurrentPlaylist () const |
Get the currently active playlist. More... | |
CPlayList & | GetPlaylist (PLAYLIST::Id playlistId) |
Get a particular playlist object. More... | |
const CPlayList & | GetPlaylist (PLAYLIST::Id playlistId) const |
int | RemoveDVDItems () |
Removes any item from all playlists located on a removable share. More... | |
void | Reset () |
Resets the current song and unplayable counts. Does not alter the active playlist. | |
void | ClearPlaylist (PLAYLIST::Id playlistId) |
void | Clear () |
void | SetShuffle (PLAYLIST::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. More... | |
bool | IsShuffled (PLAYLIST::Id playlistId) const |
Return whether a playlist is shuffled. If partymode is enabled, this always returns false. More... | |
bool | HasPlayedFirstFile () const |
Return whether or not something has been played yet from the current playlist. More... | |
void | SetRepeat (PLAYLIST::Id playlistId, PLAYLIST::RepeatState state, bool notify=false) |
Set repeat state of a playlist. If called while in Party Mode, repeat is disabled. More... | |
PLAYLIST::RepeatState | GetRepeat (PLAYLIST::Id playlistId) const |
void | Add (PLAYLIST::Id playlistId, const CPlayList &playlist) |
void | Add (PLAYLIST::Id playlistId, const CFileItemPtr &pItem) |
void | Add (PLAYLIST::Id playlistId, const CFileItemList &items) |
void | Insert (PLAYLIST::Id playlistId, const CPlayList &playlist, int iIndex) |
void | Insert (PLAYLIST::Id playlistId, const CFileItemPtr &pItem, int iIndex) |
void | Insert (PLAYLIST::Id playlistId, const CFileItemList &items, int iIndex) |
void | Remove (PLAYLIST::Id playlistId, int iPosition) |
void | Swap (PLAYLIST::Id playlistId, int indexItem1, int indexItem2) |
bool | IsSingleItemNonRepeatPlaylist () const |
bool | OnAction (const CAction &action) |
Protected Member Functions | |
bool | Repeated (PLAYLIST::Id playlistId) const |
Returns true if the given is set to repeat all. More... | |
bool | RepeatedOne (PLAYLIST::Id playlistId) const |
Returns true if the given is set to repeat one. More... | |
void | ReShuffle (PLAYLIST::Id playlistId, int iPosition) |
void | AnnouncePropertyChanged (PLAYLIST::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 |
PLAYLIST::Id | m_iCurrentPlayList {PLAYLIST::TYPE_NONE} |
CPlayList * | m_PlaylistMusic |
CPlayList * | m_PlaylistVideo |
CPlayList * | m_PlaylistEmpty |
std::map< PLAYLIST::Id, PLAYLIST::RepeatState > | m_repeatState |
Id CPlayListPlayer::GetCurrentPlaylist | ( | ) | const |
Get the currently active playlist.
int CPlayListPlayer::GetCurrentSong | ( | ) | const |
Returns the index of the current item in active playlist.
|
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 CPlayListPlayer::GetNextSong | ( | 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)
CPlayList & CPlayListPlayer::GetPlaylist | ( | PLAYLIST::Id | playlistId | ) |
Get a particular playlist object.
id | Values can be PLAYLIST::TYPE_MUSIC or PLAYLIST::TYPE_VIDEO |
bool CPlayListPlayer::HasPlayedFirstFile | ( | ) | const |
Return whether or not something has been played yet from the current playlist.
bool CPlayListPlayer::IsShuffled | ( | PLAYLIST::Id | playlistId | ) | const |
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. |
|
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.
bool CPlayListPlayer::Play | ( | const CFileItemPtr & | pItem, |
const std::string & | player | ||
) |
Creates a new playlist for an item and starts playing it.
pItem | The item to play. |
player | The player name. |
bool CPlayListPlayer::Play | ( | int | index, |
const std::string & | player, | ||
bool | replace = false , |
||
bool | playPreviousOnFail = 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) |
bool CPlayListPlayer::PlayNext | ( | int | offset = 1 , |
bool | autoPlay = 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 CPlayListPlayer::PlayPrevious | ( | ) |
Play the previous entry in the current playlist.
int CPlayListPlayer::RemoveDVDItems | ( | ) |
Removes any item from all playlists located on a removable share.
|
protected |
Returns true if the given is set to repeat all.
playlist | Playlist to be query |
|
protected |
Returns true if the given is set to repeat one.
playlist | Playlist to be query |
void CPlayListPlayer::SetCurrentPlaylist | ( | PLAYLIST::Id | playlistId | ) |
Set the active playlist.
id | Values can be PLAYLIST::TYPE_NONE, PLAYLIST::TYPE_MUSIC or PLAYLIST::TYPE_VIDEO |
void CPlayListPlayer::SetCurrentSong | ( | int | index | ) |
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 CPlayListPlayer::SetRepeat | ( | PLAYLIST::Id | playlistId, |
PLAYLIST::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 CPlayListPlayer::SetShuffle | ( | PLAYLIST::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 |