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 145 of file playlist.cpp.
|
override |
Definition at line 150 of file playlist.cpp.
|
inline |
Definition at line 53 of file playlist.h.
Referenced by PlaylistContainer::load().
void Playlist::loadPlaylist | ( | const QString & | a_name, |
const QString & | a_host | ||
) |
Definition at line 528 of file playlist.cpp.
Referenced by PlaylistContainer::load().
void Playlist::loadPlaylistByID | ( | int | id, |
const QString & | a_host | ||
) |
Definition at line 584 of file playlist.cpp.
void Playlist::savePlaylist | ( | const QString & | a_name, |
const QString & | a_host | ||
) |
Definition at line 997 of file playlist.cpp.
Referenced by changed(), loadPlaylist(), and PlaylistContainer::save().
void Playlist::shuffleTracks | ( | MusicPlayer::ShuffleMode | mode | ) |
Definition at line 156 of file playlist.cpp.
Referenced by fillSongsFromSonglist(), loadPlaylist(), and MusicPlayer::setShuffleMode().
void Playlist::describeYourself | ( | void | ) | const |
Definition at line 480 of file playlist.cpp.
Referenced by PlaylistContainer::describeYourself().
void Playlist::fillSongsFromSonglist | ( | const QString & | songList | ) |
Definition at line 640 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), loadPlaylist(), and loadPlaylistByID().
int Playlist::fillSonglistFromQuery | ( | const QString & | whereClause, |
bool | removeDuplicates = false , |
||
InsertPLOption | insertOption = PL_REPLACE , |
||
int | currentTrackID = 0 |
||
) |
Definition at line 685 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 897 of file playlist.cpp.
int Playlist::fillSonglistFromList | ( | const QList< int > & | songList, |
bool | removeDuplicates, | ||
InsertPLOption | insertOption, | ||
int | currentTrackID | ||
) |
Definition at line 784 of file playlist.cpp.
Referenced by MusicCommon::doUpdatePlaylist(), and handleMedia().
Definition at line 854 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), and savePlaylist().
MusicMetadata * Playlist::getSongAt | ( | int | pos | ) | const |
Definition at line 1095 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().
|
inline |
Definition at line 82 of file playlist.h.
Referenced by MusicPlayer::activePlaylistChanged(), MusicCommon::customEvent(), MusicCommon::doUpdatePlaylist(), PlaylistEditorView::getPlaylistTracks(), MusicPlayer::restorePosition(), MusicPlayer::setShuffleMode(), MusicCommon::showPlaylistOptionsMenu(), PlaylistEditorView::treeItemClicked(), MusicCommon::updatePlaylistStats(), PlaylistEditorView::updateSonglist(), and MusicCommon::updateUIPlaylist().
void Playlist::moveTrackUpDown | ( | bool | flag, |
int | where_its_at | ||
) |
Definition at line 129 of file playlist.cpp.
Referenced by MusicPlayer::moveTrackUpDown().
bool Playlist::checkTrack | ( | MusicMetadata::IdType | trackID | ) | const |
Definition at line 37 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().
void Playlist::addTrack | ( | MusicMetadata::IdType | trackID, |
bool | update_display | ||
) |
Given a tracks ID, add that track to this playlist.
Definition at line 62 of file playlist.cpp.
Referenced by MusicPlayer::addTrack(), copyTracks(), MusicPlayer::loadStreamPlaylist(), and SearchView::trackClicked().
|
inline |
Definition at line 90 of file playlist.h.
Referenced by MusicPlayer::moveTrackUpDown(), and MusicPlayer::removeTrack().
void Playlist::removeTrack | ( | MusicMetadata::IdType | trackID | ) |
Definition at line 118 of file playlist.cpp.
Referenced by MusicPlayer::removeTrack(), and SearchView::trackClicked().
void Playlist::removeAllTracks | ( | void | ) |
Definition at line 88 of file playlist.cpp.
Referenced by PlaylistContainer::clearActive(), PlaylistContainer::copyToActive(), MusicCommon::customEvent(), PlaylistContainer::deletePlaylist(), fillSonglistFromList(), fillSonglistFromQuery(), handleMedia(), and MusicPlayer::loadStreamPlaylist().
void Playlist::removeAllCDTracks | ( | void | ) |
Definition at line 96 of file playlist.cpp.
Referenced by handleMedia().
Definition at line 42 of file playlist.cpp.
Referenced by PlaylistContainer::copyNewPlaylist(), and PlaylistContainer::copyToActive().
|
inline |
Definition at line 98 of file playlist.h.
void Playlist::changed | ( | void | ) |
Definition at line 989 of file playlist.cpp.
Referenced by addTrack(), copyTracks(), MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), fillSongsFromSonglist(), moveTrackUpDown(), removeAllCDTracks(), removeAllTracks(), removeTrack(), PlaylistContainer::renamePlaylist(), and resync().
|
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 103 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 106 of file playlist.h.
Referenced by PlaylistContainer::getPlaylist(), PlaylistContainer::getPlaylistName(), PlaylistEditorView::getPlaylists(), and MusicCommon::updatePlaylistStats().
|
inline |
Definition at line 107 of file playlist.h.
Referenced by PlaylistContainer::renamePlaylist().
|
inline |
Definition at line 109 of file playlist.h.
Referenced by addTrack(), fillSongsFromSonglist(), removeTrack(), and resync().
|
inline |
Definition at line 111 of file playlist.h.
Referenced by MusicCommon::customEvent(), PlaylistContainer::getPlaylist(), PlaylistContainer::getPlaylistName(), and PlaylistEditorView::getPlaylists().
|
inline |
Definition at line 112 of file playlist.h.
void Playlist::getStats | ( | uint * | trackCount, |
std::chrono::seconds * | totalLength, | ||
uint | currentTrack = 0 , |
||
std::chrono::seconds * | playedLength = nullptr |
||
) | const |
Definition at line 500 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), MusicCommon::doUpdatePlaylist(), MusicCommon::init(), MusicCommon::keyPressEvent(), savePlaylist(), and MusicCommon::updateShuffleMode().
void Playlist::resync | ( | void | ) |
make sure all tracks are still valid after a scan
Definition at line 612 of file playlist.cpp.
Referenced by PlaylistContainer::resync().
|
private |
Definition at line 1113 of file playlist.cpp.
Referenced by copyTracks(), removeAllCDTracks(), resync(), and shuffleTracks().
|
staticprivate |
Definition at line 1080 of file playlist.cpp.
Referenced by fillSonglistFromList(), and fillSonglistFromQuery().
|
private |
Definition at line 135 of file playlist.h.
Referenced by getID(), loadPlaylist(), loadPlaylistByID(), resync(), savePlaylist(), and setID().
|
private |
Definition at line 136 of file playlist.h.
Referenced by changed(), getName(), isActivePlaylist(), loadPlaylist(), loadPlaylistByID(), savePlaylist(), and setName().
|
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().
|
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 141 of file playlist.h.
Referenced by setParent(), and shuffleTracks().
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().