Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
MUSIC_UTILS Namespace Reference

Classes

class  CSetArtJob
 
class  CSetSongRatingJob
 

Functions

void UpdateArtJob (const CFileItemPtr pItem, const std::string &strType, const std::string &strArt)
 Helper function to asynchronously update art in the music database and then refresh the album & artist art of the currently playing song. For the song, album or artist this adds a job to the queue to update the art table modifying, adding or deleting that type of art. Changes to album or artist art are then passed to the currently playing song (if there is one). More...
 
bool FillArtTypesList (CFileItem &musicitem, CFileItemList &artlist)
 Helper function to build a list of art types for a music library item. This fetches the possible types of art for a song, album or artist, and the current art URL (if the item has art of that type), for display on a dialog. More...
 
std::string ShowSelectArtTypeDialog (CFileItemList &artitems)
 Show a dialog to allow the selection of type of art from a list. Input is a fileitem list, with each item having an "arttype" property e.g. "thumb", current art URL (if art exists), and label. One of these art types can be selected, or a new art type added. The new art type is added as a new item in the list, as well as retuned as the selected art type. More...
 
int ShowSelectRatingDialog (int iSelected)
 Show a dialog to allow the selection of user rating. More...
 
void UpdateSongRatingJob (const CFileItemPtr pItem, int userrating)
 Helper function to asynchronously update the user rating of a song. More...
 

Function Documentation

§ FillArtTypesList()

bool MUSIC_UTILS::FillArtTypesList ( CFileItem musicitem,
CFileItemList artlist 
)

Helper function to build a list of art types for a music library item. This fetches the possible types of art for a song, album or artist, and the current art URL (if the item has art of that type), for display on a dialog.

Parameters
musicitema music CFileItem (song, album or artist)
artitems[out] a fileitem list, each item having "arttype" property e.g. "thumb", current art URL (if art exists), and localized label (for common arttypes)
Returns
true if art types are retrieved, false if none is found.
See also
ShowSelectArtTypeDialog

§ ShowSelectArtTypeDialog()

std::string MUSIC_UTILS::ShowSelectArtTypeDialog ( CFileItemList artitems)

Show a dialog to allow the selection of type of art from a list. Input is a fileitem list, with each item having an "arttype" property e.g. "thumb", current art URL (if art exists), and label. One of these art types can be selected, or a new art type added. The new art type is added as a new item in the list, as well as retuned as the selected art type.

Parameters
artitems[in/out] a fileitem list to display
Returns
the selected art type e.g. "fanart" or empty string when cancelled.
See also
FillArtTypesList

§ ShowSelectRatingDialog()

int MUSIC_UTILS::ShowSelectRatingDialog ( int  iSelected)

Show a dialog to allow the selection of user rating.

Parameters
iSelectedthe rating to show initially
Returns
the selected rating, 0 (no rating), 1 to 10 or -1 no rating selected

§ UpdateArtJob()

void MUSIC_UTILS::UpdateArtJob ( const CFileItemPtr  pItem,
const std::string &  strType,
const std::string &  strArt 
)

Helper function to asynchronously update art in the music database and then refresh the album & artist art of the currently playing song. For the song, album or artist this adds a job to the queue to update the art table modifying, adding or deleting that type of art. Changes to album or artist art are then passed to the currently playing song (if there is one).

Parameters
itema shared pointer to a music CFileItem (song, album or artist)
strTypethe type of art e.g. "fanart" or "thumb" etc.
strArtart URL, when empty the entry for that type of art is deleted.

§ UpdateSongRatingJob()

void MUSIC_UTILS::UpdateSongRatingJob ( const CFileItemPtr  pItem,
int  userrating 
)

Helper function to asynchronously update the user rating of a song.

Parameters
pItempointer to song item being rated
userratingthe userrating 0 = no rating, 1 to 10