11 #include "games/controllers/ControllerTypes.h" 12 #include "input/joysticks/interfaces/IInputProvider.h" 13 #include "input/keyboard/interfaces/IKeyboardInputProvider.h" 14 #include "input/mouse/interfaces/IMouseInputProvider.h" 15 #include "peripherals/PeripheralTypes.h" 31 class IDriverReceiver;
37 class IKeyboardDriverHandler;
47 class IMouseDriverHandler;
53 class CAddonButtonMapping;
54 class CGUIDialogPeripheralSettings;
64 STATE_ACTIVATE_SOURCE,
86 const std::string& FileLocation(
void)
const {
return m_strFileLocation; }
87 const std::string& Location(
void)
const {
return m_strLocation; }
88 int VendorId(
void)
const {
return m_iVendorId; }
89 const char* VendorIdAsString(
void)
const {
return m_strVendorId.c_str(); }
90 int ProductId(
void)
const {
return m_iProductId; }
91 const char* ProductIdAsString(
void)
const {
return m_strProductId.c_str(); }
92 PeripheralType Type(
void)
const {
return m_type; }
93 PeripheralBusType GetBusType(
void)
const {
return m_busType; }
94 const std::string& DeviceName(
void)
const {
return m_strDeviceName; }
95 bool IsHidden(
void)
const {
return m_bHidden; }
96 void SetHidden(
bool bSetTo =
true) { m_bHidden = bSetTo; }
97 const std::string& GetVersionInfo(
void)
const {
return m_strVersionInfo; }
103 virtual std::string GetIcon()
const;
110 bool HasFeature(
const PeripheralFeature feature)
const;
116 void GetFeatures(std::vector<PeripheralFeature>& features)
const;
122 bool Initialise(
void);
141 virtual bool TestFeature(PeripheralFeature feature) {
return false; }
158 virtual void GetSubdevices(PeripheralVector& subDevices)
const;
163 virtual bool IsMultiFunctional(
void)
const;
171 virtual void AddSetting(
const std::string& strKey,
172 const std::shared_ptr<const CSetting>& setting,
180 virtual bool HasSetting(
const std::string& strKey)
const;
185 virtual bool HasSettings(
void)
const;
190 virtual bool HasConfigurableSettings(
void)
const;
197 virtual const std::string GetSettingString(
const std::string& strKey)
const;
198 virtual bool SetSetting(
const std::string& strKey,
const std::string& strValue);
199 virtual void SetSettingVisible(
const std::string& strKey,
bool bSetTo);
200 virtual bool IsSettingVisible(
const std::string& strKey)
const;
202 virtual int GetSettingInt(
const std::string& strKey)
const;
203 virtual bool SetSetting(
const std::string& strKey,
int iValue);
205 virtual bool GetSettingBool(
const std::string& strKey)
const;
206 virtual bool SetSetting(
const std::string& strKey,
bool bValue);
208 virtual float GetSettingFloat(
const std::string& strKey)
const;
209 virtual bool SetSetting(
const std::string& strKey,
float fValue);
211 virtual void PersistSettings(
bool bExiting =
false);
212 virtual void LoadPersistedSettings(
void);
213 virtual void ResetDefaultSettings(
void);
215 virtual std::vector<std::shared_ptr<CSetting>> GetSettings(
void)
const;
217 virtual bool ErrorOccured(
void)
const {
return m_bError; }
244 bool forceDefaultMap)
override;
250 bool forceDefaultMap)
override;
281 m_controllerProfile = controller;
285 virtual void ClearSettings(
void);
288 PeripheralType m_type;
289 PeripheralBusType m_busType;
290 PeripheralBusType m_mappedBusType;
291 std::string m_strLocation;
292 std::string m_strDeviceName;
293 std::string m_strSettingsFile;
294 std::string m_strFileLocation;
296 std::string m_strVendorId;
298 std::string m_strProductId;
299 std::string m_strVersionInfo;
300 bool m_bInitialised =
false;
301 bool m_bHidden =
false;
302 bool m_bError =
false;
303 std::vector<PeripheralFeature> m_features;
304 PeripheralVector m_subDevices;
305 std::map<std::string, PeripheralDeviceSetting> m_settings;
306 std::set<std::string> m_changedSettings;
308 std::map<KODI::JOYSTICK::IInputHandler*, std::unique_ptr<KODI::JOYSTICK::IDriverHandler>>
311 std::unique_ptr<KODI::KEYBOARD::IKeyboardDriverHandler>>
313 std::map<KODI::MOUSE::IMouseInputHandler*, std::unique_ptr<KODI::MOUSE::IMouseDriverHandler>>
315 std::map<KODI::JOYSTICK::IButtonMapper*, std::unique_ptr<CAddonButtonMapping>> m_buttonMappers;
Definition: PeripheralTypes.h:326
Definition: RetroPlayerInput.h:15
virtual void OnUserNotification()
Briefly activate a feature to notify the user.
Definition: Peripheral.h:134
Definition: GUIDialogPeripheralSettings.h:22
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes)
Definition: IDriverHandler.h:23
Setting base class containing all the properties which are common to all settings independent of the ...
Definition: Setting.h:46
virtual KODI::GAME::ControllerPtr ControllerProfile() const
Get the controller profile that best represents this peripheral.
Definition: Peripheral.h:272
virtual void SetControllerProfile(const KODI::GAME::ControllerPtr &controller)
Set the controller profile for this peripheral.
Definition: Peripheral.h:279
Definition: AudioDecoder.h:18
std::shared_ptr< CController > ControllerPtr
Smart pointer to a game controller (CController)
Definition: ControllerTypes.h:25
virtual bool InitialiseFeature(const PeripheralFeature feature)
Initialise one of the features of this peripheral.
Definition: Peripheral.h:129
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
Definition: PeripheralBus.h:36
Interface for handling mouse driver events.
Definition: IMouseDriverHandler.h:22
virtual bool TestFeature(PeripheralFeature feature)
Briefly test one of the features of this peripheral.
Definition: Peripheral.h:141
virtual void OnSettingChanged(const std::string &strChangedSetting)
Called when a setting changed.
Definition: Peripheral.h:147
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:22
Definition: Peripheral.h:71
Interface for sending input events to joystick drivers.
Definition: IDriverReceiver.h:20
Definition: Peripherals.h:56
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:28
virtual void OnDeviceRemoved(void)
Called when this device is removed, before calling the destructor.
Definition: Peripheral.h:152