xbmc
RetroPlayerInput.h
1 /*
2  * Copyright (C) 2017-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 "games/GameTypes.h"
12 #include "games/addons/GameClientCallbacks.h"
13 #include "peripherals/PeripheralTypes.h"
14 
15 namespace PERIPHERALS
16 {
17 class CPeripherals;
18 }
19 
20 namespace KODI
21 {
22 namespace RETRO
23 {
24 class CRPProcessInfo;
25 
27 {
28 public:
30  CRPProcessInfo& processInfo,
31  GAME::GameClientPtr gameClient);
32  ~CRetroPlayerInput() override;
33 
34  // Lifecycle functions
35  void StartAgentManager();
36  void StopAgentManager();
37 
38  // Input functions
39  void SetSpeed(double speed);
40  void EnableInput(bool bEnabled);
41 
42  // implementation of IGameInputCallback
43  bool AcceptsInput() const override { return m_bEnabled; }
44  void PollInput() override;
45 
46 private:
47  // Construction parameters
48  PERIPHERALS::CPeripherals& m_peripheralManager;
49  CRPProcessInfo& m_processInfo;
50 
51  // Input variables
52  PERIPHERALS::EventPollHandlePtr m_inputPollHandle;
53  bool m_bEnabled = false;
54 
55  // Game parameters
56  const GAME::GameClientPtr m_gameClient;
57  bool m_bAgentManagerStarted{false};
58 };
59 } // namespace RETRO
60 } // namespace KODI
Definition: RetroPlayerInput.h:26
Input callbacks.
Definition: GameClientCallbacks.h:20
Definition: RetroPlayerInput.h:15
Controller configuration window.
Definition: AudioDecoder.h:18
bool AcceptsInput() const override
Return true if the input source accepts input.
Definition: RetroPlayerInput.h:43
Player process info.
Definition: RPProcessInfo.h:77
Definition: Peripherals.h:49