Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <Fanart.h>
Public Member Functions | |
CFanart () | |
Standard constructor doesn't need to do anything. | |
void | Pack () |
bool | Unpack () |
std::string | GetImageURL (unsigned int index=0) const |
std::string | GetPreviewURL (unsigned int index=0) const |
const std::string | GetColor (unsigned int index) const |
bool | SetPrimaryFanart (unsigned int index) |
unsigned int | GetNumFanarts () const |
void | AddFanart (const std::string &image, const std::string &preview, const std::string &colors) |
Adds an image to internal fanart data. | |
void | Clear () |
Clear all internal fanart data. | |
Public Attributes | |
std::string | m_xml |
/brief CFanart is the core of fanart support and contains all fanart data for a specific show
CFanart stores all data related to all available fanarts for a given TV show and provides functions required to manipulate and access that data. In order to provide an interface between the fanart data and the XBMC database, all data is stored internally it its own form, as well as packed into an XML formatted string stored in the member variable m_xml. Information on multiple fanarts for a given show is stored, but XBMC only cares about the very first fanart stored. These interfaces provide a means to access the data in that first fanart record, as well as to set which fanart is the first record. Externally, all XBMC needs to care about is getting and setting that first record. Everything else is maintained internally by CFanart. This point is key to using the interface properly.
|
default |
Standard constructor doesn't need to do anything.
CFanart Functions.
void CFanart::AddFanart | ( | const std::string & | image, |
const std::string & | preview, | ||
const std::string & | colors ) |
Adds an image to internal fanart data.
void CFanart::Clear | ( | ) |
Clear all internal fanart data.
const std::string CFanart::GetColor | ( | unsigned int | index | ) | const |
Used to return a specified fanart theme color value
index | 0 based index of the color to retrieve. A fanart theme contains 3 colors, indices 0-2, arranged from darkest to lightest. |
std::string CFanart::GetImageURL | ( | unsigned int | index = 0 | ) | const |
Retrieves the fanart full res image URL
index | - index of image to retrieve (defaults to 0) |
unsigned int CFanart::GetNumFanarts | ( | ) | const |
Returns how many fanarts are stored
std::string CFanart::GetPreviewURL | ( | unsigned int | index = 0 | ) | const |
Retrieves the fanart preview image URL, or full res image URL if that doesn't exist
index | - index of image to retrieve (defaults to 0) |
void CFanart::Pack | ( | ) |
Takes the internal fanart data and packs it into an XML formatted string in m_xml
Sets a particular fanart to be the "primary" fanart, or in other words, sets which fanart is actually used by XBMC
This is the one of the only instances in the public interface where there is any hint that more than one fanart exists, but its by necessity.
index | 0 based index of which fanart to set as the primary fanart |
bool CFanart::Unpack | ( | ) |
Takes the XML formatted string m_xml and unpacks the fanart data contained into the internal data
std::string CFanart::m_xml |
m_xml contains an XML formatted string which is all fanart packed into one string.
This string is the "interface" as it were to the XBMC database, and MUST be kept in sync with the rest of the class. Therefore anytime this string is changed, the change should be followed up by a call to CFanart::UnPack(). This XML formatted string is also the interface used to pass the fanart data from the scraper to CFanart.