Disc operations
More...
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.
◆ 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] | imageIndex | The 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] | imageIndex | The 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] | imageIndex | The 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] | imageIndex | The image index to replace. |
| [in] | filePath | Path 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] | ejected | true 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] | imageIndex | The 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] | imageIndex | The initial image index. |
| [in] | filePath | Path used to validate the selected image. |
- Returns
- The error, or GAME_ERROR_NO_ERROR if the initial image was accepted.