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" 33 class IDriverReceiver;
39 class IKeyboardDriverHandler;
44 class IMouseDriverHandler;
50 class CAddonButtonMapping;
51 class CGUIDialogPeripheralSettings;
58 STATE_ACTIVATE_SOURCE,
77 const std::string& FileLocation(
void)
const {
return m_strFileLocation; }
78 const std::string& Location(
void)
const {
return m_strLocation; }
79 int VendorId(
void)
const {
return m_iVendorId; }
80 const char* VendorIdAsString(
void)
const {
return m_strVendorId.c_str(); }
81 int ProductId(
void)
const {
return m_iProductId; }
82 const char* ProductIdAsString(
void)
const {
return m_strProductId.c_str(); }
83 PeripheralType Type(
void)
const {
return m_type; }
84 PeripheralBusType GetBusType(
void)
const {
return m_busType; }
85 const std::string& DeviceName(
void)
const {
return m_strDeviceName; }
86 bool IsHidden(
void)
const {
return m_bHidden; }
87 void SetHidden(
bool bSetTo =
true) { m_bHidden = bSetTo; }
88 const std::string& GetVersionInfo(
void)
const {
return m_strVersionInfo; }
94 virtual std::string GetIcon()
const;
101 bool HasFeature(
const PeripheralFeature feature)
const;
107 void GetFeatures(std::vector<PeripheralFeature>& features)
const;
113 bool Initialise(
void);
132 virtual bool TestFeature(PeripheralFeature feature) {
return false; }
149 virtual void GetSubdevices(PeripheralVector& subDevices)
const;
154 virtual bool IsMultiFunctional(
void)
const;
162 virtual void AddSetting(
const std::string& strKey,
163 const std::shared_ptr<const CSetting>& setting,
171 virtual bool HasSetting(
const std::string& strKey)
const;
176 virtual bool HasSettings(
void)
const;
181 virtual bool HasConfigurableSettings(
void)
const;
188 virtual const std::string GetSettingString(
const std::string& strKey)
const;
189 virtual bool SetSetting(
const std::string& strKey,
const std::string& strValue);
190 virtual void SetSettingVisible(
const std::string& strKey,
bool bSetTo);
191 virtual bool IsSettingVisible(
const std::string& strKey)
const;
193 virtual int GetSettingInt(
const std::string& strKey)
const;
194 virtual bool SetSetting(
const std::string& strKey,
int iValue);
196 virtual bool GetSettingBool(
const std::string& strKey)
const;
197 virtual bool SetSetting(
const std::string& strKey,
bool bValue);
199 virtual float GetSettingFloat(
const std::string& strKey)
const;
200 virtual bool SetSetting(
const std::string& strKey,
float fValue);
202 virtual void PersistSettings(
bool bExiting =
false);
203 virtual void LoadPersistedSettings(
void);
204 virtual void ResetDefaultSettings(
void);
206 virtual std::vector<std::shared_ptr<CSetting>> GetSettings(
void)
const;
208 virtual bool ErrorOccured(
void)
const {
return m_bError; }
234 bool bPromiscuous)
override;
246 virtual IKeymap* GetKeymap(
const std::string& controllerId) {
return nullptr; }
262 return KODI::GAME::ControllerPtr{};
266 virtual void ClearSettings(
void);
269 PeripheralType m_type;
270 PeripheralBusType m_busType;
271 PeripheralBusType m_mappedBusType;
272 std::string m_strLocation;
273 std::string m_strDeviceName;
274 std::string m_strSettingsFile;
275 std::string m_strFileLocation;
277 std::string m_strVendorId;
279 std::string m_strProductId;
280 std::string m_strVersionInfo;
284 std::vector<PeripheralFeature> m_features;
285 PeripheralVector m_subDevices;
286 std::map<std::string, PeripheralDeviceSetting> m_settings;
287 std::set<std::string> m_changedSettings;
289 std::map<KODI::JOYSTICK::IInputHandler*, std::unique_ptr<KODI::JOYSTICK::IDriverHandler>>
292 std::unique_ptr<KODI::KEYBOARD::IKeyboardDriverHandler>>
294 std::map<KODI::MOUSE::IMouseInputHandler*, std::unique_ptr<KODI::MOUSE::IMouseDriverHandler>>
296 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:125
Definition: GUIDialogPeripheralSettings.h:17
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:260
Controller configuration window.
Definition: AudioDecoder.h:18
virtual bool InitialiseFeature(const PeripheralFeature feature)
Initialise one of the features of this peripheral.
Definition: Peripheral.h:120
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:132
virtual void OnSettingChanged(const std::string &strChangedSetting)
Called when a setting changed.
Definition: Peripheral.h:138
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:21
Definition: Peripheral.h:62
Interface for sending input events to joystick drivers.
Definition: IDriverReceiver.h:19
Definition: Peripherals.h:49
virtual void OnDeviceRemoved(void)
Called when this device is removed, before calling the destructor.
Definition: Peripheral.h:143