xbmc
GameClientController.h
1 /*
2  * Copyright (C) 2018 Team Kodi
3  * http://kodi.tv
4  *
5  * This Program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2, or (at your option)
8  * any later version.
9  *
10  * This Program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this Program; see the file COPYING. If not, see
17  * <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #pragma once
22 
23 #include "addons/kodi-dev-kit/include/kodi/addon-instance/Game.h"
24 #include "games/controllers/ControllerTypes.h"
25 
26 #include <string>
27 #include <vector>
28 
29 namespace KODI
30 {
31 namespace GAME
32 {
33 class CGameClientInput;
34 
40 {
41 public:
47  CGameClientController(CGameClientInput& input, ControllerPtr controller);
48 
52  game_controller_layout TranslateController() const;
53 
54 private:
55  // Construction parameters
56  CGameClientInput& m_input;
57  const ControllerPtr m_controller;
58 
59  // Buffer parameters
60  std::string m_controllerId;
61  std::vector<char*> m_digitalButtons;
62  std::vector<char*> m_analogButtons;
63  std::vector<char*> m_analogSticks;
64  std::vector<char*> m_accelerometers;
65  std::vector<char*> m_keys;
66  std::vector<char*> m_relPointers;
67  std::vector<char*> m_absPointers;
68  std::vector<char*> m_motors;
69 };
70 } // namespace GAME
71 } // namespace KODI
Definition: GameClientInput.h:43
CGameClientController(CGameClientInput &input, ControllerPtr controller)
Construct a controller layout.
Definition: GameClientController.cpp:35
Controller configuration window.
Definition: AudioDecoder.h:18
A container for the layout of a controller connected to a game client input port. ...
Definition: GameClientController.h:39
game_controller_layout TranslateController() const
Get a controller layout for the Game API.
Definition: GameClientController.cpp:89