diff options
| author | manuel <manuel@mausz.at> | 2016-11-24 21:27:41 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2016-11-24 21:27:41 +0100 |
| commit | 8cdf8dec703d882b46ca50a769fabb95ffc48e2c (patch) | |
| tree | f7fe8233508f79d3dc94f8f445ce6342e7dfbdbb /xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h | |
| parent | 5823b05feb29a59510c32a9c28ca18b50b9b6399 (diff) | |
| download | kodi-pvr-build-8cdf8dec703d882b46ca50a769fabb95ffc48e2c.tar.gz kodi-pvr-build-8cdf8dec703d882b46ca50a769fabb95ffc48e2c.tar.bz2 kodi-pvr-build-8cdf8dec703d882b46ca50a769fabb95ffc48e2c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h | 72 |
1 files changed, 69 insertions, 3 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h index 591afcc..f9d7482 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #include "kodi_peripheral_types.h" | 23 | #include "kodi_peripheral_types.h" |
| 24 | 24 | ||
| 25 | #define PERIPHERAL_ADDON_JOYSTICKS // TODO | 25 | #define PERIPHERAL_ADDON_JOYSTICKS //! @todo |
| 26 | 26 | ||
| 27 | #ifdef __cplusplus | 27 | #ifdef __cplusplus |
| 28 | extern "C" | 28 | extern "C" |
| @@ -100,6 +100,14 @@ extern "C" | |||
| 100 | * @param events The array of allocated events | 100 | * @param events The array of allocated events |
| 101 | */ | 101 | */ |
| 102 | void FreeEvents(unsigned int event_count, PERIPHERAL_EVENT* events); | 102 | void FreeEvents(unsigned int event_count, PERIPHERAL_EVENT* events); |
| 103 | |||
| 104 | /*! | ||
| 105 | * @brief Send an input event to the specified peripheral | ||
| 106 | * @param peripheralIndex The index of the device receiving the input event | ||
| 107 | * @param event The input event | ||
| 108 | * @return true if the event was handled, false otherwise | ||
| 109 | */ | ||
| 110 | bool SendEvent(const PERIPHERAL_EVENT* event); | ||
| 103 | ///} | 111 | ///} |
| 104 | 112 | ||
| 105 | /// @name Joystick operations | 113 | /// @name Joystick operations |
| @@ -150,12 +158,57 @@ extern "C" | |||
| 150 | * @brief Add or update joystick features | 158 | * @brief Add or update joystick features |
| 151 | * @param joystick The device's joystick properties; unknown values may be left at their default | 159 | * @param joystick The device's joystick properties; unknown values may be left at their default |
| 152 | * @param controller_id The game controller profile being updated | 160 | * @param controller_id The game controller profile being updated |
| 153 | * @param feature_count The number of features int the features array | 161 | * @param feature_count The number of features in the features array |
| 154 | * @param features The array of features | 162 | * @param features The array of features |
| 155 | * @return PERIPHERAL_NO_ERROR if successful | 163 | * @return PERIPHERAL_NO_ERROR if successful |
| 156 | */ | 164 | */ |
| 157 | PERIPHERAL_ERROR MapFeatures(const JOYSTICK_INFO* joystick, const char* controller_id, | 165 | PERIPHERAL_ERROR MapFeatures(const JOYSTICK_INFO* joystick, const char* controller_id, |
| 158 | unsigned int feature_count, JOYSTICK_FEATURE* features); | 166 | unsigned int feature_count, const JOYSTICK_FEATURE* features); |
| 167 | |||
| 168 | /*! | ||
| 169 | * @brief Get the driver primitives that should be ignored while mapping the device | ||
| 170 | * @param joystick The device's joystick properties; unknown values may be left at their default | ||
| 171 | * @param primitive_count The number of features allocated for the primitives array | ||
| 172 | * @param primitives The array of allocated driver primitives to be ignored | ||
| 173 | * @return PERIPHERAL_NO_ERROR if successful; array must be freed using | ||
| 174 | * FreePrimitives() in this case | ||
| 175 | */ | ||
| 176 | PERIPHERAL_ERROR GetIgnoredPrimitives(const JOYSTICK_INFO* joystick, | ||
| 177 | unsigned int* primitive_count, | ||
| 178 | JOYSTICK_DRIVER_PRIMITIVE** primitives); | ||
| 179 | |||
| 180 | /*! | ||
| 181 | * @brief Free the memory allocated in GetIgnoredPrimitives() | ||
| 182 | * | ||
| 183 | * Must be called if GetIgnoredPrimitives() returns PERIPHERAL_NO_ERROR. | ||
| 184 | * | ||
| 185 | * @param primitive_count The number of driver primitives allocated for the primitives array | ||
| 186 | * @param primitives The array of allocated driver primitives | ||
| 187 | */ | ||
| 188 | void FreePrimitives(unsigned int primitive_count, JOYSTICK_DRIVER_PRIMITIVE* primitives); | ||
| 189 | |||
| 190 | /*! | ||
| 191 | * @brief Set the list of driver primitives that are ignored for the device | ||
| 192 | * @param joystick The device's joystick properties; unknown values may be left at their default | ||
| 193 | * @param primitive_count The number of driver features in the primitives array | ||
| 194 | * @param primitives The array of driver primitives to ignore | ||
| 195 | * @return PERIPHERAL_NO_ERROR if successful | ||
| 196 | */ | ||
| 197 | PERIPHERAL_ERROR SetIgnoredPrimitives(const JOYSTICK_INFO* joystick, | ||
| 198 | unsigned int primitive_count, | ||
| 199 | const JOYSTICK_DRIVER_PRIMITIVE* primitives); | ||
| 200 | |||
| 201 | /*! | ||
| 202 | * @brief Save the button map for the given joystick | ||
| 203 | * @param joystick The device's joystick properties | ||
| 204 | */ | ||
| 205 | void SaveButtonMap(const JOYSTICK_INFO* joystick); | ||
| 206 | |||
| 207 | /*! | ||
| 208 | * @brief Revert the button map to the last time it was loaded or committed to disk | ||
| 209 | * @param joystick The device's joystick properties | ||
| 210 | */ | ||
| 211 | void RevertButtonMap(const JOYSTICK_INFO* joystick); | ||
| 159 | 212 | ||
| 160 | /*! | 213 | /*! |
| 161 | * @brief Reset the button map for the given joystick and controller profile ID | 214 | * @brief Reset the button map for the given joystick and controller profile ID |
| @@ -163,6 +216,12 @@ extern "C" | |||
| 163 | * @param controller_id The game controller profile being reset | 216 | * @param controller_id The game controller profile being reset |
| 164 | */ | 217 | */ |
| 165 | void ResetButtonMap(const JOYSTICK_INFO* joystick, const char* controller_id); | 218 | void ResetButtonMap(const JOYSTICK_INFO* joystick, const char* controller_id); |
| 219 | |||
| 220 | /*! | ||
| 221 | * @brief Powers off the given joystick if supported | ||
| 222 | * @param index The joystick's driver index | ||
| 223 | */ | ||
| 224 | void PowerOffJoystick(unsigned int index); | ||
| 166 | #endif | 225 | #endif |
| 167 | ///} | 226 | ///} |
| 168 | 227 | ||
| @@ -180,6 +239,7 @@ extern "C" | |||
| 180 | pClient->FreeScanResults = FreeScanResults; | 239 | pClient->FreeScanResults = FreeScanResults; |
| 181 | pClient->GetEvents = GetEvents; | 240 | pClient->GetEvents = GetEvents; |
| 182 | pClient->FreeEvents = FreeEvents; | 241 | pClient->FreeEvents = FreeEvents; |
| 242 | pClient->SendEvent = SendEvent; | ||
| 183 | 243 | ||
| 184 | #ifdef PERIPHERAL_ADDON_JOYSTICKS | 244 | #ifdef PERIPHERAL_ADDON_JOYSTICKS |
| 185 | pClient->GetJoystickInfo = GetJoystickInfo; | 245 | pClient->GetJoystickInfo = GetJoystickInfo; |
| @@ -187,7 +247,13 @@ extern "C" | |||
| 187 | pClient->GetFeatures = GetFeatures; | 247 | pClient->GetFeatures = GetFeatures; |
| 188 | pClient->FreeFeatures = FreeFeatures; | 248 | pClient->FreeFeatures = FreeFeatures; |
| 189 | pClient->MapFeatures = MapFeatures; | 249 | pClient->MapFeatures = MapFeatures; |
| 250 | pClient->GetIgnoredPrimitives = GetIgnoredPrimitives; | ||
| 251 | pClient->FreePrimitives = FreePrimitives; | ||
| 252 | pClient->SetIgnoredPrimitives = SetIgnoredPrimitives; | ||
| 253 | pClient->SaveButtonMap = SaveButtonMap; | ||
| 254 | pClient->RevertButtonMap = RevertButtonMap; | ||
| 190 | pClient->ResetButtonMap = ResetButtonMap; | 255 | pClient->ResetButtonMap = ResetButtonMap; |
| 256 | pClient->PowerOffJoystick = PowerOffJoystick; | ||
| 191 | #endif | 257 | #endif |
| 192 | } | 258 | } |
| 193 | 259 | ||
