Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Disc operations More...

Functions

virtual bool kodi::addon::CInstanceGame::GetEjectState ()
 Returns whether the virtual disk tray is currently ejected.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::SetEjectState (bool ejected)
 Opens or closes the virtual disk tray.
 
virtual unsigned int kodi::addon::CInstanceGame::GetImageIndex ()
 Gets the index of the currently inserted disk image.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::SetImageIndex (unsigned int imageIndex)
 Inserts the disk image at the given index.
 
virtual unsigned int kodi::addon::CInstanceGame::GetImageCount ()
 Gets the number of available disk images.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::AddImageIndex ()
 Adds a new disk image slot.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::ReplaceImageIndex (unsigned int imageIndex, const std::string &filePath)
 Replaces the disk image at the given index.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::RemoveImageIndex (unsigned int imageIndex)
 Removes the disk image at the given index.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::SetInitialImage (unsigned int imageIndex, const std::string &filePath)
 Sets which image should be initially inserted on load.
 
virtual std::string kodi::addon::CInstanceGame::GetImagePath (unsigned int imageIndex)
 Gets the full path of a disk image.
 
virtual std::string kodi::addon::CInstanceGame::GetImageLabel (unsigned int imageIndex)
 Gets a user-friendly label for a disk image.
 

Detailed Description

Disc operations


Disc operation parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.

Function Documentation

◆ AddImageIndex()

virtual GAME_ERROR kodi::addon::CInstanceGame::AddImageIndex ( )
inlinevirtual

Adds a new disk image slot.

Returns
The error, or GAME_ERROR_NO_ERROR if a new image index was added.

◆ GetEjectState()

virtual bool kodi::addon::CInstanceGame::GetEjectState ( )
inlinevirtual

Returns whether the virtual disk tray is currently ejected.

The initial state should be closed (false) unless changed by the game implementation.

Returns
true if the tray is ejected (open), otherwise false.

◆ GetImageCount()

virtual unsigned int kodi::addon::CInstanceGame::GetImageCount ( )
inlinevirtual

Gets the number of available disk images.

Returns
The total number of selectable disk images.

◆ GetImageIndex()

virtual unsigned int kodi::addon::CInstanceGame::GetImageIndex ( )
inlinevirtual

Gets the index of the currently inserted disk image.

Returns
Current disk image index. A value greater than or equal to GetImageCount() indicates that no image is inserted.

◆ GetImageLabel()

virtual std::string kodi::addon::CInstanceGame::GetImageLabel ( unsigned int imageIndex)
inlinevirtual

Gets a user-friendly label for a disk image.

Parameters
[in]imageIndexThe image index to query.
Returns
The image label, or an empty string if unavailable.

◆ GetImagePath()

virtual std::string kodi::addon::CInstanceGame::GetImagePath ( unsigned int imageIndex)
inlinevirtual

Gets the full path of a disk image.

Parameters
[in]imageIndexThe image index to query.
Returns
The image path, or an empty string if unavailable.

◆ RemoveImageIndex()

virtual GAME_ERROR kodi::addon::CInstanceGame::RemoveImageIndex ( unsigned int imageIndex)
inlinevirtual

Removes the disk image at the given index.

The tray must be ejected for this operation.

Parameters
[in]imageIndexThe image index to remove.
Returns
The error, or GAME_ERROR_NO_ERROR if the image was removed.

◆ ReplaceImageIndex()

virtual GAME_ERROR kodi::addon::CInstanceGame::ReplaceImageIndex ( unsigned int imageIndex,
const std::string & filePath )
inlinevirtual

Replaces the disk image at the given index.

The tray must be ejected for this operation.

Parameters
[in]imageIndexThe image index to replace.
[in]filePathPath to the new disk image.
Returns
The error, or GAME_ERROR_NO_ERROR if the image was replaced.

◆ SetEjectState()

virtual GAME_ERROR kodi::addon::CInstanceGame::SetEjectState ( bool ejected)
inlinevirtual

Opens or closes the virtual disk tray.

The image index should only be changed while the tray is ejected.

Parameters
[in]ejectedtrue to eject/open the tray, false to close it.
Returns
The error, or GAME_ERROR_NO_ERROR if the tray state was changed successfully.

◆ SetImageIndex()

virtual GAME_ERROR kodi::addon::CInstanceGame::SetImageIndex ( unsigned int imageIndex)
inlinevirtual

Inserts the disk image at the given index.

This should only succeed when the tray is ejected.

Parameters
[in]imageIndexThe image index to insert.
Returns
The error, or GAME_ERROR_NO_ERROR if the image was set.

◆ SetInitialImage()

virtual GAME_ERROR kodi::addon::CInstanceGame::SetInitialImage ( unsigned int imageIndex,
const std::string & filePath )
inlinevirtual

Sets which image should be initially inserted on load.

Parameters
[in]imageIndexThe initial image index.
[in]filePathPath used to validate the selected image.
Returns
The error, or GAME_ERROR_NO_ERROR if the initial image was accepted.