MythTV
master
|
#include <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) |
void | fillSonglistFromQuery (const QString &whereClause, bool removeDuplicates=false, InsertPLOption insertOption=PL_REPLACE, int currentTrackID=0) |
void | fillSonglistFromSmartPlaylist (const QString &category, const QString &name, bool removeDuplicates=false, InsertPLOption insertOption=PL_REPLACE, int currentTrackID=0) |
void | 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 (QString a_name) |
bool | isActivePlaylist (void) |
int | getID (void) const |
void | setID (int x) |
void | getStats (uint *trackCount, uint *totalLength, uint currentTrack=0, uint *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 | removeDuplicateTracks (const QString &orig_songlist, const QString &new_songlist) |
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 141 of file playlist.cpp.
|
override |
Definition at line 146 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 519 of file playlist.cpp.
Referenced by PlaylistContainer::load().
void Playlist::loadPlaylistByID | ( | int | id, |
const QString & | a_host | ||
) |
Definition at line 575 of file playlist.cpp.
void Playlist::savePlaylist | ( | const QString & | a_name, |
const QString & | a_host | ||
) |
Definition at line 992 of file playlist.cpp.
Referenced by changed(), loadPlaylist(), and PlaylistContainer::save().
void Playlist::shuffleTracks | ( | MusicPlayer::ShuffleMode | mode | ) |
Definition at line 152 of file playlist.cpp.
Referenced by fillSongsFromSonglist(), loadPlaylist(), and MusicPlayer::setShuffleMode().
void Playlist::describeYourself | ( | void | ) | const |
Definition at line 472 of file playlist.cpp.
Referenced by PlaylistContainer::describeYourself().
void Playlist::fillSongsFromSonglist | ( | const QString & | songList | ) |
Definition at line 631 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), loadPlaylist(), and loadPlaylistByID().
void Playlist::fillSonglistFromQuery | ( | const QString & | whereClause, |
bool | removeDuplicates = false , |
||
InsertPLOption | insertOption = PL_REPLACE , |
||
int | currentTrackID = 0 |
||
) |
Definition at line 680 of file playlist.cpp.
Referenced by MusicCommon::doUpdatePlaylist(), and fillSonglistFromSmartPlaylist().
void Playlist::fillSonglistFromSmartPlaylist | ( | const QString & | category, |
const QString & | name, | ||
bool | removeDuplicates = false , |
||
InsertPLOption | insertOption = PL_REPLACE , |
||
int | currentTrackID = 0 |
||
) |
Definition at line 892 of file playlist.cpp.
void Playlist::fillSonglistFromList | ( | const QList< int > & | songList, |
bool | removeDuplicates, | ||
InsertPLOption | insertOption, | ||
int | currentTrackID | ||
) |
Definition at line 780 of file playlist.cpp.
Referenced by MusicCommon::doUpdatePlaylist(), and handleMedia().
Definition at line 853 of file playlist.cpp.
Referenced by MusicCommon::customEvent(), fillSonglistFromList(), fillSonglistFromQuery(), and savePlaylist().
MusicMetadata * Playlist::getSongAt | ( | int | pos | ) | const |
Definition at line 1086 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(), MusicCommon::updatePlaylistStats(), PlaylistEditorView::updateSonglist(), and MusicCommon::updateUIPlaylist().
void Playlist::moveTrackUpDown | ( | bool | flag, |
int | where_its_at | ||
) |
Definition at line 125 of file playlist.cpp.
Referenced by MusicPlayer::moveTrackUpDown().
bool Playlist::checkTrack | ( | MusicMetadata::IdType | trackID | ) | const |
Definition at line 35 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 60 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 114 of file playlist.cpp.
Referenced by MusicPlayer::removeTrack(), and SearchView::trackClicked().
void Playlist::removeAllTracks | ( | void | ) |
Definition at line 84 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 92 of file playlist.cpp.
Referenced by handleMedia().
Definition at line 40 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 984 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, |
uint * | totalLength, | ||
uint | currentTrack = 0 , |
||
uint * | playedLength = nullptr |
||
) | const |
Definition at line 492 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 603 of file playlist.cpp.
Referenced by PlaylistContainer::resync().
|
private |
Definition at line 1104 of file playlist.cpp.
Referenced by copyTracks(), removeAllCDTracks(), resync(), and shuffleTracks().
|
staticprivate |
Definition at line 1066 of file playlist.cpp.
Referenced by fillSonglistFromList(), and fillSonglistFromQuery().
|
private |
Definition at line 134 of file playlist.h.
Referenced by getID(), loadPlaylist(), loadPlaylistByID(), resync(), savePlaylist(), and setID().
|
private |
Definition at line 135 of file playlist.h.
Referenced by changed(), getName(), isActivePlaylist(), loadPlaylist(), loadPlaylistByID(), savePlaylist(), and setName().
|
private |
Definition at line 137 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 138 of file playlist.h.
Referenced by addTrack(), getSongAt(), getStats(), getTrackPosition(), moveTrackUpDown(), removeAllCDTracks(), removeAllTracks(), removeTrack(), resync(), shuffleTracks(), toRawSonglist(), and ~Playlist().
|
private |
Definition at line 140 of file playlist.h.
Referenced by setParent(), and shuffleTracks().
Definition at line 141 of file playlist.h.
Referenced by changed(), hasChanged(), and savePlaylist().
Definition at line 142 of file playlist.h.
Referenced by changed(), disableSaves(), doSaves(), and enableSaves().