Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
MUSIC_GRABBER::CMusicInfoScraper Class Reference

#include <MusicInfoScraper.h>

Inheritance diagram for MUSIC_GRABBER::CMusicInfoScraper:
CThread

Public Member Functions

 CMusicInfoScraper (const ADDON::ScraperPtr &scraper)
 
 ~CMusicInfoScraper (void) override
 
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.
 
- Public Member Functions inherited from CThread
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
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))
 

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< boolm_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 }
 

Constructor & Destructor Documentation

◆ CMusicInfoScraper()

CMusicInfoScraper::CMusicInfoScraper ( const ADDON::ScraperPtr & scraper)
explicit

◆ ~CMusicInfoScraper()

CMusicInfoScraper::~CMusicInfoScraper ( void )
override

Member Function Documentation

◆ Cancel()

void CMusicInfoScraper::Cancel ( )

◆ 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

◆ Completed()

bool CMusicInfoScraper::Completed ( )

◆ FindAlbumInfo() [1/2]

void CMusicInfoScraper::FindAlbumInfo ( )
protected

◆ FindAlbumInfo() [2/2]

void CMusicInfoScraper::FindAlbumInfo ( const std::string & strAlbum,
const std::string & strArtist = "" )

◆ FindArtistInfo() [1/2]

void CMusicInfoScraper::FindArtistInfo ( )
protected

◆ FindArtistInfo() [2/2]

void CMusicInfoScraper::FindArtistInfo ( const std::string & strArtist)

◆ GetAlbum()

CMusicAlbumInfo & CMusicInfoScraper::GetAlbum ( int iAlbum)

◆ GetAlbumCount()

int CMusicInfoScraper::GetAlbumCount ( ) const

◆ GetAlbums()

std::vector< CMusicAlbumInfo > & MUSIC_GRABBER::CMusicInfoScraper::GetAlbums ( )
inline

◆ GetArtist()

CMusicArtistInfo & CMusicInfoScraper::GetArtist ( int iArtist)

◆ GetArtistCount()

int CMusicInfoScraper::GetArtistCount ( ) const

◆ GetArtists()

std::vector< CMusicArtistInfo > & MUSIC_GRABBER::CMusicInfoScraper::GetArtists ( )
inline

◆ IsCanceled()

bool CMusicInfoScraper::IsCanceled ( )

◆ LoadAlbumInfo() [1/2]

void CMusicInfoScraper::LoadAlbumInfo ( )
protected

◆ LoadAlbumInfo() [2/2]

void CMusicInfoScraper::LoadAlbumInfo ( int iAlbum)

◆ LoadArtistInfo() [1/2]

void CMusicInfoScraper::LoadArtistInfo ( )
protected

◆ LoadArtistInfo() [2/2]

void CMusicInfoScraper::LoadArtistInfo ( int iArtist,
const std::string & strSearch )

◆ OnStartup()

void CMusicInfoScraper::OnStartup ( )
overrideprotectedvirtual

Reimplemented from CThread.

◆ Process()

void CMusicInfoScraper::Process ( void )
overrideprotectedvirtual

Reimplemented from CThread.

◆ SetScraperInfo()

void MUSIC_GRABBER::CMusicInfoScraper::SetScraperInfo ( const ADDON::ScraperPtr & scraper)
inline

◆ Succeeded()

bool CMusicInfoScraper::Succeeded ( )

Member Data Documentation

◆ m_bCanceled

bool MUSIC_GRABBER::CMusicInfoScraper::m_bCanceled
protected

◆ m_bSucceeded

bool MUSIC_GRABBER::CMusicInfoScraper::m_bSucceeded
protected

◆ m_http

XFILE::CCurlFile* MUSIC_GRABBER::CMusicInfoScraper::m_http
protected

◆ m_iAlbum

int MUSIC_GRABBER::CMusicInfoScraper::m_iAlbum
protected

◆ m_iArtist

int MUSIC_GRABBER::CMusicInfoScraper::m_iArtist
protected

◆ m_scraper

ADDON::ScraperPtr MUSIC_GRABBER::CMusicInfoScraper::m_scraper
protected

◆ m_strAlbum

std::string MUSIC_GRABBER::CMusicInfoScraper::m_strAlbum
protected

◆ m_strArtist

std::string MUSIC_GRABBER::CMusicInfoScraper::m_strArtist
protected

◆ m_strSearch

std::string MUSIC_GRABBER::CMusicInfoScraper::m_strSearch
protected

◆ m_vecAlbums

std::vector<CMusicAlbumInfo> MUSIC_GRABBER::CMusicInfoScraper::m_vecAlbums
protected

◆ m_vecArtists

std::vector<CMusicArtistInfo> MUSIC_GRABBER::CMusicInfoScraper::m_vecArtists
protected

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