| 1 |
/* |
| 2 |
* Copyright (C) 2021 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/controllers/ControllerTypes.h" |
| 12 |
#include "threads/Thread.h" |
| 13 |
|
| 14 |
#include <functional> |
| 15 |
|
| 16 |
namespace KODI |
| 17 |
{ |
| 18 |
namespace GAME |
| 19 |
{ |
| 20 |
|
| 21 |
/*! |
| 22 |
* \ingroup games |
| 23 |
*/ |
| 24 |
class CControllerSelect : public CThread |
| 25 |
{ |
| 26 |
public: |
| 27 |
CControllerSelect(); |
| 28 |
~CControllerSelect() override; |
| 29 |
|
| 30 |
void Initialize(ControllerVector controllers, |
| 31 |
ControllerPtr defaultController, |
| 32 |
bool showDisconnect, |
| 33 |
const std::function<void(ControllerPtr)>& callback); |
| 34 |
void Deinitialize(); |
| 35 |
|
| 36 |
protected: |
| 37 |
// Implementation of CThread |
| 38 |
void Process() override; |
| 39 |
|
| 40 |
private: |
| 41 |
// State parameters |
| 42 |
ControllerVector m_controllers; |
| 43 |
ControllerPtr m_defaultController; |
| 44 |
bool m_showDisconnect = true; |
| 45 |
std::function<void(ControllerPtr)> m_callback; |
| 46 |
}; |
| 47 |
} // namespace GAME |
| 48 |
} // namespace KODI |