Merge pull request #26373 from ksooo/app-fix-multi-resolve-playback
[xbmc.git] / xbmc / games / ports / input / PhysicalPort.h
blobd7b32463fbb12af1d636153bb0a08589088b70aa
1 /*
2 * Copyright (C) 2017-2021 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <string>
12 #include <vector>
14 namespace tinyxml2
16 class XMLElement;
19 namespace KODI
21 namespace GAME
24 /*!
25 * \ingroup games
27 class CPhysicalPort
29 public:
30 CPhysicalPort() = default;
32 /*!
33 * \brief Create a controller port
35 * \param portId The port's ID
36 * \param accepts A list of controller IDs that this port accepts
38 CPhysicalPort(std::string portId, std::vector<std::string> accepts);
40 void Reset();
42 /*!
43 * \brief Get the ID of the port
45 * \return The port's ID, e.g. "1", as a string
47 const std::string& ID() const { return m_portId; }
49 /*!
50 * \brief Get the controllers that can connect to this port
52 * \return A list of controllers that are physically compatible with this port
54 const std::vector<std::string>& Accepts() const { return m_accepts; }
56 /*!
57 * \brief Check if the controller is compatible with this port
59 * \return True if the controller is accepted, false otherwise
61 bool IsCompatible(const std::string& controllerId) const;
63 bool Deserialize(const tinyxml2::XMLElement* pElement);
65 private:
66 std::string m_portId;
67 std::vector<std::string> m_accepts;
69 } // namespace GAME
70 } // namespace KODI