xbmc
GameClientDevice.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/controllers/ControllerTypes.h"
13 
14 #include <string>
15 
16 struct game_input_device;
17 struct game_input_port;
18 
19 namespace KODI
20 {
21 namespace GAME
22 {
23 class CPhysicalPort;
24 
30 {
31 public:
37  CGameClientDevice(const game_input_device& device);
38 
44  CGameClientDevice(const ControllerPtr& controller);
45 
50 
54  const ControllerPtr& Controller() const { return m_controller; }
55 
59  const GameClientPortVec& Ports() const { return m_ports; }
60 
61 private:
68  void AddPort(const game_input_port& logicalPort, const CPhysicalPort& physicalPort);
69 
70  // Helper function
71  static ControllerPtr GetController(const char* controllerId);
72 
73  ControllerPtr m_controller;
74  GameClientPortVec m_ports;
75 };
76 } // namespace GAME
77 } // namespace KODI
Port that can provide input.
Definition: game.h:842
const GameClientPortVec & Ports() const
The ports on this device.
Definition: GameClientDevice.h:59
Device that can provide input.
Definition: game.h:819
CGameClientDevice(const game_input_device &device)
Construct a device.
Definition: GameClientDevice.cpp:25
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: PhysicalPort.h:21
const ControllerPtr & Controller() const
The controller profile.
Definition: GameClientDevice.h:54
Represents a device connected to a port.
Definition: GameClientDevice.h:29