Debian Codegraph @

src/input/LibretroDevice.h

raw
1 /*
2 * Copyright (C) 2015-2021 Team Kodi (https://kodi.tv)
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 * See LICENSE.md for more information.
6 */
7
8 #pragma once
9
10 #include "InputTypes.h"
11
12 #include <kodi/addon-instance/Game.h>
13
14 #include <map>
15 #include <memory>
16 #include <string>
17 #include <vector>
18
19 class TiXmlElement;
20
21 namespace LIBRETRO
22 {
23 class CLibretroDeviceInput;
24
25 class CLibretroDevice
26 {
27 public:
28 CLibretroDevice();
29 CLibretroDevice(const std::string &controller);
30 ~CLibretroDevice();
31
32 const std::string& ControllerID(void) const { return m_controllerId; }
33 libretro_device_t Type(void) const { return m_type; }
34 libretro_subclass_t Subclass() const { return m_subclass; }
35 const FeatureMap& Features(void) const { return m_featureMap; }
36 CLibretroDeviceInput& Input() { return *m_input; }
37
38 void SetType(libretro_device_t type) { m_type = type; }
39 void SetSubclass(libretro_subclass_t subclass) { m_subclass = subclass; }
40
41 bool Deserialize(const TiXmlElement* pElement, unsigned int buttonMapVersion);
42
43 private:
44 std::string m_controllerId;
45 libretro_device_t m_type;
46 libretro_subclass_t m_subclass = RETRO_SUBCLASS_NONE;
47 FeatureMap m_featureMap;
48 std::unique_ptr<CLibretroDeviceInput> m_input;
49 };
50 }