| 1 | /* |
| 2 | * Copyright (C) 2021-2023 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 | namespace KODI |
| 15 | { |
| 16 | namespace GAME |
| 17 | { |
| 18 | |
| 19 | /*! |
| 20 | * \ingroup games |
| 21 | * |
| 22 | * \brief A list populated by input ports on a game console |
| 23 | * |
| 24 | * In the Player Viewer dialog (<b>`GameAgents`</b> window), this list has |
| 25 | * control ID 4. |
| 26 | * |
| 27 | * Each port is an item in the list. Ports are represented by the controller |
| 28 | * icon of the connected controller. |
| 29 | * |
| 30 | * Ports are only included in the list if the controller profile provides |
| 31 | * input. For example, Multitaps will be skipped. |
| 32 | * |
| 33 | * When ports are changed, the player list (\ref IAgentList) is updated. |
| 34 | */ |
| 35 | class IActivePortList |
| 36 | { |
| 37 | public: |
| 38 | virtual ~IActivePortList() = default; |
| 39 | |
| 40 | /*! |
| 41 | * \brief Initialize resources |
| 42 | * |
| 43 | * \param gameClient The game client providing the ports |
| 44 | * |
| 45 | * \return True if the resource is initialized and can be used, false if |
| 46 | * the resource failed to initialize and must not be used |
| 47 | */ |
| 48 | virtual bool Initialize(GameClientPtr gameClient) = 0; |
| 49 | |
| 50 | /*! |
| 51 | * \brief Deinitialize resources |
| 52 | */ |
| 53 | virtual void Deinitialize() = 0; |
| 54 | |
| 55 | /*! |
| 56 | * \brief Refresh the contents of the list |
| 57 | */ |
| 58 | virtual void Refresh() = 0; |
| 59 | }; |
| 60 | |
| 61 | } // namespace GAME |
| 62 | } // namespace KODI |