MythTV master
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
AllMusic Class Reference

#include <libmythmetadata/musicmetadata.h>

Collaboration diagram for AllMusic:
[legend]

Public Member Functions

 AllMusic (void)
 
 ~AllMusic ()
 
MusicMetadatagetMetadata (int an_id)
 
bool updateMetadata (int an_id, MusicMetadata *the_track)
 
int count () const
 
int countLoaded () const
 
void save ()
 Check each MusicMetadata entry and save those that have changed (ratings, etc.) More...
 
bool startLoading (void)
 Start loading metadata. More...
 
void resync ()
 resync our cache with the database More...
 
void clearCDData (void)
 
void addCDTrack (const MusicMetadata &the_track)
 
bool checkCDTrack (MusicMetadata *the_track)
 
MusicMetadatagetCDMetadata (int m_the_track)
 
QString getCDTitle (void) const
 
void setCDTitle (const QString &a_title)
 
int getCDTrackCount (void) const
 
bool doneLoading () const
 
bool cleanOutThreads ()
 
MetadataPtrListgetAllMetadata (void)
 
MetadataPtrListgetAllCDMetadata (void)
 
bool isValidID (int an_id)
 

Private Types

using MusicMap = QMap< int, MusicMetadata * >
 

Private Member Functions

 Q_DECLARE_TR_FUNCTIONS (AllMusic)
 

Private Attributes

MetadataPtrList m_allMusic
 
int m_numPcs {0}
 
int m_numLoaded {0}
 
MusicMap m_musicMap
 
MetadataPtrList m_cdData
 
QString m_cdTitle
 
MetadataLoadingThreadm_metadataLoader {nullptr}
 
bool m_doneLoading {false}
 
int m_playCountMin {0}
 
int m_playCountMax {0}
 
qint64 m_lastPlayMin {0}
 
qint64 m_lastPlayMax {0}
 

Detailed Description

Definition at line 426 of file musicmetadata.h.

Member Typedef Documentation

◆ MusicMap

using AllMusic::MusicMap = QMap<int, MusicMetadata*>
private

Definition at line 466 of file musicmetadata.h.

Constructor & Destructor Documentation

◆ AllMusic()

AllMusic::AllMusic ( void  )

Definition at line 1437 of file musicmetadata.cpp.

◆ ~AllMusic()

AllMusic::~AllMusic ( )

Definition at line 1443 of file musicmetadata.cpp.

Member Function Documentation

◆ addCDTrack()

void AllMusic::addCDTrack ( const MusicMetadata the_track)

Definition at line 1706 of file musicmetadata.cpp.

Referenced by handleMedia().

◆ checkCDTrack()

bool AllMusic::checkCDTrack ( MusicMetadata the_track)

Definition at line 1715 of file musicmetadata.cpp.

◆ cleanOutThreads()

bool AllMusic::cleanOutThreads ( )

Definition at line 1461 of file musicmetadata.cpp.

Referenced by mythplugin_destroy(), and startLoading().

◆ clearCDData()

void AllMusic::clearCDData ( void  )

Definition at line 1691 of file musicmetadata.cpp.

Referenced by handleMedia().

◆ count()

int AllMusic::count ( ) const
inline

Definition at line 437 of file musicmetadata.h.

◆ countLoaded()

int AllMusic::countLoaded ( ) const
inline

Definition at line 438 of file musicmetadata.h.

◆ doneLoading()

bool AllMusic::doneLoading ( ) const
inline

◆ getAllCDMetadata()

MetadataPtrList * AllMusic::getAllCDMetadata ( void  )
inline

◆ getAllMetadata()

MetadataPtrList * AllMusic::getAllMetadata ( void  )
inline

◆ getCDMetadata()

MusicMetadata * AllMusic::getCDMetadata ( int  m_the_track)

Definition at line 1723 of file musicmetadata.cpp.

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

◆ getCDTitle()

QString AllMusic::getCDTitle ( void  ) const
inline

Definition at line 448 of file musicmetadata.h.

Referenced by PlaylistEditorView::createRootNode().

◆ getCDTrackCount()

int AllMusic::getCDTrackCount ( void  ) const
inline

◆ getMetadata()

MusicMetadata * AllMusic::getMetadata ( int  an_id)

◆ isValidID()

bool AllMusic::isValidID ( int  an_id)

Definition at line 1661 of file musicmetadata.cpp.

Referenced by Playlist::fillSongsFromSonglist().

◆ Q_DECLARE_TR_FUNCTIONS()

AllMusic::Q_DECLARE_TR_FUNCTIONS ( AllMusic  )
private

◆ resync()

void AllMusic::resync ( )

resync our cache with the database

Definition at line 1506 of file musicmetadata.cpp.

Referenced by MetadataLoadingThread::run().

◆ save()

void AllMusic::save ( void  )

Check each MusicMetadata entry and save those that have changed (ratings, etc.)

Definition at line 1681 of file musicmetadata.cpp.

Referenced by mythplugin_destroy().

◆ setCDTitle()

void AllMusic::setCDTitle ( const QString &  a_title)
inline

Definition at line 449 of file musicmetadata.h.

◆ startLoading()

bool AllMusic::startLoading ( void  )

Start loading metadata.

Makes the AllMusic object run it's resync in a thread. Once done, the doneLoading() method will return true.

Note
Alternatively, this could be made to emit a signal so the caller won't have to poll for completion.
Returns
true if the loader thread was started

Definition at line 1487 of file musicmetadata.cpp.

Referenced by AllMusic(), and MusicData::reloadMusic().

◆ updateMetadata()

bool AllMusic::updateMetadata ( int  an_id,
MusicMetadata the_track 
)

Definition at line 1666 of file musicmetadata.cpp.

Member Data Documentation

◆ m_allMusic

MetadataPtrList AllMusic::m_allMusic
private

Definition at line 461 of file musicmetadata.h.

Referenced by resync(), save(), and ~AllMusic().

◆ m_cdData

MetadataPtrList AllMusic::m_cdData
private

Definition at line 470 of file musicmetadata.h.

Referenced by addCDTrack(), checkCDTrack(), clearCDData(), getCDMetadata(), and ~AllMusic().

◆ m_cdTitle

QString AllMusic::m_cdTitle
private

Definition at line 471 of file musicmetadata.h.

Referenced by clearCDData().

◆ m_doneLoading

bool AllMusic::m_doneLoading {false}
private

Definition at line 474 of file musicmetadata.h.

Referenced by resync(), and startLoading().

◆ m_lastPlayMax

qint64 AllMusic::m_lastPlayMax {0}
private

Definition at line 479 of file musicmetadata.h.

Referenced by resync().

◆ m_lastPlayMin

qint64 AllMusic::m_lastPlayMin {0}
private

Definition at line 478 of file musicmetadata.h.

Referenced by resync().

◆ m_metadataLoader

MetadataLoadingThread* AllMusic::m_metadataLoader {nullptr}
private

Definition at line 473 of file musicmetadata.h.

Referenced by cleanOutThreads(), startLoading(), and ~AllMusic().

◆ m_musicMap

MusicMap AllMusic::m_musicMap
private

Definition at line 467 of file musicmetadata.h.

Referenced by addCDTrack(), clearCDData(), getMetadata(), isValidID(), and resync().

◆ m_numLoaded

int AllMusic::m_numLoaded {0}
private

Definition at line 464 of file musicmetadata.h.

Referenced by resync().

◆ m_numPcs

int AllMusic::m_numPcs {0}
private

Definition at line 463 of file musicmetadata.h.

Referenced by resync().

◆ m_playCountMax

int AllMusic::m_playCountMax {0}
private

Definition at line 477 of file musicmetadata.h.

Referenced by resync().

◆ m_playCountMin

int AllMusic::m_playCountMin {0}
private

Definition at line 476 of file musicmetadata.h.

Referenced by resync().


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