Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
MusicUtils.h File Reference
#include "media/MediaType.h"
#include "utils/ContentUtils.h"
#include <memory>
#include <string>
#include <vector>

Namespaces

namespace  MUSIC_UTILS
 

Enumerations

enum class  MUSIC_UTILS::QueuePosition { MUSIC_UTILS::POSITION_BEGIN , MUSIC_UTILS::POSITION_END }
 

Functions

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.
 
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.
 
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).
 
int MUSIC_UTILS::ShowSelectRatingDialog (int iSelected)
 Show a dialog to allow the selection of user rating.
 
void MUSIC_UTILS::UpdateSongRatingJob (const std::shared_ptr< CFileItem > &pItem, int userrating)
 Helper function to asynchronously update the user rating of a song.
 
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.
 
bool MUSIC_UTILS::IsValidArtType (const std::string &potentialArtType)
 Validate string is acceptable as the name of an additional art type.
 
bool MUSIC_UTILS::IsAutoPlayNextItem (const CFileItem &item)
 Check whether auto play next item is set for the given item.
 
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.
 
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.
 
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.
 
bool MUSIC_UTILS::IsItemPlayable (const CFileItem &item)
 Check whether the given item can be played by the app playlist player as one or more songs.