Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Classes | |
class | CSetArtJob |
class | CSetSongRatingJob |
Enumerations | |
enum class | QueuePosition { POSITION_BEGIN , POSITION_END } |
Functions | |
void | UpdateArtJob (const std::shared_ptr< CFileItem > &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). | |
void | AddHardCodedAndExtendedArtTypes (std::vector< std::string > &artTypes, const CMusicInfoTag &tag) |
void | AddCurrentArtTypes (std::vector< std::string > &artTypes, const CMusicInfoTag &tag, CMusicDatabase &db) |
void | AddMediaTypeArtTypes (std::vector< std::string > &artTypes, const CMusicInfoTag &tag, CMusicDatabase &db) |
void | AddAvailableArtTypes (std::vector< std::string > &artTypes, const CMusicInfoTag &tag, CMusicDatabase &db) |
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. | |
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 returned as the selected art type. | |
int | ShowSelectRatingDialog (int iSelected) |
Show a dialog to allow the selection of user rating. | |
void | UpdateSongRatingJob (const std::shared_ptr< CFileItem > &pItem, int userrating) |
Helper function to asynchronously update the user rating of a song. | |
std::vector< std::string > | GetArtTypesToScan (const MediaType &mediaType) |
Get the types of art for an artist or album that are to be automatically fetched from local files during scanning. | |
bool | IsValidArtType (const std::string &potentialArtType) |
Validate string is acceptable as the name of an additional art type. | |
bool | IsAutoPlayNextItem (const CFileItem &item) |
Check whether auto play next item is set for the given item. | |
void | PlayItem (const std::shared_ptr< CFileItem > &item, const std::string &player, ContentUtils::PlayMode mode=ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM) |
Start playback of the given item. If the item is a folder, build a playlist with all items contained in the folder and start playback of the playlist. If item is a single music item, start playback directly, without adding it to the music playlist first. | |
void | QueueItem (const std::shared_ptr< CFileItem > &item, QueuePosition pos) |
Queue the given item in the currently active playlist. If none is active, put the item into the music playlist. Start playback of the playlist, if player is not already playing. | |
bool | GetItemsForPlayList (const std::shared_ptr< CFileItem > &item, CFileItemList &queuedItems) |
For a given item, get the items to put in a playlist. If the item is a folder, all subitems will be added recursively to the returned item list. If the item is a playlist, the playlist will be loaded and contained items will be added to the returned item list. Shows a busy dialog if action takes certain amount of time to give the user visual feedback. | |
bool | IsItemPlayable (const CFileItem &item) |
Check whether the given item can be played by the app playlist player as one or more songs. | |
|
strong |
void MUSIC_UTILS::AddAvailableArtTypes | ( | std::vector< std::string > & | artTypes, |
const CMusicInfoTag & | tag, | ||
CMusicDatabase & | db ) |
void MUSIC_UTILS::AddCurrentArtTypes | ( | std::vector< std::string > & | artTypes, |
const CMusicInfoTag & | tag, | ||
CMusicDatabase & | db ) |
void MUSIC_UTILS::AddHardCodedAndExtendedArtTypes | ( | std::vector< std::string > & | artTypes, |
const CMusicInfoTag & | tag ) |
void MUSIC_UTILS::AddMediaTypeArtTypes | ( | std::vector< std::string > & | artTypes, |
const CMusicInfoTag & | tag, | ||
CMusicDatabase & | db ) |
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.
musicitem | a 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) |
std::vector< std::string > MUSIC_UTILS::GetArtTypesToScan | ( | const MediaType & | mediaType | ) |
Get the types of art for an artist or album that are to be automatically fetched from local files during scanning.
mediaType | [in] artist or album |
bool MUSIC_UTILS::GetItemsForPlayList | ( | const std::shared_ptr< CFileItem > & | item, |
CFileItemList & | queuedItems ) |
For a given item, get the items to put in a playlist. If the item is a folder, all subitems will be added recursively to the returned item list. If the item is a playlist, the playlist will be loaded and contained items will be added to the returned item list. Shows a busy dialog if action takes certain amount of time to give the user visual feedback.
item | [in] the item to add to the playlist |
queuedItems | [out] the items that can be put in a play list |
Check whether auto play next item is set for the given item.
item | [in] the item to check |
Check whether the given item can be played by the app playlist player as one or more songs.
item | The item to check |
bool MUSIC_UTILS::IsValidArtType | ( | const std::string & | potentialArtType | ) |
Validate string is acceptable as the name of an additional art type.
potentialArtType | [in] potential art type name |
void MUSIC_UTILS::PlayItem | ( | const std::shared_ptr< CFileItem > & | item, |
const std::string & | player, | ||
ContentUtils::PlayMode | mode = ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM ) |
Start playback of the given item. If the item is a folder, build a playlist with all items contained in the folder and start playback of the playlist. If item is a single music item, start playback directly, without adding it to the music playlist first.
item | [in] the item to play |
player | [in] the player to use, empty for default player |
mode | [in] queue all successors and play them after item |
void MUSIC_UTILS::QueueItem | ( | const std::shared_ptr< CFileItem > & | item, |
QueuePosition | pos ) |
Queue the given item in the currently active playlist. If none is active, put the item into the music playlist. Start playback of the playlist, if player is not already playing.
item | [in] the item to queue |
pos | [in] whether to place the item and the begin or the end of the queue |
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 returned as the selected art type.
artitems | [in/out] a fileitem list to display |
Show a dialog to allow the selection of user rating.
iSelected | the rating to show initially |
void MUSIC_UTILS::UpdateArtJob | ( | const std::shared_ptr< CFileItem > & | 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).
item | a shared pointer to a music CFileItem (song, album or artist) |
strType | the type of art e.g. "fanart" or "thumb" etc. |
strArt | art URL, when empty the entry for that type of art is deleted. |