kodi
PeripheralImon.h
1 /*
2  * Copyright (C) 2012-2024 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 "PeripheralHID.h"
12 
13 #include <atomic>
14 
15 class CSetting;
16 
17 namespace PERIPHERALS
18 {
23 {
24 public:
26  const PeripheralScanResult& scanResult,
27  CPeripheralBus* bus);
28  ~CPeripheralImon(void) override = default;
29  bool InitialiseFeature(const PeripheralFeature feature) override;
30  void OnSettingChanged(const std::string& strChangedSetting) override;
31  void OnDeviceRemoved() override;
32  void AddSetting(const std::string& strKey,
33  const std::shared_ptr<const CSetting>& setting,
34  int order) override;
35  inline bool IsImonConflictsWithDInput() { return m_bImonConflictsWithDInput; }
36  static inline long GetCountOfImonsConflictWithDInput()
37  {
38  return m_lCountOfImonsConflictWithDInput;
39  }
40  static void ActionOnImonConflict(bool deviceInserted = true);
41 
42 private:
43  bool m_bImonConflictsWithDInput;
44  static std::atomic<long> m_lCountOfImonsConflictWithDInput;
45 };
46 } // namespace PERIPHERALS
Definition: PeripheralTypes.h:326
Definition: PeripheralImon.h:22
Definition: RetroPlayerInput.h:15
bool InitialiseFeature(const PeripheralFeature feature) override
Initialise one of the features of this peripheral.
Definition: PeripheralImon.cpp:37
Setting base class containing all the properties which are common to all settings independent of the ...
Definition: Setting.h:46
Definition: PeripheralHID.h:19
void OnDeviceRemoved() override
Called when this device is removed, before calling the destructor.
Definition: PeripheralImon.cpp:28
void AddSetting(const std::string &strKey, const std::shared_ptr< const CSetting > &setting, int order) override
Add a setting to this peripheral. This will overwrite a previous setting with the same key...
Definition: PeripheralImon.cpp:59
Definition: PeripheralBus.h:36
void OnSettingChanged(const std::string &strChangedSetting) override
Called when a setting changed.
Definition: PeripheralImon.cpp:69
Definition: Peripherals.h:56