xbmc
GUIGameControllerList.h
1 /*
2  * Copyright (C) 2022-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 "guilib/GUIControl.h"
14 #include "peripherals/PeripheralTypes.h"
15 
16 #include <memory>
17 #include <stdint.h>
18 #include <string>
19 #include <vector>
20 
21 class CScroller;
22 
23 namespace KODI
24 {
25 namespace GAME
26 {
31 {
32 public:
33  CGUIGameControllerList(int parentID,
34  int controlID,
35  float posX,
36  float posY,
37  float width,
38  float height,
39  ORIENTATION orientation,
40  uint32_t alignment,
41  const CScroller& scroller);
42  explicit CGUIGameControllerList(const CGUIGameControllerList& other);
43 
44  ~CGUIGameControllerList() override = default;
45 
46  // Implementation of CGUIControl via CGUIListContainer
47  CGUIGameControllerList* Clone() const override;
48  void UpdateInfo(const CGUIListItem* item) override;
49 
50  // Game properties
51  void SetGameClient(GameClientPtr gameClient);
52  void ClearGameClient();
53 
54  // GUI properties
55  uint32_t GetAlignment() const { return m_alignment; }
56 
57 private:
58  void UpdatePort(int itemNumber, const std::vector<std::string>& inputPorts);
59  void UpdatePortIndex(const PERIPHERALS::PeripheralPtr& agentPeripheral,
60  const std::vector<std::string>& inputPorts);
61  void UpdatePeripheral(const PERIPHERALS::PeripheralPtr& agentPeripheral);
62 
63  // Game properties
64  GameClientPtr m_gameClient;
65  unsigned int m_portCount{0};
66  int m_portIndex{-1}; // Not connected
67  std::string m_peripheralLocation;
68 
69  // GUI properties
70  const uint32_t m_alignment;
71 };
72 } // namespace GAME
73 } // namespace KODI
Definition: GUIListItem.h:30
Definition: GUIGameControllerList.h:30
Class used to handle scrolling, allow using tweeners.
Definition: VisibleEffect.h:221
Definition: AudioDecoder.h:18
std::shared_ptr< CGameClient > GameClientPtr
Smart pointer to a game client (CGameClient)
Definition: GameTypes.h:29
Definition: GUIListContainer.h:25