Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches

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

◆ GetEjectState()

virtual bool 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.

◆ SetEjectState()

virtual GAME_ERROR 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.

◆ GetImageIndex()

virtual unsigned int 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.

◆ SetImageIndex()

virtual GAME_ERROR 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.

◆ GetImageCount()

virtual unsigned int GetImageCount ( )
inlinevirtual

Gets the number of available disk images.

Returns
The total number of selectable disk images.

◆ AddImageIndex()

virtual GAME_ERROR AddImageIndex ( )
inlinevirtual

Adds a new disk image slot.

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

◆ ReplaceImageIndex()

virtual GAME_ERROR 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.

◆ RemoveImageIndex()

virtual GAME_ERROR 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.

◆ SetInitialImage()

virtual GAME_ERROR 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.

◆ GetImagePath()

virtual std::string 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.

◆ GetImageLabel()

virtual std::string 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.