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 size_t AchievementStateSize ()
 How many bytes the achievement runtime's state needs right now.
 
virtual GAME_ERROR SerializeAchievements (uint8_t *data, size_t size)
 Write the achievement runtime's state.
 
virtual GAME_ERROR DeserializeAchievements (const uint8_t *data, size_t size)
 Restore achievement state written by SerializeAchievements()
 
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 SetRetroAchievementsCredentials (const std::string &username, const std::string &token)
 Set the credentials of the RetroAchievements user.
 
virtual GAME_ERROR RCSetHardcoreEnabled (bool enabled)
 Set whether achievements are earned in hardcore mode.
 
virtual GAME_ERROR RCSetEncoreModeEnabled (bool enabled)
 Set whether already-earned achievements can be earned again.
 
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.
 
void RCOnGameLoaded (const game_rc_game_loaded &data)
 Callback to Kodi Function
Notify Kodi that a game has been identified by the achievement runtime
 
void RCOnAchievementTriggered (const game_rc_achievement_triggered &data)
 Callback to Kodi Function
Notify Kodi that the player has earned an achievement
 
void RCOnGameCompleted (const std::string &title, bool hardcore)
 Callback to Kodi Function
Notify Kodi that every achievement of the game has been earned
 
void RCOnRichPresenceUpdated (const std::string &evaluation)
 Callback to Kodi Function
Publish the current rich presence evaluation to Kodi
 
void RCOnLoginResult (const game_rc_login_result &data)
 Callback to Kodi Function
Notify Kodi of the outcome of a login attempt
 
void RCOnAchievementProgress (const std::vector< game_rc_achievement_progress > &progress)
 Callback to Kodi Function
Publish progress towards the game's measured achievements
 
void RCOnServerError (const std::string &message, const std::string &api)
 Callback to Kodi Function
Report an error returned by the RetroAchievements server
 
void RCOnConnectionChanged (bool connected)
 Callback to Kodi Function
Report a change in connectivity to the RetroAchievements server
 
void RCOnChallengeIndicator (const game_rc_achievement_challenge &data, bool show)
 Callback to Kodi Function
Show or hide the indicator for an achievement the player is attempting
 
void RCOnAchievementProgressUpdate (const game_rc_achievement_progress_indicator &data)
 Callback to Kodi Function
Give Kodi a new value for a measured achievement already on screen
 
void RCOnLeaderboardStarted (const game_rc_leaderboard &data)
 Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has begun
 
void RCOnLeaderboardFailed (const game_rc_leaderboard &data)
 Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has been abandoned
 
void RCOnLeaderboardSubmitted (const game_rc_leaderboard &data)
 Callback to Kodi Function
Notify Kodi that a leaderboard value has been sent to the server
 
void RCOnLeaderboardTrackerUpdate (const game_rc_leaderboard_tracker &data)
 Callback to Kodi Function
Give Kodi a new value for an attempt already on screen
 
void RCOnLeaderboardScoreboard (const game_rc_leaderboard_scoreboard &data)
 Callback to Kodi Function
Tell Kodi where a submitted attempt placed
 
void RCOnReset ()
 Callback to Kodi Function
Ask the frontend to reset the game
 
void RCOnSubsetCompleted (const std::string &title)
 Callback to Kodi Function
Notify Kodi that every achievement of a subset has been earned
 
void RCOnAchievementProgressIndicator (const game_rc_achievement_progress_indicator &data, bool show)
 Callback to Kodi Function
Show, update or hide how far along a measured achievement is
 
void RCOnLeaderboardTracker (const game_rc_leaderboard_tracker &data, bool show)
 Callback to Kodi Function
Show, update or hide the live value of an attempt in progress
 
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: