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" 32 class IDriverReceiver;
38 class IKeyboardDriverHandler;
43 class IMouseDriverHandler;
49 class CAddonButtonMapping;
50 class CGUIDialogPeripheralSettings;
57 STATE_ACTIVATE_SOURCE,
76 const std::string& FileLocation(
void)
const {
return m_strFileLocation; }
77 const std::string& Location(
void)
const {
return m_strLocation; }
78 int VendorId(
void)
const {
return m_iVendorId; }
79 const char* VendorIdAsString(
void)
const {
return m_strVendorId.c_str(); }
80 int ProductId(
void)
const {
return m_iProductId; }
81 const char* ProductIdAsString(
void)
const {
return m_strProductId.c_str(); }
82 PeripheralType Type(
void)
const {
return m_type; }
83 PeripheralBusType GetBusType(
void)
const {
return m_busType; }
84 const std::string& DeviceName(
void)
const {
return m_strDeviceName; }
85 bool IsHidden(
void)
const {
return m_bHidden; }
86 void SetHidden(
bool bSetTo =
true) { m_bHidden = bSetTo; }
87 const std::string& GetVersionInfo(
void)
const {
return m_strVersionInfo; }
93 virtual std::string GetIcon()
const;
100 bool HasFeature(
const PeripheralFeature feature)
const;
106 void GetFeatures(std::vector<PeripheralFeature>& features)
const;
112 bool Initialise(
void);
131 virtual bool TestFeature(PeripheralFeature feature) {
return false; }
148 virtual void GetSubdevices(PeripheralVector& subDevices)
const;
153 virtual bool IsMultiFunctional(
void)
const;
161 virtual void AddSetting(
const std::string& strKey,
162 const std::shared_ptr<const CSetting>& setting,
170 virtual bool HasSetting(
const std::string& strKey)
const;
175 virtual bool HasSettings(
void)
const;
180 virtual bool HasConfigurableSettings(
void)
const;
187 virtual const std::string GetSettingString(
const std::string& strKey)
const;
188 virtual bool SetSetting(
const std::string& strKey,
const std::string& strValue);
189 virtual void SetSettingVisible(
const std::string& strKey,
bool bSetTo);
190 virtual bool IsSettingVisible(
const std::string& strKey)
const;
192 virtual int GetSettingInt(
const std::string& strKey)
const;
193 virtual bool SetSetting(
const std::string& strKey,
int iValue);
195 virtual bool GetSettingBool(
const std::string& strKey)
const;
196 virtual bool SetSetting(
const std::string& strKey,
bool bValue);
198 virtual float GetSettingFloat(
const std::string& strKey)
const;
199 virtual bool SetSetting(
const std::string& strKey,
float fValue);
201 virtual void PersistSettings(
bool bExiting =
false);
202 virtual void LoadPersistedSettings(
void);
203 virtual void ResetDefaultSettings(
void);
205 virtual std::vector<std::shared_ptr<CSetting>> GetSettings(
void)
const;
207 virtual bool ErrorOccured(
void)
const {
return m_bError; }
233 bool bPromiscuous)
override;
245 virtual IKeymap* GetKeymap(
const std::string& controllerId) {
return nullptr; }
268 m_controllerProfile = controller;
272 virtual void ClearSettings(
void);
275 PeripheralType m_type;
276 PeripheralBusType m_busType;
277 PeripheralBusType m_mappedBusType;
278 std::string m_strLocation;
279 std::string m_strDeviceName;
280 std::string m_strSettingsFile;
281 std::string m_strFileLocation;
283 std::string m_strVendorId;
285 std::string m_strProductId;
286 std::string m_strVersionInfo;
287 bool m_bInitialised =
false;
288 bool m_bHidden =
false;
289 bool m_bError =
false;
290 std::vector<PeripheralFeature> m_features;
291 PeripheralVector m_subDevices;
292 std::map<std::string, PeripheralDeviceSetting> m_settings;
293 std::set<std::string> m_changedSettings;
295 std::map<KODI::JOYSTICK::IInputHandler*, std::unique_ptr<KODI::JOYSTICK::IDriverHandler>>
298 std::unique_ptr<KODI::KEYBOARD::IKeyboardDriverHandler>>
300 std::map<KODI::MOUSE::IMouseInputHandler*, std::unique_ptr<KODI::MOUSE::IMouseDriverHandler>>
302 std::map<KODI::JOYSTICK::IButtonMapper*, std::unique_ptr<CAddonButtonMapping>> m_buttonMappers;
Definition: PeripheralTypes.h:318
Definition: RetroPlayerInput.h:15
virtual void OnUserNotification()
Briefly activate a feature to notify the user.
Definition: Peripheral.h:124
Definition: GUIDialogPeripheralSettings.h:19
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes)
Definition: IDriverHandler.h:21
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:22
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:259
virtual void SetControllerProfile(const KODI::GAME::ControllerPtr &controller)
Set the controller profile for this peripheral.
Definition: Peripheral.h:266
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:119
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
Definition: PeripheralBus.h:34
Interface for handling mouse driver events.
Definition: IMouseDriverHandler.h:21
virtual bool TestFeature(PeripheralFeature feature)
Briefly test one of the features of this peripheral.
Definition: Peripheral.h:131
virtual void OnSettingChanged(const std::string &strChangedSetting)
Called when a setting changed.
Definition: Peripheral.h:137
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:21
Definition: Peripheral.h:61
Interface for sending input events to joystick drivers.
Definition: IDriverReceiver.h:19
Definition: Peripherals.h:53
virtual void OnDeviceRemoved(void)
Called when this device is removed, before calling the destructor.
Definition: Peripheral.h:142