xbmc
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MUSIC_GRABBER::CMusicInfoScraper Class Reference
Inheritance diagram for MUSIC_GRABBER::CMusicInfoScraper:
Inheritance graph
[legend]
Collaboration diagram for MUSIC_GRABBER::CMusicInfoScraper:
Collaboration graph
[legend]

Public Member Functions

 CMusicInfoScraper (const ADDON::ScraperPtr &scraper)
 
void FindAlbumInfo (const std::string &strAlbum, const std::string &strArtist="")
 
void LoadAlbumInfo (int iAlbum)
 
void FindArtistInfo (const std::string &strArtist)
 
void LoadArtistInfo (int iArtist, const std::string &strSearch)
 
bool Completed ()
 
bool Succeeded ()
 
void Cancel ()
 
bool IsCanceled ()
 
int GetAlbumCount () const
 
int GetArtistCount () const
 
CMusicAlbumInfoGetAlbum (int iAlbum)
 
CMusicArtistInfoGetArtist (int iArtist)
 
std::vector< CMusicArtistInfo > & GetArtists ()
 
std::vector< CMusicAlbumInfo > & GetAlbums ()
 
void SetScraperInfo (const ADDON::ScraperPtr &scraper)
 
bool CheckValidOrFallback (const std::string &fallbackScraper)
 Checks whether we have a valid scraper. If not, we try the fallbackScraper First tests the current scraper for validity by loading it. If it is not valid we attempt to load the fallback scraper. If this is also invalid we return false. More...
 
- Public Member Functions inherited from CThread
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
virtual void OnException ()
 

Protected Member Functions

void FindAlbumInfo ()
 
void LoadAlbumInfo ()
 
void FindArtistInfo ()
 
void LoadArtistInfo ()
 
void OnStartup () override
 
void Process () override
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
virtual void OnExit ()
 
WaitResponse AbortableWait (CEvent &event, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 This call will wait on a CEvent in an interruptible way such that if stop is called on the thread the wait will return with a response indicating what happened.
 

Protected Attributes

std::vector< CMusicAlbumInfom_vecAlbums
 
std::vector< CMusicArtistInfom_vecArtists
 
std::string m_strAlbum
 
std::string m_strArtist
 
std::string m_strSearch
 
int m_iAlbum
 
int m_iArtist
 
bool m_bSucceeded
 
bool m_bCanceled
 
XFILE::CCurlFilem_http
 
ADDON::ScraperPtr m_scraper
 
- Protected Attributes inherited from CThread
std::atomic< bool > m_bStop
 

Additional Inherited Members

- Static Public Member Functions inherited from CThread
static const std::thread::id GetCurrentThreadId ()
 
static CThreadGetCurrentThread ()
 
- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1, WAIT_SIGNALED = 0, WAIT_TIMEDOUT = 1 }
 

Member Function Documentation

◆ CheckValidOrFallback()

bool CMusicInfoScraper::CheckValidOrFallback ( const std::string &  fallbackScraper)

Checks whether we have a valid scraper. If not, we try the fallbackScraper First tests the current scraper for validity by loading it. If it is not valid we attempt to load the fallback scraper. If this is also invalid we return false.

Parameters
fallbackScrapername of scraper to use as a fallback
Returns
true if we have a valid scraper (or the default is valid).
Todo:
Handle fallback mechanism

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