Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::VIDEO::UTILS Namespace Reference

Classes

struct  ResumeInformation
 

Enumerations

enum class  QueuePosition { POSITION_BEGIN , POSITION_END }
 

Functions

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 video item, start playback directly, without adding it to the video playlist first.
 
void QueueItem (const std::shared_ptr< CFileItem > &item, QueuePosition pos)
 Queue the given item in the currently active playlist. If no playlist is active, put the item into the video playlist.
 
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 videos.
 
bool HasItemVideoDbInformation (const CFileItem &item)
 Check whether for the given item information is stored in the video database.
 
std::string GetResumeString (const CFileItem &item)
 Get a localized resume string for the given item, if it is resumable.
 
std::string GetResumeString (int64_t startOffset, unsigned int partNumber)
 Get a localized resume string for the given start offset.
 
std::string FindTrailer (const CFileItem &item)
 Find a local trailer file for a given file item.
 
std::string GetOpticalMediaPath (const CFileItem &item)
 Check whether an item is an optical media folder or its parent. This will return the non-empty path to the playable entry point of the media one or two levels down (VIDEO_TS.IFO for DVDs or index.bdmv for BDs). The returned path will be empty if folder does not meet this criterion.
 
bool IsAutoPlayNextItem (const CFileItem &item)
 Check whether auto play next item is set for the media type of the given item.
 
bool IsAutoPlayNextItem (const std::string &content)
 Check whether auto play next item is set for the given content type.
 
std::tuple< int64_t, unsigned intGetStackResumeOffsetAndPartNumber (const CFileItem &item)
 Get the resume offset and part number for the given stack item.
 
int64_t GetStackPartResumeOffset (const CFileItem &item, unsigned int partNumber)
 Get the resume offset for a part of a stack item.
 
int64_t GetStackPartStartOffset (const CFileItem &item, unsigned int partNumber)
 Get the start offset for a part of a stack item.
 
ResumeInformation GetItemResumeInformation (const CFileItem &item)
 Check whether playback of the given item can be resumed, get detailed information.
 
std::shared_ptr< CFileItemLoadVideoFilesFolderInfo (const CFileItem &folder)
 For a given non-library folder containing video files, load info from the video database.
 

Enumeration Type Documentation

◆ QueuePosition

Enumerator
POSITION_BEGIN 
POSITION_END 

Function Documentation

◆ FindTrailer()

std::string KODI::VIDEO::UTILS::FindTrailer ( const CFileItem & item)

Find a local trailer file for a given file item.

Returns
non-empty string with path of trailer if found

◆ GetItemResumeInformation()

ResumeInformation KODI::VIDEO::UTILS::GetItemResumeInformation ( const CFileItem & item)

Check whether playback of the given item can be resumed, get detailed information.

Parameters
itemThe item to retrieve information for
Returns
The resume information.

◆ GetItemsForPlayList()

bool KODI::VIDEO::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.

Parameters
item[in] the item to add to the playlist
queuedItems[out] the items that can be put in a play list
Returns
true on success, false otherwise

◆ GetOpticalMediaPath()

std::string KODI::VIDEO::UTILS::GetOpticalMediaPath ( const CFileItem & item)

Check whether an item is an optical media folder or its parent. This will return the non-empty path to the playable entry point of the media one or two levels down (VIDEO_TS.IFO for DVDs or index.bdmv for BDs). The returned path will be empty if folder does not meet this criterion.

Returns
non-empty string if item is optical media folder, empty otherwise.

◆ GetResumeString() [1/2]

std::string KODI::VIDEO::UTILS::GetResumeString ( const CFileItem & item)

Get a localized resume string for the given item, if it is resumable.

Parameters
itemThe item to retrieve the resume string for
Returns
The resume string or empty string in case the item is not resumable.

◆ GetResumeString() [2/2]

std::string KODI::VIDEO::UTILS::GetResumeString ( int64_t startOffset,
unsigned int partNumber )

Get a localized resume string for the given start offset.

Parameters
startOffsetThe Start offset to get the resume string for
partNumberThe part number if available (1-based), 0 otherwise
Returns
The resume string.

◆ GetStackPartResumeOffset()

int64_t KODI::VIDEO::UTILS::GetStackPartResumeOffset ( const CFileItem & item,
unsigned int partNumber )

Get the resume offset for a part of a stack item.

Parameters
itemThe stack item to retrieve the offset for
partNumberThe number of the part (1-based)
Returns
The offset or -1 if not found
Todo
Should the part number be set when loading/setting tags's bookmark from db, like done for disc image stacks?

◆ GetStackPartStartOffset()

int64_t KODI::VIDEO::UTILS::GetStackPartStartOffset ( const CFileItem & item,
unsigned int partNumber )

Get the start offset for a part of a stack item.

Parameters
itemThe stack item to retrieve the offset for
partNumberThe number of the part (1-based)
Returns
The offset or -1 if not found

◆ GetStackResumeOffsetAndPartNumber()

std::tuple< int64_t, unsigned int > KODI::VIDEO::UTILS::GetStackResumeOffsetAndPartNumber ( const CFileItem & item)

Get the resume offset and part number for the given stack item.

Parameters
itemThe stack item to retrieve the offset for
Returns
The offset or -1 if not found and the part number or 0 if not available
Todo
Should the part number be set when loading/setting tags's bookmark from db, like done for disc image stacks?

◆ HasItemVideoDbInformation()

bool KODI::VIDEO::UTILS::HasItemVideoDbInformation ( const CFileItem & item)

Check whether for the given item information is stored in the video database.

Parameters
itemThe item to check
Returns
True if info is available, false otherwise.

◆ IsAutoPlayNextItem() [1/2]

bool KODI::VIDEO::UTILS::IsAutoPlayNextItem ( const CFileItem & item)

Check whether auto play next item is set for the media type of the given item.

Parameters
item[in] the item to check
Returns
True if auto play next item is active, false otherwise.

◆ IsAutoPlayNextItem() [2/2]

bool KODI::VIDEO::UTILS::IsAutoPlayNextItem ( const std::string & content)

Check whether auto play next item is set for the given content type.

Parameters
item[in] the content to check
Returns
True if auto play next item is active, false otherwise.

◆ IsItemPlayable()

bool KODI::VIDEO::UTILS::IsItemPlayable ( const CFileItem & item)

Check whether the given item can be played by the app playlist player as one or more videos.

Parameters
itemThe item to check
Returns
True if playable, false otherwise.

◆ LoadVideoFilesFolderInfo()

std::shared_ptr< CFileItem > KODI::VIDEO::UTILS::LoadVideoFilesFolderInfo ( const CFileItem & folder)

For a given non-library folder containing video files, load info from the video database.

Parameters
folderThe folder to load
Returns
The item containing the folder including loaded info.

◆ PlayItem()

void KODI::VIDEO::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 video item, start playback directly, without adding it to the video playlist first.

Parameters
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

◆ QueueItem()

void KODI::VIDEO::UTILS::QueueItem ( const std::shared_ptr< CFileItem > & item,
QueuePosition pos )

Queue the given item in the currently active playlist. If no playlist is active, put the item into the video playlist.

Parameters
item[in] the item to queue
pos[in] whether to place the item and the begin or the end of the queue