xbmc
GameClientPort.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 
31 {
32 public:
38  CGameClientPort(const game_input_port& port);
39 
47  CGameClientPort(const ControllerVector& controllers);
48 
64  CGameClientPort(const game_input_port& logicalPort, const CPhysicalPort& physicalPort);
65 
70 
77  PORT_TYPE PortType() const { return m_type; }
78 
84  const std::string& ID() const { return m_portId; }
85 
90  bool ForceConnected() const { return m_forceConnected; }
91 
95  const GameClientDeviceVec& Devices() const { return m_acceptedDevices; }
96 
97 private:
98  PORT_TYPE m_type;
99  std::string m_portId;
100  bool m_forceConnected{false};
101  GameClientDeviceVec m_acceptedDevices;
102 };
103 } // namespace GAME
104 } // namespace KODI
std::vector< GameClientDevicePtr > GameClientDeviceVec
Vector of smart pointers to input devices for a game client (CGameClientDevice)
Definition: GameTypes.h:64
const GameClientDeviceVec & Devices() const
Get the list of devices accepted by this port.
Definition: GameClientPort.h:95
Port that can provide input.
Definition: game.h:842
const std::string & ID() const
Get the ID of the port.
Definition: GameClientPort.h:84
~CGameClientPort()
Destructor.
CGameClientPort(const game_input_port &port)
Construct a hardware port.
Definition: GameClientPort.cpp:23
bool ForceConnected() const
True if a controller must be connected, preventing the disconnected option from being shown to the us...
Definition: GameClientPort.h:90
Device that can provide input.
Definition: game.h:819
Definition: AudioDecoder.h:18
PORT_TYPE PortType() const
Get the port type.
Definition: GameClientPort.h:77
Definition: PhysicalPort.h:27
Represents a port that devices can connect to.
Definition: GameClientPort.h:30
PORT_TYPE
Type of input provided by a hardware or controller port.
Definition: ControllerTypes.h:39
std::vector< ControllerPtr > ControllerVector
Vector of smart pointers to a game controller (CController)
Definition: ControllerTypes.h:32