MythTV  master
Public Member Functions | 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 ()
 
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)
 
void changed (void)
 
void disableSaves (void)
 whether any changes should be saved to the DB More...
 
void enableSaves (void)
 
bool doSaves (void)
 
QString getName (void)
 
void setName (QString a_name)
 
bool isActivePlaylist (void)
 
int getID (void)
 
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
 
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 42 of file playlist.h.

Constructor & Destructor Documentation

◆ Playlist()

Playlist::Playlist ( void  )

Definition at line 144 of file playlist.cpp.

◆ ~Playlist()

Playlist::~Playlist ( )

Definition at line 149 of file playlist.cpp.

Member Function Documentation

◆ setParent()

void Playlist::setParent ( PlaylistContainer myparent)
inline

◆ loadPlaylist()

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

Definition at line 532 of file playlist.cpp.

Referenced by PlaylistContainer::load().

◆ loadPlaylistByID()

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

Definition at line 589 of file playlist.cpp.

Referenced by PlaylistContainer::load().

◆ savePlaylist()

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

◆ shuffleTracks()

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

Definition at line 155 of file playlist.cpp.

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

◆ describeYourself()

void Playlist::describeYourself ( void  ) const

Definition at line 486 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 692 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 898 of file playlist.cpp.

◆ fillSonglistFromList()

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

Definition at line 789 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 128 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 63 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 87 of file playlist.h.

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

◆ removeTrack()

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

Definition at line 117 of file playlist.cpp.

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

◆ removeAllTracks()

void Playlist::removeAllTracks ( void  )

◆ removeAllCDTracks()

void Playlist::removeAllCDTracks ( void  )

Definition at line 95 of file playlist.cpp.

Referenced by handleMedia().

◆ copyTracks()

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

◆ hasChanged()

bool Playlist::hasChanged ( void  )
inline

Definition at line 95 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 99 of file playlist.h.

Referenced by fillSonglistFromList(), fillSonglistFromQuery(), and MusicPlayer::loadStreamPlaylist().

◆ enableSaves()

void Playlist::enableSaves ( void  )
inline

◆ doSaves()

bool Playlist::doSaves ( void  )
inline

Definition at line 101 of file playlist.h.

◆ getName()

QString Playlist::getName ( void  )
inline

◆ setName()

void Playlist::setName ( QString  a_name)
inline

Definition at line 104 of file playlist.h.

Referenced by PlaylistContainer::renamePlaylist().

◆ isActivePlaylist()

bool Playlist::isActivePlaylist ( void  )
inline

Definition at line 106 of file playlist.h.

Referenced by fillSongsFromSonglist(), and resync().

◆ getID()

int Playlist::getID ( void  )
inline

◆ setID()

void Playlist::setID ( int  x)
inline

Definition at line 109 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 617 of file playlist.cpp.

Referenced by PlaylistContainer::resync().

◆ getRawSongAt()

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

Definition at line 1103 of file playlist.cpp.

Referenced by resync(), and shuffleTracks().

◆ removeDuplicateTracks()

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

Definition at line 1069 of file playlist.cpp.

Referenced by fillSonglistFromList(), and fillSonglistFromQuery().

Member Data Documentation

◆ m_playlistid

int Playlist::m_playlistid {0}
private

Definition at line 130 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 136 of file playlist.h.

Referenced by setParent(), and shuffleTracks().

◆ m_changed

bool Playlist::m_changed {false}
private

Definition at line 137 of file playlist.h.

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

◆ m_doSave

bool Playlist::m_doSave {true}
private

Definition at line 138 of file playlist.h.

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


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