Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CMusicThumbLoader Class Reference

#include <MusicThumbLoader.h>

Inheritance diagram for CMusicThumbLoader:
CThumbLoader CBackgroundInfoLoader IRunnable

Public Member Functions

 CMusicThumbLoader ()
 
 ~CMusicThumbLoader () override
 
void OnLoaderStart () override
 
void OnLoaderFinish () override
 
bool LoadItem (CFileItem *pItem) override
 
bool LoadItemCached (CFileItem *pItem) override
 
bool LoadItemLookup (CFileItem *pItem) override
 
bool FillLibraryArt (CFileItem &item) override
 Helper function to fill all the art for a music library item This fetches the original url for each type of art, and sets fallback thumb and fanart. For songs the art for the related album and artist(s) is also set, and for albums that of the related artist(s). Art type is named according to media type of the item, for example: artists may have "thumb", "fanart", "logo", "poster" etc., albums may have "thumb", "spine" etc. and "artist.thumb", "artist.fanart" etc., songs may have "thumb", "album.thumb", "artist.thumb", "artist.fanart", "artist.logo",... "artist1.thumb", "artist1.fanart",... "albumartist.thumb", "albumartist1.thumb" etc. More...
 
virtual bool FillThumb (CFileItem &item, bool folderThumbs=true)
 Fill the thumb of a music file/folder item First uses a cached thumb from a previous run, then checks for a local thumb and caches it for the next run. More...
 
- Public Member Functions inherited from CThumbLoader
 CThumbLoader ()
 
 ~CThumbLoader () override
 
void OnLoaderStart () override
 
void OnLoaderFinish () override
 
virtual std::string GetCachedImage (const CFileItem &item, const std::string &type)
 Checks whether the given item has an image listed in the texture database. More...
 
virtual void SetCachedImage (const CFileItem &item, const std::string &type, const std::string &image)
 Associate an image with the given item in the texture database. More...
 
- Public Member Functions inherited from CBackgroundInfoLoader
 CBackgroundInfoLoader ()
 
 ~CBackgroundInfoLoader () override
 
void Load (CFileItemList &items)
 
bool IsLoading ()
 
void Run () override
 
void SetObserver (IBackgroundLoaderObserver *pObserver)
 
void SetProgressCallback (IProgressCallback *pCallback)
 
void StopThread ()
 
void StopAsync ()
 
- Public Member Functions inherited from IRunnable
virtual void Cancel ()
 
virtual ~IRunnable ()=default
 

Static Public Member Functions

static bool GetEmbeddedThumb (const std::string &path, EmbeddedArt &art)
 

Protected Types

typedef std::map< int, std::map< std::string, std::string > > ArtCache
 

Protected Attributes

CMusicDatabasem_musicDatabase
 
ArtCache m_albumArt
 
- Protected Attributes inherited from CThumbLoader
CTextureDatabasem_textureDatabase
 
- Protected Attributes inherited from CBackgroundInfoLoader
CFileItemListm_pVecItems
 
std::vector< CFileItemPtrm_vecItems
 
CCriticalSection m_lock
 
volatile bool m_bIsLoading
 
volatile bool m_bStop
 
CThreadm_thread
 
IBackgroundLoaderObserverm_pObserver
 
IProgressCallbackm_pProgressCallback
 

Additional Inherited Members

Member Typedef Documentation

◆ ArtCache

typedef std::map<int, std::map<std::string, std::string> > CMusicThumbLoader::ArtCache
protected

Constructor & Destructor Documentation

◆ CMusicThumbLoader()

CMusicThumbLoader::CMusicThumbLoader ( )

◆ ~CMusicThumbLoader()

CMusicThumbLoader::~CMusicThumbLoader ( )
override

Member Function Documentation

◆ FillLibraryArt()

bool CMusicThumbLoader::FillLibraryArt ( CFileItem item)
overridevirtual

Helper function to fill all the art for a music library item This fetches the original url for each type of art, and sets fallback thumb and fanart. For songs the art for the related album and artist(s) is also set, and for albums that of the related artist(s). Art type is named according to media type of the item, for example: artists may have "thumb", "fanart", "logo", "poster" etc., albums may have "thumb", "spine" etc. and "artist.thumb", "artist.fanart" etc., songs may have "thumb", "album.thumb", "artist.thumb", "artist.fanart", "artist.logo",... "artist1.thumb", "artist1.fanart",... "albumartist.thumb", "albumartist1.thumb" etc.

Parameters
itema music CFileItem
Returns
true if we fill art, false if there is no art found

Reimplemented from CThumbLoader.

◆ FillThumb()

bool CMusicThumbLoader::FillThumb ( CFileItem item,
bool  folderThumbs = true 
)
virtual

Fill the thumb of a music file/folder item First uses a cached thumb from a previous run, then checks for a local thumb and caches it for the next run.

Parameters
itemthe CFileItem object to fill
Returns
true if we fill the thumb, false otherwise

◆ GetEmbeddedThumb()

bool CMusicThumbLoader::GetEmbeddedThumb ( const std::string &  path,
EmbeddedArt art 
)
static

◆ LoadItem()

bool CMusicThumbLoader::LoadItem ( CFileItem pItem)
overridevirtual

Reimplemented from CBackgroundInfoLoader.

◆ LoadItemCached()

bool CMusicThumbLoader::LoadItemCached ( CFileItem pItem)
overridevirtual
Todo:
Remove as "fanart" is never been cached for music folders (only for

Reimplemented from CBackgroundInfoLoader.

◆ LoadItemLookup()

bool CMusicThumbLoader::LoadItemLookup ( CFileItem pItem)
overridevirtual

Reimplemented from CBackgroundInfoLoader.

◆ OnLoaderFinish()

void CMusicThumbLoader::OnLoaderFinish ( )
overridevirtual

Reimplemented from CBackgroundInfoLoader.

◆ OnLoaderStart()

void CMusicThumbLoader::OnLoaderStart ( )
overridevirtual

Reimplemented from CBackgroundInfoLoader.

Member Data Documentation

◆ m_albumArt

ArtCache CMusicThumbLoader::m_albumArt
protected

◆ m_musicDatabase

CMusicDatabase* CMusicThumbLoader::m_musicDatabase
protected

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