|
MythTV master
|
#include <mythplugins/mythmusic/mythmusic/playlist.h>
Public Member Functions | |
| Playlist (void) | |
| ~Playlist () override | |
| void | setParent (PlaylistContainer *myparent) |
| void | loadPlaylist (const QString &a_name, const QString &a_host) |
| void | loadPlaylistByID (int id, const QString &a_host) |
| void | savePlaylist (const QString &a_name, const QString &a_host) |
| void | shuffleTracks (MusicPlayer::ShuffleMode mode) |
| void | describeYourself (void) const |
| void | fillSongsFromSonglist (const QString &songList) |
| int | fillSonglistFromQuery (const QString &whereClause, bool removeDuplicates=false, InsertPLOption insertOption=PL_REPLACE, int currentTrackID=0) |
| int | fillSonglistFromSmartPlaylist (const QString &category, const QString &name, bool removeDuplicates=false, InsertPLOption insertOption=PL_REPLACE, int currentTrackID=0) |
| int | fillSonglistFromList (const QList< int > &songList, bool removeDuplicates, InsertPLOption insertOption, int currentTrackID) |
| QString | toRawSonglist (bool shuffled=false, bool tracksOnly=false) |
| MusicMetadata * | getSongAt (int pos) const |
| int | getTrackCount (void) |
| void | moveTrackUpDown (bool flag, int where_its_at) |
| bool | checkTrack (MusicMetadata::IdType trackID) const |
| void | addTrack (MusicMetadata::IdType trackID, bool update_display) |
| Given a tracks ID, add that track to this playlist. More... | |
| int | getTrackPosition (MusicMetadata::IdType trackID) |
| void | removeTrack (MusicMetadata::IdType trackID) |
| void | removeAllTracks (void) |
| void | removeAllCDTracks (void) |
| void | copyTracks (Playlist *to_ptr, bool update_display) |
| bool | hasChanged (void) const |
| void | changed (void) |
| void | disableSaves (void) |
| whether any changes should be saved to the DB More... | |
| void | enableSaves (void) |
| bool | doSaves (void) const |
| QString | getName (void) |
| void | setName (const QString &a_name) |
| bool | isActivePlaylist (void) |
| int | getID (void) const |
| void | setID (int x) |
| void | getStats (uint *trackCount, std::chrono::seconds *totalLength, uint currentTrack=0, std::chrono::seconds *playedLength=nullptr) const |
| void | resync (void) |
| make sure all tracks are still valid after a scan More... | |
Private Member Functions | |
| MusicMetadata * | getRawSongAt (int pos) const |
Static Private Member Functions | |
| static QString | removeItemsFromList (const QString &remove_list, const QString &source_list) |
Private Attributes | |
| int | m_playlistid {0} |
| QString | m_name |
| SongList | m_songs |
| SongList | m_shuffledSongs |
| PlaylistContainer * | m_parent {nullptr} |
| bool | m_changed {false} |
| bool | m_doSave {true} |
Definition at line 45 of file playlist.h.
| Playlist::Playlist | ( | void | ) |
Definition at line 146 of file playlist.cpp.
|
override |
Definition at line 151 of file playlist.cpp.
| void Playlist::addTrack | ( | MusicMetadata::IdType | trackID, |
| bool | update_display | ||
| ) |
Given a tracks ID, add that track to this playlist.
Definition at line 63 of file playlist.cpp.
Referenced by MusicPlayer::addTrack(), copyTracks(), MusicPlayer::loadStreamPlaylist(), and SearchView::trackClicked().
| void Playlist::changed | ( | void | ) |
Definition at line 990 of file playlist.cpp.
Referenced by addTrack(), copyTracks(), MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), fillSongsFromSonglist(), moveTrackUpDown(), removeAllCDTracks(), removeAllTracks(), removeTrack(), PlaylistContainer::renamePlaylist(), and resync().
| bool Playlist::checkTrack | ( | MusicMetadata::IdType | trackID | ) | const |
Definition at line 38 of file playlist.cpp.
Referenced by SearchView::customEvent(), PlaylistEditorView::filterTracks(), PlaylistEditorView::getCDTracks(), PlaylistEditorView::getPlaylistTracks(), PlaylistEditorView::getSmartPlaylistTracks(), SearchView::ShowMenu(), SearchView::trackClicked(), PlaylistEditorView::treeItemClicked(), PlaylistEditorView::updateSelectedTracks(), and SearchView::updateTracksList().
Definition at line 43 of file playlist.cpp.
Referenced by PlaylistContainer::copyNewPlaylist(), and PlaylistContainer::copyToActive().
| void Playlist::describeYourself | ( | void | ) | const |
Definition at line 481 of file playlist.cpp.
Referenced by PlaylistContainer::describeYourself().
|
inline |
whether any changes should be saved to the DB
Definition at line 102 of file playlist.h.
Referenced by copyTracks(), fillSonglistFromList(), fillSonglistFromQuery(), and MusicPlayer::loadStreamPlaylist().
|
inline |
Definition at line 104 of file playlist.h.
|
inline |
Definition at line 103 of file playlist.h.
Referenced by copyTracks(), fillSonglistFromList(), fillSonglistFromQuery(), and MusicPlayer::loadStreamPlaylist().
| int Playlist::fillSonglistFromList | ( | const QList< int > & | songList, |
| bool | removeDuplicates, | ||
| InsertPLOption | insertOption, | ||
| int | currentTrackID | ||
| ) |
Definition at line 785 of file playlist.cpp.
Referenced by MusicCommon::doUpdatePlaylist(), and handleMedia().
| int Playlist::fillSonglistFromQuery | ( | const QString & | whereClause, |
| bool | removeDuplicates = false, |
||
| InsertPLOption | insertOption = PL_REPLACE, |
||
| int | currentTrackID = 0 |
||
| ) |
Definition at line 686 of file playlist.cpp.
Referenced by MusicCommon::doUpdatePlaylist(), and fillSonglistFromSmartPlaylist().
| int Playlist::fillSonglistFromSmartPlaylist | ( | const QString & | category, |
| const QString & | name, | ||
| bool | removeDuplicates = false, |
||
| InsertPLOption | insertOption = PL_REPLACE, |
||
| int | currentTrackID = 0 |
||
| ) |
Definition at line 898 of file playlist.cpp.
| void Playlist::fillSongsFromSonglist | ( | const QString & | songList | ) |
Definition at line 641 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), loadPlaylist(), and loadPlaylistByID().
|
inline |
Definition at line 111 of file playlist.h.
Referenced by MusicCommon::customEvent(), PlaylistContainer::getPlaylist(), PlaylistContainer::getPlaylistName(), and PlaylistEditorView::getPlaylists().
|
inline |
Definition at line 106 of file playlist.h.
Referenced by PlaylistContainer::getPlaylist(), PlaylistContainer::getPlaylistName(), PlaylistEditorView::getPlaylists(), and MusicCommon::updatePlaylistStats().
|
private |
Definition at line 1114 of file playlist.cpp.
Referenced by copyTracks(), removeAllCDTracks(), resync(), and shuffleTracks().
| MusicMetadata * Playlist::getSongAt | ( | int | pos | ) | const |
Definition at line 1096 of file playlist.cpp.
Referenced by MusicPlayer::activePlaylistChanged(), MusicPlayer::getCurrentMetadata(), MusicPlayer::getNextMetadata(), PlaylistEditorView::getPlaylistTracks(), getStats(), MusicPlayer::moveTrackUpDown(), MusicCommon::restorePosition(), MusicPlayer::restorePosition(), MusicPlayer::setShuffleMode(), PlaylistEditorView::updateSonglist(), StreamView::updateStreamList(), and MusicCommon::updateUIPlaylist().
| void Playlist::getStats | ( | uint * | trackCount, |
| std::chrono::seconds * | totalLength, | ||
| uint | currentTrack = 0, |
||
| std::chrono::seconds * | playedLength = nullptr |
||
| ) | const |
Definition at line 501 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), MusicCommon::doUpdatePlaylist(), MusicCommon::init(), MusicCommon::keyPressEvent(), savePlaylist(), and MusicCommon::updateShuffleMode().
|
inline |
Definition at line 82 of file playlist.h.
Referenced by MusicPlayer::activePlaylistChanged(), MusicPlayer::changeCurrentTrack(), MusicCommon::customEvent(), MusicCommon::doUpdatePlaylist(), PlaylistEditorView::getPlaylistTracks(), MusicPlayer::loadPlaylist(), MusicPlayer::next(), MusicCommon::restorePosition(), MusicPlayer::restorePosition(), MusicPlayer::setShuffleMode(), MusicCommon::showPlaylistOptionsMenu(), PlaylistEditorView::treeItemClicked(), MusicCommon::updatePlaylistStats(), PlaylistEditorView::updateSonglist(), StreamView::updateStreamList(), and MusicCommon::updateUIPlaylist().
|
inline |
Definition at line 90 of file playlist.h.
Referenced by MusicPlayer::moveTrackUpDown(), and MusicPlayer::removeTrack().
|
inline |
Definition at line 98 of file playlist.h.
|
inline |
Definition at line 109 of file playlist.h.
Referenced by addTrack(), fillSongsFromSonglist(), removeTrack(), and resync().
| void Playlist::loadPlaylist | ( | const QString & | a_name, |
| const QString & | a_host | ||
| ) |
Definition at line 529 of file playlist.cpp.
Referenced by PlaylistContainer::load().
| void Playlist::loadPlaylistByID | ( | int | id, |
| const QString & | a_host | ||
| ) |
Definition at line 585 of file playlist.cpp.
| void Playlist::moveTrackUpDown | ( | bool | flag, |
| int | where_its_at | ||
| ) |
Definition at line 130 of file playlist.cpp.
Referenced by MusicPlayer::moveTrackUpDown().
| void Playlist::removeAllCDTracks | ( | void | ) |
Definition at line 97 of file playlist.cpp.
Referenced by handleMedia().
| void Playlist::removeAllTracks | ( | void | ) |
Definition at line 89 of file playlist.cpp.
Referenced by PlaylistContainer::clearActive(), PlaylistContainer::copyToActive(), MusicCommon::customEvent(), PlaylistContainer::deletePlaylist(), fillSonglistFromList(), fillSonglistFromQuery(), handleMedia(), and MusicPlayer::loadStreamPlaylist().
|
staticprivate |
Definition at line 1081 of file playlist.cpp.
Referenced by fillSonglistFromList(), and fillSonglistFromQuery().
| void Playlist::removeTrack | ( | MusicMetadata::IdType | trackID | ) |
Definition at line 119 of file playlist.cpp.
Referenced by MusicPlayer::removeTrack(), and SearchView::trackClicked().
| void Playlist::resync | ( | void | ) |
make sure all tracks are still valid after a scan
Definition at line 613 of file playlist.cpp.
Referenced by PlaylistContainer::resync().
| void Playlist::savePlaylist | ( | const QString & | a_name, |
| const QString & | a_host | ||
| ) |
Definition at line 998 of file playlist.cpp.
Referenced by changed(), loadPlaylist(), and PlaylistContainer::save().
|
inline |
Definition at line 112 of file playlist.h.
|
inline |
Definition at line 107 of file playlist.h.
Referenced by PlaylistContainer::renamePlaylist().
|
inline |
Definition at line 53 of file playlist.h.
Referenced by PlaylistContainer::load().
| void Playlist::shuffleTracks | ( | MusicPlayer::ShuffleMode | mode | ) |
Definition at line 157 of file playlist.cpp.
Referenced by fillSongsFromSonglist(), loadPlaylist(), and MusicPlayer::setShuffleMode().
Definition at line 855 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), and savePlaylist().
Definition at line 142 of file playlist.h.
Referenced by changed(), hasChanged(), and savePlaylist().
Definition at line 143 of file playlist.h.
Referenced by changed(), disableSaves(), doSaves(), and enableSaves().
|
private |
Definition at line 136 of file playlist.h.
Referenced by changed(), getName(), isActivePlaylist(), loadPlaylist(), loadPlaylistByID(), savePlaylist(), and setName().
|
private |
Definition at line 141 of file playlist.h.
Referenced by setParent(), and shuffleTracks().
|
private |
Definition at line 135 of file playlist.h.
Referenced by getID(), loadPlaylist(), loadPlaylistByID(), resync(), savePlaylist(), and setID().
|
private |
Definition at line 139 of file playlist.h.
Referenced by addTrack(), getSongAt(), getStats(), getTrackPosition(), moveTrackUpDown(), removeAllCDTracks(), removeAllTracks(), removeTrack(), resync(), shuffleTracks(), toRawSonglist(), and ~Playlist().
|
private |
Definition at line 138 of file playlist.h.
Referenced by addTrack(), checkTrack(), copyTracks(), describeYourself(), fillSongsFromSonglist(), getRawSongAt(), getTrackCount(), removeAllCDTracks(), removeAllTracks(), removeTrack(), resync(), shuffleTracks(), toRawSonglist(), and ~Playlist().