xbmc
PeripheralImon.h
1 /*
2  * Copyright (C) 2012-2018 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 {
20 {
21 public:
23  const PeripheralScanResult& scanResult,
24  CPeripheralBus* bus);
25  ~CPeripheralImon(void) override = default;
26  bool InitialiseFeature(const PeripheralFeature feature) override;
27  void OnSettingChanged(const std::string& strChangedSetting) override;
28  void OnDeviceRemoved() override;
29  void AddSetting(const std::string& strKey,
30  const std::shared_ptr<const CSetting>& setting,
31  int order) override;
32  inline bool IsImonConflictsWithDInput() { return m_bImonConflictsWithDInput; }
33  static inline long GetCountOfImonsConflictWithDInput()
34  {
35  return m_lCountOfImonsConflictWithDInput;
36  }
37  static void ActionOnImonConflict(bool deviceInserted = true);
38 
39 private:
40  bool m_bImonConflictsWithDInput;
41  static std::atomic<long> m_lCountOfImonsConflictWithDInput;
42 };
43 } // namespace PERIPHERALS
Definition: PeripheralTypes.h:318
Definition: PeripheralImon.h:19
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:16
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:34
void OnSettingChanged(const std::string &strChangedSetting) override
Called when a setting changed.
Definition: PeripheralImon.cpp:69
Definition: Peripherals.h:49