| 1 |
/* |
| 2 |
* Copyright (C) 2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include <string> |
| 12 |
|
| 13 |
namespace KODI |
| 14 |
{ |
| 15 |
namespace RETRO |
| 16 |
{ |
| 17 |
class CGUIGameRenderManager; |
| 18 |
class IPlayback; |
| 19 |
|
| 20 |
class CGUIGameSettingsHandle |
| 21 |
{ |
| 22 |
public: |
| 23 |
CGUIGameSettingsHandle(CGUIGameRenderManager& renderManager); |
| 24 |
virtual ~CGUIGameSettingsHandle(); |
| 25 |
|
| 26 |
/*! |
| 27 |
* \brief Get the ID of the active game client |
| 28 |
* |
| 29 |
* \return The ID of the active game client, or empty string if a game is |
| 30 |
* not playing |
| 31 |
*/ |
| 32 |
std::string GameClientID(); |
| 33 |
|
| 34 |
/*! |
| 35 |
* \brief Get the full path of the game being played |
| 36 |
* |
| 37 |
* \return The game's path, or empty string if a game is not playing |
| 38 |
*/ |
| 39 |
std::string GetPlayingGame(); |
| 40 |
|
| 41 |
/*! |
| 42 |
* \brief Create a savestate of the current game being played |
| 43 |
* |
| 44 |
* \param autosave True if the save was invoked automatically, or false if |
| 45 |
* the save was invoked by a player |
| 46 |
* |
| 47 |
* \return The path to the created savestate file, or empty string on |
| 48 |
* failure or if a game is not playing |
| 49 |
*/ |
| 50 |
std::string CreateSavestate(bool autosave); |
| 51 |
|
| 52 |
/*! |
| 53 |
* \brief Update a savestate for the current game being played |
| 54 |
* |
| 55 |
* \param savestatePath The path to the created savestate file returned by |
| 56 |
* CreateSavestate() |
| 57 |
* |
| 58 |
* \return True if the savestate was updated successfully, false otherwise |
| 59 |
*/ |
| 60 |
bool UpdateSavestate(const std::string& savestatePath); |
| 61 |
|
| 62 |
/*! |
| 63 |
* \brief Load a savestate for the current game being played |
| 64 |
* |
| 65 |
* \param savestatePath The path to the created savestate file returned by |
| 66 |
* CreateSavestate() |
| 67 |
* |
| 68 |
* \return True if the savestate was loaded successfully, false otherwise |
| 69 |
*/ |
| 70 |
bool LoadSavestate(const std::string& savestatePath); |
| 71 |
|
| 72 |
/*! |
| 73 |
* \brief Clear the video frame stored for the given statestate |
| 74 |
* |
| 75 |
* Useful to reclaim memory if a savestate has been deleted. |
| 76 |
* |
| 77 |
* \param savestatePath The path to the savestate file |
| 78 |
*/ |
| 79 |
void FreeSavestateResources(const std::string& savestatePath); |
| 80 |
|
| 81 |
/*! |
| 82 |
* \brief Close the in-game OSD |
| 83 |
*/ |
| 84 |
void CloseOSD(); |
| 85 |
|
| 86 |
private: |
| 87 |
// Construction parameters |
| 88 |
CGUIGameRenderManager& m_renderManager; |
| 89 |
}; |
| 90 |
} // namespace RETRO |
| 91 |
} // namespace KODI |