Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
kodi::addon::CInstanceGame Class Reference

#include <Game.h>

Inheritance diagram for kodi::addon::CInstanceGame:
kodi::addon::IAddonInstance

Classes

class  CStream
 

Public Member Functions

 CInstanceGame ()
 Game class constructor.
 
 ~CInstanceGame () override=default
 Destructor.
 
std::string GameClientDllPath () const
 Callback to Kodi Function
The path of the game client being loaded.
 
bool ProxyDllPaths (std::vector< std::string > &paths)
 Callback to Kodi Function
Paths to proxy DLLs used to load the game client.
 
bool ResourceDirectories (std::vector< std::string > &dirs)
 Callback to Kodi Function
The "system" directories of the frontend.
 
std::string ProfileDirectory () const
 Callback to Kodi Function
The writable directory of the frontend.
 
bool SupportsVFS () const
 Callback to Kodi Function
The value of the <supports_vfs> property from addon.xml.
 
bool Extensions (std::vector< std::string > &extensions)
 Callback to Kodi Function
The extensions in the <extensions> property from addon.xml.
 
virtual GAME_ERROR LoadGame (const std::string &url)
 Load a game.
 
virtual GAME_ERROR LoadGameSpecial (SPECIAL_GAME_TYPE type, const std::vector< std::string > &urls)
 Load a game that requires multiple files.
 
virtual GAME_ERROR LoadStandalone ()
 Begin playing without a game file.
 
virtual GAME_ERROR UnloadGame ()
 Unload the current game.
 
virtual GAME_ERROR GetGameTiming (game_system_timing &timing_info)
 Get timing information about the loaded game.
 
virtual GAME_REGION GetRegion ()
 Get region of the loaded game.
 
virtual bool RequiresGameLoop ()
 Return true if the client requires the frontend to provide a game loop.
 
virtual GAME_ERROR RunFrame ()
 Run a single frame for add-ons that use a game loop.
 
virtual GAME_ERROR Reset ()
 Reset the current game.
 
void CloseGame (void)
 Callback to Kodi Function
Requests the frontend to stop the current game
 
double GetPlaybackSpeed ()
 Callback to Kodi Function
Get the speed the game is being played back at
 
void SetGameTiming (const game_system_timing &timingInfo)
 Callback to Kodi Function
Update the video and audio timing of the running game
 
bool EnableHardwareRendering (const game_hw_rendering_properties &properties)
 Callback to Kodi Function
Enable hardware rendering functionality
 
virtual GAME_ERROR HwContextReset ()
 Invalidates the current HW context and reinitializes GPU resources.
 
virtual GAME_ERROR HwContextDestroy ()
 Called before the context is destroyed.
 
game_proc_address_t HwGetProcAddress (const char *sym)
 Callback to Kodi Function
Get a symbol from the hardware context
 
virtual GAME_ERROR AudioAvailable ()
 Tell the client the frontend is ready for audio.
 
virtual bool HasFeature (const std::string &controller_id, const std::string &feature_name)
 Check if input is accepted for a feature on the controller.
 
virtual game_input_topologyGetTopology ()
 Get the input topology that specifies which controllers can be connected.
 
virtual void FreeTopology (game_input_topology *topology)
 Free the topology's resources.
 
virtual void SetControllerLayouts (const std::vector< kodi::addon::GameControllerLayout > &controllers)
 Set the layouts for known controllers.
 
virtual bool EnableKeyboard (bool enable, const std::string &controller_id)
 Enable/disable keyboard input using the specified controller.
 
virtual bool EnableMouse (bool enable, const std::string &controller_id)
 Enable/disable mouse input using the specified controller.
 
virtual bool ConnectController (bool connect, const std::string &port_address, const std::string &controller_id)
 Connect/disconnect a controller to a port on the virtual game console.
 
virtual bool InputEvent (const game_input_event &event)
 Notify the add-on of an input event.
 
bool KodiInputEvent (const game_input_event &event)
 Callback to Kodi Function
Notify the port of an input event
 
virtual size_t SerializeSize ()
 Get the number of bytes required to serialize the game.
 
virtual GAME_ERROR Serialize (uint8_t *data, size_t size)
 Serialize the state of the game.
 
virtual GAME_ERROR Deserialize (const uint8_t *data, size_t size)
 Deserialize the game from the given state.
 
virtual GAME_ERROR CheatReset ()
 Reset the cheat system.
 
virtual GAME_ERROR GetMemory (GAME_MEMORY type, uint8_t *&data, size_t &size)
 Get a region of memory.
 
virtual GAME_ERROR SetCheat (unsigned int index, bool enabled, const std::string &code)
 Set a cheat code.
 
virtual GAME_ERROR RCGenerateHashFromFile (std::string &hash, unsigned int consoleID, const std::string &filePath)
 Generates a RetroAchievements hash for a given game that can be used to identify the game by RetroAchievements.
 
virtual GAME_ERROR RCGetGameIDUrl (std::string &url, const std::string &hash)
 Gets a URL to the endpoint that returns the game ID.
 
virtual GAME_ERROR RCGetPatchFileUrl (std::string &url, const std::string &username, const std::string &token, unsigned int gameID)
 Gets a URL to the endpoint that returns the patch file.
 
virtual GAME_ERROR SetRetroAchievementsCredentials (const std::string &username, const std::string &token)
 Set the credentials of the RetroAchievements user.
 
virtual GAME_ERROR RCPostRichPresenceUrl (std::string &url, std::string &postData, const std::string &username, const std::string &token, unsigned int gameID, const std::string &richPresence)
 Gets a URL to the endpoint that updates the rich presence in the user's RetroAchievements profile.
 
virtual GAME_ERROR RCEnableRichPresence (const std::string &script)
 Enables rich presence.
 
virtual GAME_ERROR RCGetRichPresenceEvaluation (std::string &evaluation, unsigned int consoleID)
 Gets the rich presence evaluation for the current frame. Rich presence must be enabled first or this will fail.
 
virtual GAME_ERROR ActivateAchievement (unsigned int cheevoId, const std::string &memAddrExpression)
 Activate an achievement.
 
virtual GAME_ERROR GetCheevoUrlId (const std::function< void(const std::string &achievementUrl, unsigned int cheevoId)> &callback)
 Get triggered achievement URL and ID pairs.
 
virtual GAME_ERROR RCResetRuntime ()
 Resets the runtime. Must be called each time a new rom is starting and when the savestate is changed.
 
virtual bool GetEjectState ()
 Returns whether the virtual disk tray is currently ejected.
 
virtual GAME_ERROR SetEjectState (bool ejected)
 Opens or closes the virtual disk tray.
 
virtual unsigned int GetImageIndex ()
 Gets the index of the currently inserted disk image.
 
virtual GAME_ERROR SetImageIndex (unsigned int imageIndex)
 Inserts the disk image at the given index.
 
virtual unsigned int GetImageCount ()
 Gets the number of available disk images.
 
virtual GAME_ERROR AddImageIndex ()
 Adds a new disk image slot.
 
virtual GAME_ERROR ReplaceImageIndex (unsigned int imageIndex, const std::string &filePath)
 Replaces the disk image at the given index.
 
virtual GAME_ERROR RemoveImageIndex (unsigned int imageIndex)
 Removes the disk image at the given index.
 
virtual GAME_ERROR SetInitialImage (unsigned int imageIndex, const std::string &filePath)
 Sets which image should be initially inserted on load.
 
virtual std::string GetImagePath (unsigned int imageIndex)
 Gets the full path of a disk image.
 
virtual std::string GetImageLabel (unsigned int imageIndex)
 Gets a user-friendly label for a disk image.
 
- Public Member Functions inherited from kodi::addon::IAddonInstance
 IAddonInstance (const kodi::addon::IInstanceInfo &instance)
 
virtual ~IAddonInstance ()=default
 
virtual ADDON_STATUS CreateInstance (const kodi::addon::IInstanceInfo &instance, KODI_ADDON_INSTANCE_HDL &hdl)
 
std::string GetInstanceAPIVersion () const
 
virtual ADDON_STATUS SetInstanceSetting (const std::string &settingName, const kodi::addon::CSettingValue &settingValue)
 
bool IsInstanceSettingUsingDefault (const std::string &settingName)
 
std::string GetInstanceUserPath (const std::string &append="")
 
bool CheckInstanceSettingString (const std::string &settingName, std::string &settingValue)
 
std::string GetInstanceSettingString (const std::string &settingName, const std::string &defaultValue="")
 
void SetInstanceSettingString (const std::string &settingName, const std::string &settingValue)
 
bool CheckInstanceSettingInt (const std::string &settingName, int &settingValue)
 
int GetInstanceSettingInt (const std::string &settingName, int defaultValue=0)
 
void SetInstanceSettingInt (const std::string &settingName, int settingValue)
 
bool CheckInstanceSettingBoolean (const std::string &settingName, bool &settingValue)
 
bool GetInstanceSettingBoolean (const std::string &settingName, bool defaultValue=false)
 
void SetInstanceSettingBoolean (const std::string &settingName, bool settingValue)
 
bool CheckInstanceSettingFloat (const std::string &settingName, float &settingValue)
 
float GetInstanceSettingFloat (const std::string &settingName, float defaultValue=0.0f)
 
void SetInstanceSettingFloat (const std::string &settingName, float settingValue)
 
template<typename enumType >
bool CheckInstanceSettingEnum (const std::string &settingName, enumType &settingValue)
 
template<typename enumType >
enumType GetInstanceSettingEnum (const std::string &settingName, enumType defaultValue=static_cast< enumType >(0))
 
template<typename enumType >
void SetInstanceSettingEnum (const std::string &settingName, enumType settingValue)
 

The documentation for this class was generated from the following file: