MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Playlist Class Reference

#include <playlist.h>

Inheritance diagram for Playlist:
Inheritance graph
[legend]
Collaboration diagram for Playlist:
Collaboration graph
[legend]

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)
 
MusicMetadatagetSongAt (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

MusicMetadatagetRawSongAt (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
 
PlaylistContainerm_parent {nullptr}
 
bool m_changed {false}
 
bool m_doSave {true}
 

Detailed Description

Definition at line 45 of file playlist.h.

Constructor & Destructor Documentation

◆ Playlist()

Playlist::Playlist ( void  )

Definition at line 143 of file playlist.cpp.

◆ ~Playlist()

Playlist::~Playlist ( )
override

Definition at line 148 of file playlist.cpp.

Member Function Documentation

◆ setParent()

void Playlist::setParent ( PlaylistContainer myparent)
inline

Definition at line 53 of file playlist.h.

Referenced by PlaylistContainer::load().

◆ loadPlaylist()

void Playlist::loadPlaylist ( const QString &  a_name,
const QString &  a_host 
)

Definition at line 521 of file playlist.cpp.

Referenced by PlaylistContainer::load().

◆ loadPlaylistByID()

void Playlist::loadPlaylistByID ( int  id,
const QString &  a_host 
)

Definition at line 577 of file playlist.cpp.

◆ savePlaylist()

void Playlist::savePlaylist ( const QString &  a_name,
const QString &  a_host 
)

Definition at line 994 of file playlist.cpp.

Referenced by changed(), loadPlaylist(), and PlaylistContainer::save().

◆ shuffleTracks()

void Playlist::shuffleTracks ( MusicPlayer::ShuffleMode  mode)

Definition at line 154 of file playlist.cpp.

Referenced by fillSongsFromSonglist(), loadPlaylist(), and MusicPlayer::setShuffleMode().

◆ describeYourself()

void Playlist::describeYourself ( void  ) const

Definition at line 474 of file playlist.cpp.

Referenced by PlaylistContainer::describeYourself().

◆ fillSongsFromSonglist()

void Playlist::fillSongsFromSonglist ( const QString &  songList)

◆ fillSonglistFromQuery()

void Playlist::fillSonglistFromQuery ( const QString &  whereClause,
bool  removeDuplicates = false,
InsertPLOption  insertOption = PL_REPLACE,
int  currentTrackID = 0 
)

Definition at line 682 of file playlist.cpp.

Referenced by MusicCommon::doUpdatePlaylist(), and fillSonglistFromSmartPlaylist().

◆ fillSonglistFromSmartPlaylist()

void Playlist::fillSonglistFromSmartPlaylist ( const QString &  category,
const QString &  name,
bool  removeDuplicates = false,
InsertPLOption  insertOption = PL_REPLACE,
int  currentTrackID = 0 
)

Definition at line 894 of file playlist.cpp.

◆ fillSonglistFromList()

void Playlist::fillSonglistFromList ( const QList< int > &  songList,
bool  removeDuplicates,
InsertPLOption  insertOption,
int  currentTrackID 
)

Definition at line 782 of file playlist.cpp.

Referenced by MusicCommon::doUpdatePlaylist(), and handleMedia().

◆ toRawSonglist()

QString Playlist::toRawSonglist ( bool  shuffled = false,
bool  tracksOnly = false 
)

◆ getSongAt()

MusicMetadata * Playlist::getSongAt ( int  pos) const

◆ getTrackCount()

int Playlist::getTrackCount ( void  )
inline

◆ moveTrackUpDown()

void Playlist::moveTrackUpDown ( bool  flag,
int  where_its_at 
)

Definition at line 127 of file playlist.cpp.

Referenced by MusicPlayer::moveTrackUpDown().

◆ checkTrack()

bool Playlist::checkTrack ( MusicMetadata::IdType  trackID) const

◆ addTrack()

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().

◆ getTrackPosition()

int Playlist::getTrackPosition ( MusicMetadata::IdType  trackID)
inline

Definition at line 90 of file playlist.h.

Referenced by MusicPlayer::moveTrackUpDown(), and MusicPlayer::removeTrack().

◆ removeTrack()

void Playlist::removeTrack ( MusicMetadata::IdType  trackID)

Definition at line 116 of file playlist.cpp.

Referenced by MusicPlayer::removeTrack(), and SearchView::trackClicked().

◆ removeAllTracks()

void Playlist::removeAllTracks ( void  )

◆ removeAllCDTracks()

void Playlist::removeAllCDTracks ( void  )

Definition at line 94 of file playlist.cpp.

Referenced by handleMedia().

◆ copyTracks()

void Playlist::copyTracks ( Playlist to_ptr,
bool  update_display 
)

◆ hasChanged()

bool Playlist::hasChanged ( void  ) const
inline

Definition at line 98 of file playlist.h.

◆ changed()

void Playlist::changed ( void  )

◆ disableSaves()

void Playlist::disableSaves ( void  )
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().

◆ enableSaves()

void Playlist::enableSaves ( void  )
inline

◆ doSaves()

bool Playlist::doSaves ( void  ) const
inline

Definition at line 104 of file playlist.h.

◆ getName()

QString Playlist::getName ( void  )
inline

◆ setName()

void Playlist::setName ( QString  a_name)
inline

Definition at line 107 of file playlist.h.

Referenced by PlaylistContainer::renamePlaylist().

◆ isActivePlaylist()

bool Playlist::isActivePlaylist ( void  )
inline

Definition at line 109 of file playlist.h.

Referenced by addTrack(), fillSongsFromSonglist(), removeTrack(), and resync().

◆ getID()

int Playlist::getID ( void  ) const
inline

◆ setID()

void Playlist::setID ( int  x)
inline

Definition at line 112 of file playlist.h.

◆ getStats()

void Playlist::getStats ( uint trackCount,
uint totalLength,
uint  currentTrack = 0,
uint playedLength = nullptr 
) const

◆ resync()

void Playlist::resync ( void  )

make sure all tracks are still valid after a scan

Definition at line 605 of file playlist.cpp.

Referenced by PlaylistContainer::resync().

◆ getRawSongAt()

MusicMetadata * Playlist::getRawSongAt ( int  pos) const
private

Definition at line 1106 of file playlist.cpp.

Referenced by copyTracks(), removeAllCDTracks(), resync(), and shuffleTracks().

◆ removeDuplicateTracks()

QString Playlist::removeDuplicateTracks ( const QString &  orig_songlist,
const QString &  new_songlist 
)
staticprivate

Definition at line 1068 of file playlist.cpp.

Referenced by fillSonglistFromList(), and fillSonglistFromQuery().

Member Data Documentation

◆ m_playlistid

int Playlist::m_playlistid {0}
private

Definition at line 134 of file playlist.h.

Referenced by getID(), loadPlaylist(), loadPlaylistByID(), resync(), savePlaylist(), and setID().

◆ m_name

QString Playlist::m_name
private

◆ m_songs

SongList Playlist::m_songs
private

◆ m_shuffledSongs

SongList Playlist::m_shuffledSongs
private

◆ m_parent

PlaylistContainer* Playlist::m_parent {nullptr}
private

Definition at line 140 of file playlist.h.

Referenced by setParent(), and shuffleTracks().

◆ m_changed

bool Playlist::m_changed {false}
private

Definition at line 141 of file playlist.h.

Referenced by changed(), hasChanged(), and savePlaylist().

◆ m_doSave

bool Playlist::m_doSave {true}
private

Definition at line 142 of file playlist.h.

Referenced by changed(), disableSaves(), doSaves(), and enableSaves().


The documentation for this class was generated from the following files: