diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit')
14 files changed, 252 insertions, 56 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h index 42ce2e7..db39f86 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h | |||
| @@ -43,6 +43,20 @@ | |||
| 43 | #define ATTRIBUTE_HIDDEN | 43 | #define ATTRIBUTE_HIDDEN |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
| 46 | #ifdef _MSC_VER | ||
| 47 | #define ATTRIBUTE_FORCEINLINE __forceinline | ||
| 48 | #elif defined(__GNUC__) | ||
| 49 | #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) | ||
| 50 | #elif defined(__CLANG__) | ||
| 51 | #if __has_attribute(__always_inline__) | ||
| 52 | #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) | ||
| 53 | #else | ||
| 54 | #define ATTRIBUTE_FORCEINLINE inline | ||
| 55 | #endif | ||
| 56 | #else | ||
| 57 | #define ATTRIBUTE_FORCEINLINE inline | ||
| 58 | #endif | ||
| 59 | |||
| 46 | #include "versions.h" | 60 | #include "versions.h" |
| 47 | 61 | ||
| 48 | namespace kodi { namespace addon { class CAddonBase; }} | 62 | namespace kodi { namespace addon { class CAddonBase; }} |
| @@ -179,6 +193,7 @@ typedef struct KodiToAddonFuncTable_Addon | |||
| 179 | ADDON_STATUS (*create_instance)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent); | 193 | ADDON_STATUS (*create_instance)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent); |
| 180 | void (*destroy_instance)(int instanceType, KODI_HANDLE instance); | 194 | void (*destroy_instance)(int instanceType, KODI_HANDLE instance); |
| 181 | ADDON_STATUS (*set_setting)(const char *settingName, const void *settingValue); | 195 | ADDON_STATUS (*set_setting)(const char *settingName, const void *settingValue); |
| 196 | ADDON_STATUS(*create_instance_ex)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent, const char* version); | ||
| 182 | } KodiToAddonFuncTable_Addon; | 197 | } KodiToAddonFuncTable_Addon; |
| 183 | 198 | ||
| 184 | /* | 199 | /* |
| @@ -237,6 +252,11 @@ public: | |||
| 237 | return ADDON_STATUS_NOT_IMPLEMENTED; | 252 | return ADDON_STATUS_NOT_IMPLEMENTED; |
| 238 | } | 253 | } |
| 239 | 254 | ||
| 255 | virtual ADDON_STATUS CreateInstanceEx(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance, const std::string &version) | ||
| 256 | { | ||
| 257 | return CreateInstance(instanceType, instanceID, instance, addonInstance); | ||
| 258 | } | ||
| 259 | |||
| 240 | const ADDON_TYPE m_type; | 260 | const ADDON_TYPE m_type; |
| 241 | }; | 261 | }; |
| 242 | } /* namespace addon */ | 262 | } /* namespace addon */ |
| @@ -278,6 +298,9 @@ public: | |||
| 278 | CAddonBase::m_interface->toAddon->create_instance = ADDONBASE_CreateInstance; | 298 | CAddonBase::m_interface->toAddon->create_instance = ADDONBASE_CreateInstance; |
| 279 | CAddonBase::m_interface->toAddon->destroy_instance = ADDONBASE_DestroyInstance; | 299 | CAddonBase::m_interface->toAddon->destroy_instance = ADDONBASE_DestroyInstance; |
| 280 | CAddonBase::m_interface->toAddon->set_setting = ADDONBASE_SetSetting; | 300 | CAddonBase::m_interface->toAddon->set_setting = ADDONBASE_SetSetting; |
| 301 | // If version is present, we know that kodi has create_instance_ex implemented | ||
| 302 | if (!CAddonBase::m_strGlobalApiVersion.empty()) | ||
| 303 | CAddonBase::m_interface->toAddon->create_instance_ex = ADDONBASE_CreateInstanceEx; | ||
| 281 | } | 304 | } |
| 282 | 305 | ||
| 283 | virtual ~CAddonBase() = default; | 306 | virtual ~CAddonBase() = default; |
| @@ -306,8 +329,14 @@ public: | |||
| 306 | return ADDON_STATUS_UNKNOWN; | 329 | return ADDON_STATUS_UNKNOWN; |
| 307 | } | 330 | } |
| 308 | 331 | ||
| 332 | virtual ADDON_STATUS CreateInstanceEx(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance, const std::string &version) | ||
| 333 | { | ||
| 334 | return CreateInstance(instanceType, instanceID, instance, addonInstance); | ||
| 335 | } | ||
| 336 | |||
| 309 | /* Global variables of class */ | 337 | /* Global variables of class */ |
| 310 | static AddonGlobalInterface* m_interface; // Interface function table to hold addresses on add-on and from kodi | 338 | static AddonGlobalInterface* m_interface; // Interface function table to hold addresses on add-on and from kodi |
| 339 | static std::string m_strGlobalApiVersion; | ||
| 311 | 340 | ||
| 312 | /*private:*/ /* Needed public as long the old call functions becomes used! */ | 341 | /*private:*/ /* Needed public as long the old call functions becomes used! */ |
| 313 | static inline void ADDONBASE_Destroy() | 342 | static inline void ADDONBASE_Destroy() |
| @@ -325,16 +354,21 @@ public: | |||
| 325 | 354 | ||
| 326 | static inline ADDON_STATUS ADDONBASE_CreateInstance(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent) | 355 | static inline ADDON_STATUS ADDONBASE_CreateInstance(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent) |
| 327 | { | 356 | { |
| 357 | return ADDONBASE_CreateInstanceEx(instanceType, instanceID, instance, addonInstance, parent, ""); | ||
| 358 | } | ||
| 359 | |||
| 360 | static inline ADDON_STATUS ADDONBASE_CreateInstanceEx(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent, const char* version) | ||
| 361 | { | ||
| 328 | ADDON_STATUS status = ADDON_STATUS_NOT_IMPLEMENTED; | 362 | ADDON_STATUS status = ADDON_STATUS_NOT_IMPLEMENTED; |
| 329 | if (parent != nullptr) | 363 | if (parent != nullptr) |
| 330 | status = static_cast<IAddonInstance*>(parent)->CreateInstance(instanceType, instanceID, instance, *addonInstance); | 364 | status = static_cast<IAddonInstance*>(parent)->CreateInstanceEx(instanceType, instanceID, instance, *addonInstance, version); |
| 331 | if (status == ADDON_STATUS_NOT_IMPLEMENTED) | 365 | if (status == ADDON_STATUS_NOT_IMPLEMENTED) |
| 332 | status = CAddonBase::m_interface->addonBase->CreateInstance(instanceType, instanceID, instance, *addonInstance); | 366 | status = CAddonBase::m_interface->addonBase->CreateInstanceEx(instanceType, instanceID, instance, *addonInstance, version); |
| 333 | if (*addonInstance == nullptr) | 367 | if (*addonInstance == nullptr) |
| 334 | throw std::logic_error("kodi::addon::CAddonBase CreateInstance returns a empty instance pointer!"); | 368 | throw std::logic_error("kodi::addon::CAddonBase CreateInstanceEx returns a empty instance pointer!"); |
| 335 | 369 | ||
| 336 | if (static_cast<::kodi::addon::IAddonInstance*>(*addonInstance)->m_type != instanceType) | 370 | if (static_cast<::kodi::addon::IAddonInstance*>(*addonInstance)->m_type != instanceType) |
| 337 | throw std::logic_error("kodi::addon::CAddonBase CreateInstance with difference on given and returned instance type!"); | 371 | throw std::logic_error("kodi::addon::CAddonBase CreateInstanceEx with difference on given and returned instance type!"); |
| 338 | 372 | ||
| 339 | return status; | 373 | return status; |
| 340 | } | 374 | } |
| @@ -636,6 +670,11 @@ inline void* GetInterface(const std::string &name, const std::string &version) | |||
| 636 | kodi::addon::CAddonBase::m_interface->addonBase = new AddonClass; \ | 670 | kodi::addon::CAddonBase::m_interface->addonBase = new AddonClass; \ |
| 637 | return kodi::addon::CAddonBase::m_interface->addonBase->Create(); \ | 671 | return kodi::addon::CAddonBase::m_interface->addonBase->Create(); \ |
| 638 | } \ | 672 | } \ |
| 673 | extern "C" __declspec(dllexport) ADDON_STATUS ADDON_CreateEx(KODI_HANDLE addonInterface, const char* globalApiVersion, void *unused) \ | ||
| 674 | { \ | ||
| 675 | kodi::addon::CAddonBase::m_strGlobalApiVersion = globalApiVersion; \ | ||
| 676 | return ADDON_Create(addonInterface, unused); \ | ||
| 677 | } \ | ||
| 639 | extern "C" __declspec(dllexport) void ADDON_Destroy() \ | 678 | extern "C" __declspec(dllexport) void ADDON_Destroy() \ |
| 640 | { \ | 679 | { \ |
| 641 | kodi::addon::CAddonBase::ADDONBASE_Destroy(); \ | 680 | kodi::addon::CAddonBase::ADDONBASE_Destroy(); \ |
| @@ -652,4 +691,10 @@ inline void* GetInterface(const std::string &name, const std::string &version) | |||
| 652 | { \ | 691 | { \ |
| 653 | return kodi::addon::GetTypeVersion(type); \ | 692 | return kodi::addon::GetTypeVersion(type); \ |
| 654 | } \ | 693 | } \ |
| 655 | AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; | 694 | extern "C" __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) \ |
| 695 | { \ | ||
| 696 | return kodi::addon::GetTypeMinVersion(type); \ | ||
| 697 | } \ | ||
| 698 | AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; \ | ||
| 699 | std::string kodi::addon::CAddonBase::m_strGlobalApiVersion; | ||
| 700 | |||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h index 30b6d89..a3b8bcb 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h | |||
| @@ -106,7 +106,7 @@ namespace gui | |||
| 106 | /// **Example:** | 106 | /// **Example:** |
| 107 | /// ~~~~~~~~~~~~~{.cpp} | 107 | /// ~~~~~~~~~~~~~{.cpp} |
| 108 | /// .. | 108 | /// .. |
| 109 | /// int wid = kodi::gui::GetCurrentWindowDialogId() | 109 | /// int wid = kodi::gui::GetCurrentWindowDialogId(); |
| 110 | /// .. | 110 | /// .. |
| 111 | /// ~~~~~~~~~~~~~ | 111 | /// ~~~~~~~~~~~~~ |
| 112 | /// | 112 | /// |
| @@ -130,7 +130,7 @@ namespace gui | |||
| 130 | /// **Example:** | 130 | /// **Example:** |
| 131 | /// ~~~~~~~~~~~~~{.cpp} | 131 | /// ~~~~~~~~~~~~~{.cpp} |
| 132 | /// .. | 132 | /// .. |
| 133 | /// int wid = kodi::gui::GetCurrentWindowId() | 133 | /// int wid = kodi::gui::GetCurrentWindowId(); |
| 134 | /// .. | 134 | /// .. |
| 135 | /// ~~~~~~~~~~~~~ | 135 | /// ~~~~~~~~~~~~~ |
| 136 | /// | 136 | /// |
| @@ -141,5 +141,35 @@ namespace gui | |||
| 141 | } | 141 | } |
| 142 | //-------------------------------------------------------------------------- | 142 | //-------------------------------------------------------------------------- |
| 143 | 143 | ||
| 144 | //========================================================================== | ||
| 145 | /// | ||
| 146 | /// \ingroup cpp_kodi_gui | ||
| 147 | /// \brief To get hardware specific device context interface | ||
| 148 | /// | ||
| 149 | /// \return The currently active device context | ||
| 150 | /// | ||
| 151 | /// \warning This function is only be supported under Windows, on all other | ||
| 152 | /// OS it return `nullptr`! | ||
| 153 | /// | ||
| 154 | /// \note Returned Windows class pointer is `ID3D11DeviceContext1`. | ||
| 155 | /// | ||
| 156 | /// | ||
| 157 | ///------------------------------------------------------------------------- | ||
| 158 | /// | ||
| 159 | /// **Example:** | ||
| 160 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 161 | /// #include <d3d11_1.h> | ||
| 162 | /// .. | ||
| 163 | /// ID3D11DeviceContext1* context = static_cast<ID3D11DeviceContext1*>(kodi::gui::GetHWContext()); | ||
| 164 | /// .. | ||
| 165 | /// ~~~~~~~~~~~~~ | ||
| 166 | /// | ||
| 167 | inline void* GetHWContext() | ||
| 168 | { | ||
| 169 | using namespace ::kodi::addon; | ||
| 170 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_hw_context(CAddonBase::m_interface->toKodi->kodiBase); | ||
| 171 | } | ||
| 172 | //-------------------------------------------------------------------------- | ||
| 173 | |||
| 144 | } /* namespace gui */ | 174 | } /* namespace gui */ |
| 145 | } /* namespace kodi */ | 175 | } /* namespace kodi */ |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h index f188f34..e7a8a05 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | #ifdef BUILD_KODI_ADDON | 14 | #ifdef BUILD_KODI_ADDON |
| 15 | #include "../ActionIDs.h" | 15 | #include "../ActionIDs.h" |
| 16 | #else | 16 | #else |
| 17 | #include "input/ActionIDs.h" | 17 | #include "input/actions/ActionIDs.h" |
| 18 | #endif | 18 | #endif |
| 19 | 19 | ||
| 20 | namespace kodi | 20 | namespace kodi |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h index 770a416..b8b4cbf 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h | |||
| @@ -26,6 +26,7 @@ typedef struct AddonToKodiFuncTable_kodi_gui_general | |||
| 26 | int (*get_video_resolution)(void* kodiBase); | 26 | int (*get_video_resolution)(void* kodiBase); |
| 27 | int (*get_current_window_dialog_id)(void* kodiBase); | 27 | int (*get_current_window_dialog_id)(void* kodiBase); |
| 28 | int (*get_current_window_id)(void* kodiBase); | 28 | int (*get_current_window_id)(void* kodiBase); |
| 29 | void* (*get_hw_context)(void* kodiBase); | ||
| 29 | } AddonToKodiFuncTable_kodi_gui_general; | 30 | } AddonToKodiFuncTable_kodi_gui_general; |
| 30 | 31 | ||
| 31 | typedef struct AddonToKodiFuncTable_kodi_gui_control_button | 32 | typedef struct AddonToKodiFuncTable_kodi_gui_control_button |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h index 478f81b..4338606 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h | |||
| @@ -153,31 +153,42 @@ game_input_topology* GetTopology(); | |||
| 153 | void FreeTopology(game_input_topology* topology); | 153 | void FreeTopology(game_input_topology* topology); |
| 154 | 154 | ||
| 155 | /*! | 155 | /*! |
| 156 | * \brief Set the layouts for known controllers | ||
| 157 | * | ||
| 158 | * \param controllers The controller layouts | ||
| 159 | * \param controller_count The number of items in the array | ||
| 160 | * | ||
| 161 | * After loading the input topology, the frontend will call this with | ||
| 162 | * controller layouts for all controllers discovered in the topology. | ||
| 163 | */ | ||
| 164 | void SetControllerLayouts(const game_controller_layout* controllers, unsigned int controller_count); | ||
| 165 | |||
| 166 | /*! | ||
| 156 | * \brief Enable/disable keyboard input using the specified controller | 167 | * \brief Enable/disable keyboard input using the specified controller |
| 157 | * | 168 | * |
| 158 | * \param enable True to enable input, false otherwise | 169 | * \param enable True to enable input, false otherwise |
| 159 | * \param controller The controller info if enabling, or unused if disabling | 170 | * \param controller_id The controller ID if enabling, or unused if disabling |
| 160 | * | 171 | * |
| 161 | * \return True if keyboard input was enabled, false otherwise | 172 | * \return True if keyboard input was enabled, false otherwise |
| 162 | */ | 173 | */ |
| 163 | bool EnableKeyboard(bool enable, const game_controller* controller); | 174 | bool EnableKeyboard(bool enable, const char* controller_id); |
| 164 | 175 | ||
| 165 | /*! | 176 | /*! |
| 166 | * \brief Enable/disable mouse input using the specified controller | 177 | * \brief Enable/disable mouse input using the specified controller |
| 167 | * | 178 | * |
| 168 | * \param enable True to enable input, false otherwise | 179 | * \param enable True to enable input, false otherwise |
| 169 | * \param controller The controller info if enabling, or unused if disabling | 180 | * \param controller_id The controller ID if enabling, or unused if disabling |
| 170 | * | 181 | * |
| 171 | * \return True if mouse input was enabled, false otherwise | 182 | * \return True if mouse input was enabled, false otherwise |
| 172 | */ | 183 | */ |
| 173 | bool EnableMouse(bool enable, const game_controller* controller); | 184 | bool EnableMouse(bool enable, const char* controller_id); |
| 174 | 185 | ||
| 175 | /*! | 186 | /*! |
| 176 | * \brief Connect/disconnect a controller to a port on the virtual game console | 187 | * \brief Connect/disconnect a controller to a port on the virtual game console |
| 177 | * | 188 | * |
| 178 | * \param connect True to connect a controller, false to disconnect | 189 | * \param connect True to connect a controller, false to disconnect |
| 179 | * \param port_address The address of the port | 190 | * \param port_address The address of the port |
| 180 | * \param controller The controller info if connecting, or unused if disconnecting | 191 | * \param controller_id The controller ID if connecting, or unused if disconnecting |
| 181 | * \return True if the \p controller was (dis-)connected to the port, false otherwise | 192 | * \return True if the \p controller was (dis-)connected to the port, false otherwise |
| 182 | * | 193 | * |
| 183 | * The address is a string that allows traversal of the controller topology. | 194 | * The address is a string that allows traversal of the controller topology. |
| @@ -203,17 +214,17 @@ bool EnableMouse(bool enable, const game_controller* controller); | |||
| 203 | * To connect a multitap to the console's first port, the multitap's controller | 214 | * To connect a multitap to the console's first port, the multitap's controller |
| 204 | * info is set using the port address: | 215 | * info is set using the port address: |
| 205 | * | 216 | * |
| 206 | * 1 | 217 | * /1 |
| 207 | * | 218 | * |
| 208 | * To connect a SNES controller to the second port of the multitap, the | 219 | * To connect a SNES controller to the second port of the multitap, the |
| 209 | * controller info is next set using the address: | 220 | * controller info is next set using the address: |
| 210 | * | 221 | * |
| 211 | * 1/game.controller.multitap/2 | 222 | * /1/game.controller.multitap/2 |
| 212 | * | 223 | * |
| 213 | * Any attempts to connect a controller to a port on a disconnected multitap | 224 | * Any attempts to connect a controller to a port on a disconnected multitap |
| 214 | * will return false. | 225 | * will return false. |
| 215 | */ | 226 | */ |
| 216 | bool ConnectController(bool connect, const char* port_address, const game_controller* controller); | 227 | bool ConnectController(bool connect, const char* port_address, const char* controller_id); |
| 217 | 228 | ||
| 218 | /*! | 229 | /*! |
| 219 | * \brief Notify the add-on of an input event | 230 | * \brief Notify the add-on of an input event |
| @@ -310,6 +321,7 @@ void __declspec(dllexport) get_addon(void* ptr) | |||
| 310 | pClient->toAddon.HasFeature = HasFeature; | 321 | pClient->toAddon.HasFeature = HasFeature; |
| 311 | pClient->toAddon.GetTopology = GetTopology; | 322 | pClient->toAddon.GetTopology = GetTopology; |
| 312 | pClient->toAddon.FreeTopology = FreeTopology; | 323 | pClient->toAddon.FreeTopology = FreeTopology; |
| 324 | pClient->toAddon.SetControllerLayouts = SetControllerLayouts; | ||
| 313 | pClient->toAddon.EnableKeyboard = EnableKeyboard; | 325 | pClient->toAddon.EnableKeyboard = EnableKeyboard; |
| 314 | pClient->toAddon.EnableMouse = EnableMouse; | 326 | pClient->toAddon.EnableMouse = EnableMouse; |
| 315 | pClient->toAddon.ConnectController = ConnectController; | 327 | pClient->toAddon.ConnectController = ConnectController; |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h index e3187d2..ec9d472 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h | |||
| @@ -446,19 +446,27 @@ typedef enum GAME_PORT_TYPE | |||
| 446 | GAME_PORT_CONTROLLER, | 446 | GAME_PORT_CONTROLLER, |
| 447 | } GAME_PORT_TYPE; | 447 | } GAME_PORT_TYPE; |
| 448 | 448 | ||
| 449 | typedef struct game_controller | 449 | typedef struct game_controller_layout |
| 450 | { | 450 | { |
| 451 | const char* controller_id; | 451 | char* controller_id; |
| 452 | bool provides_input; // False for multitaps | 452 | bool provides_input; // False for multitaps |
| 453 | char** digital_buttons; | ||
| 453 | unsigned int digital_button_count; | 454 | unsigned int digital_button_count; |
| 455 | char** analog_buttons; | ||
| 454 | unsigned int analog_button_count; | 456 | unsigned int analog_button_count; |
| 457 | char** analog_sticks; | ||
| 455 | unsigned int analog_stick_count; | 458 | unsigned int analog_stick_count; |
| 459 | char** accelerometers; | ||
| 456 | unsigned int accelerometer_count; | 460 | unsigned int accelerometer_count; |
| 461 | char** keys; | ||
| 457 | unsigned int key_count; | 462 | unsigned int key_count; |
| 463 | char** rel_pointers; | ||
| 458 | unsigned int rel_pointer_count; | 464 | unsigned int rel_pointer_count; |
| 465 | char** abs_pointers; | ||
| 459 | unsigned int abs_pointer_count; | 466 | unsigned int abs_pointer_count; |
| 467 | char** motors; | ||
| 460 | unsigned int motor_count; | 468 | unsigned int motor_count; |
| 461 | } ATTRIBUTE_PACKED game_controller; | 469 | } ATTRIBUTE_PACKED game_controller_layout; |
| 462 | 470 | ||
| 463 | struct game_input_port; | 471 | struct game_input_port; |
| 464 | 472 | ||
| @@ -680,9 +688,10 @@ typedef struct KodiToAddonFuncTable_Game | |||
| 680 | bool (__cdecl* HasFeature)(const char*, const char*); | 688 | bool (__cdecl* HasFeature)(const char*, const char*); |
| 681 | game_input_topology* (__cdecl* GetTopology)(); | 689 | game_input_topology* (__cdecl* GetTopology)(); |
| 682 | void (__cdecl* FreeTopology)(game_input_topology*); | 690 | void (__cdecl* FreeTopology)(game_input_topology*); |
| 683 | bool (__cdecl* EnableKeyboard)(bool, const game_controller*); | 691 | void (__cdecl* SetControllerLayouts)(const game_controller_layout*, unsigned int); |
| 684 | bool (__cdecl* EnableMouse)(bool, const game_controller*); | 692 | bool (__cdecl* EnableKeyboard)(bool, const char*); |
| 685 | bool (__cdecl* ConnectController)(bool, const char*, const game_controller*); | 693 | bool (__cdecl* EnableMouse)(bool, const char*); |
| 694 | bool (__cdecl* ConnectController)(bool, const char*, const char*); | ||
| 686 | bool (__cdecl* InputEvent)(const game_input_event*); | 695 | bool (__cdecl* InputEvent)(const game_input_event*); |
| 687 | size_t (__cdecl* SerializeSize)(void); | 696 | size_t (__cdecl* SerializeSize)(void); |
| 688 | GAME_ERROR (__cdecl* Serialize)(uint8_t*, size_t); | 697 | GAME_ERROR (__cdecl* Serialize)(uint8_t*, size_t); |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h index b518c28..2e6459b 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h | |||
| @@ -135,15 +135,15 @@ public: | |||
| 135 | // --- Input callbacks ------------------------------------------------------- | 135 | // --- Input callbacks ------------------------------------------------------- |
| 136 | 136 | ||
| 137 | /*! | 137 | /*! |
| 138 | * \brief Notify the port of an input event | 138 | * \brief Notify the port of an input event |
| 139 | * | 139 | * |
| 140 | * \param event The input event | 140 | * \param event The input event |
| 141 | * | 141 | * |
| 142 | * Input events can arrive for the following sources: | 142 | * Input events can arrive for the following sources: |
| 143 | * - GAME_INPUT_EVENT_MOTOR | 143 | * - GAME_INPUT_EVENT_MOTOR |
| 144 | * | 144 | * |
| 145 | * \return true if the event was handled, false otherwise | 145 | * \return true if the event was handled, false otherwise |
| 146 | */ | 146 | */ |
| 147 | bool InputEvent(const game_input_event& event) | 147 | bool InputEvent(const game_input_event& event) |
| 148 | { | 148 | { |
| 149 | return m_callbacks->toKodi.InputEvent(m_callbacks->toKodi.kodiInstance, &event); | 149 | return m_callbacks->toKodi.InputEvent(m_callbacks->toKodi.kodiInstance, &event); |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt index 939585c..ef2fa25 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | set(HEADERS DllHelper.h ) | 1 | set(HEADERS DllHelper.h |
| 2 | Time.h) | ||
| 2 | 3 | ||
| 3 | if(NOT ENABLE_STATIC_LIBS) | 4 | if(NOT ENABLE_STATIC_LIBS) |
| 4 | core_add_library(addons_kodi-addon-dev-kit_include_kodi_tools) | 5 | core_add_library(addons_kodi-addon-dev-kit_include_kodi_tools) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h new file mode 100644 index 0000000..31c29fd --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2019 Team Kodi | ||
| 4 | * Copyright (C) 2011-2012 Pulse-Eight Limited. | ||
| 5 | * This file is part of Kodi - https://kodi.tv | ||
| 6 | * | ||
| 7 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 8 | * See LICENSES/README.md for more information. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #if defined(TARGET_DARWIN) | ||
| 12 | #include <mach/mach_time.h> | ||
| 13 | #include <CoreVideo/CVHostTime.h> | ||
| 14 | #elif defined(TARGET_WINDOWS) | ||
| 15 | #include <Windows.h> | ||
| 16 | #include <time.h> | ||
| 17 | #else | ||
| 18 | #include <time.h> | ||
| 19 | #endif | ||
| 20 | |||
| 21 | namespace kodi | ||
| 22 | { | ||
| 23 | namespace time | ||
| 24 | { | ||
| 25 | |||
| 26 | //=============================================================================== | ||
| 27 | /// @brief Function to get current time in milliseconds | ||
| 28 | /// | ||
| 29 | /// @return Current time in milliseconds as a double value | ||
| 30 | /// | ||
| 31 | /// | ||
| 32 | /// ----------------------------------------------------------------------------- | ||
| 33 | /// | ||
| 34 | /// **Example:** | ||
| 35 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 36 | /// | ||
| 37 | /// #include <kodi/tools/Time.h> | ||
| 38 | /// | ||
| 39 | /// ... | ||
| 40 | /// double time = kodi::time::GetTimeMs(); | ||
| 41 | /// ... | ||
| 42 | /// ~~~~~~~~~~~~~ | ||
| 43 | /// | ||
| 44 | inline double GetTimeMs() | ||
| 45 | { | ||
| 46 | #if defined(TARGET_DARWIN) | ||
| 47 | return static_cast<double>(CVGetCurrentHostTime() / static_cast<double>(CVGetHostClockFrequency() * 0.001)); | ||
| 48 | #elif defined(TARGET_WINDOWS) | ||
| 49 | LARGE_INTEGER tickPerSecond; | ||
| 50 | LARGE_INTEGER tick; | ||
| 51 | if (QueryPerformanceFrequency(&tickPerSecond)) | ||
| 52 | { | ||
| 53 | QueryPerformanceCounter(&tick); | ||
| 54 | return static_cast<double>(tick.QuadPart) / (tickPerSecond.QuadPart / 1000.0); | ||
| 55 | } | ||
| 56 | return 0.0; | ||
| 57 | #else | ||
| 58 | timespec time; | ||
| 59 | clock_gettime(CLOCK_MONOTONIC, &time); | ||
| 60 | return static_cast<double>(time.tv_sec) * 1000.0 + time.tv_nsec / 1000000.0; | ||
| 61 | #endif | ||
| 62 | } | ||
| 63 | //------------------------------------------------------------------------------- | ||
| 64 | |||
| 65 | //=============================================================================== | ||
| 66 | /// @brief Function to get current time in seconds | ||
| 67 | /// | ||
| 68 | /// @return Current time in seconds with the value type defined in the template | ||
| 69 | /// | ||
| 70 | /// | ||
| 71 | /// ----------------------------------------------------------------------------- | ||
| 72 | /// | ||
| 73 | /// **Example:** | ||
| 74 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 75 | /// | ||
| 76 | /// #include <kodi/tools/Time.h> | ||
| 77 | /// | ||
| 78 | /// ... | ||
| 79 | /// double time = kodi::time::GetTimeSec<double>(); | ||
| 80 | /// ... | ||
| 81 | /// ~~~~~~~~~~~~~ | ||
| 82 | /// | ||
| 83 | template <class T> | ||
| 84 | inline T GetTimeSec() | ||
| 85 | { | ||
| 86 | return static_cast<T>(GetTimeMs()) / static_cast<T>(1000.0); | ||
| 87 | } | ||
| 88 | //------------------------------------------------------------------------------- | ||
| 89 | |||
| 90 | } /* namespace time */ | ||
| 91 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h index 5127f7e..a9f1798 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | * overview. | 30 | * overview. |
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #define ADDON_GLOBAL_VERSION_MAIN "1.0.13" | 33 | #define ADDON_GLOBAL_VERSION_MAIN "1.0.14" |
| 34 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12" | 34 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12" |
| 35 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" | 35 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" |
| 36 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ | 36 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ |
| @@ -44,7 +44,7 @@ | |||
| 44 | #define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general" | 44 | #define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general" |
| 45 | #define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h" | 45 | #define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h" |
| 46 | 46 | ||
| 47 | #define ADDON_GLOBAL_VERSION_GUI "5.12.0" | 47 | #define ADDON_GLOBAL_VERSION_GUI "5.12.1" |
| 48 | #define ADDON_GLOBAL_VERSION_GUI_MIN "5.10.0" | 48 | #define ADDON_GLOBAL_VERSION_GUI_MIN "5.10.0" |
| 49 | #define ADDON_GLOBAL_VERSION_GUI_XML_ID "kodi.binary.global.gui" | 49 | #define ADDON_GLOBAL_VERSION_GUI_XML_ID "kodi.binary.global.gui" |
| 50 | #define ADDON_GLOBAL_VERSION_GUI_DEPENDS "libKODI_guilib.h" \ | 50 | #define ADDON_GLOBAL_VERSION_GUI_DEPENDS "libKODI_guilib.h" \ |
| @@ -75,8 +75,8 @@ | |||
| 75 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" | 75 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" |
| 76 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" | 76 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" |
| 77 | 77 | ||
| 78 | #define ADDON_INSTANCE_VERSION_GAME "1.0.38" | 78 | #define ADDON_INSTANCE_VERSION_GAME "1.1.0" |
| 79 | #define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.38" | 79 | #define ADDON_INSTANCE_VERSION_GAME_MIN "1.1.0" |
| 80 | #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" | 80 | #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" |
| 81 | #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ | 81 | #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ |
| 82 | "kodi_game_types.h" \ | 82 | "kodi_game_types.h" \ |
| @@ -98,8 +98,8 @@ | |||
| 98 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ | 98 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ |
| 99 | "addon-instance/PeripheralUtils.h" | 99 | "addon-instance/PeripheralUtils.h" |
| 100 | 100 | ||
| 101 | #define ADDON_INSTANCE_VERSION_PVR "5.10.3" | 101 | #define ADDON_INSTANCE_VERSION_PVR "6.0.0" |
| 102 | #define ADDON_INSTANCE_VERSION_PVR_MIN "5.10.0" | 102 | #define ADDON_INSTANCE_VERSION_PVR_MIN "6.0.0" |
| 103 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" | 103 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" |
| 104 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ | 104 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ |
| 105 | "xbmc_pvr_types.h" \ | 105 | "xbmc_pvr_types.h" \ |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h index e9e7d9a..ce2bc98 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h | |||
| @@ -15,6 +15,7 @@ extern "C" { | |||
| 15 | #endif | 15 | #endif |
| 16 | 16 | ||
| 17 | ADDON_STATUS __declspec(dllexport) ADDON_Create(void *callbacks, void* props); | 17 | ADDON_STATUS __declspec(dllexport) ADDON_Create(void *callbacks, void* props); |
| 18 | ADDON_STATUS __declspec(dllexport) ADDON_CreateEx(void *callbacks, const char* globalApiVersion, void* props); | ||
| 18 | void __declspec(dllexport) ADDON_Destroy(); | 19 | void __declspec(dllexport) ADDON_Destroy(); |
| 19 | ADDON_STATUS __declspec(dllexport) ADDON_GetStatus(); | 20 | ADDON_STATUS __declspec(dllexport) ADDON_GetStatus(); |
| 20 | ADDON_STATUS __declspec(dllexport) ADDON_SetSetting(const char *settingName, const void *settingValue); | 21 | ADDON_STATUS __declspec(dllexport) ADDON_SetSetting(const char *settingName, const void *settingValue); |
| @@ -22,6 +23,10 @@ extern "C" { | |||
| 22 | { | 23 | { |
| 23 | return kodi::addon::GetTypeVersion(type); | 24 | return kodi::addon::GetTypeVersion(type); |
| 24 | } | 25 | } |
| 26 | __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) | ||
| 27 | { | ||
| 28 | return kodi::addon::GetTypeMinVersion(type); | ||
| 29 | } | ||
| 25 | 30 | ||
| 26 | #ifdef __cplusplus | 31 | #ifdef __cplusplus |
| 27 | }; | 32 | }; |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h index 7b11ed8..30503d5 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h | |||
| @@ -100,7 +100,6 @@ extern "C" { | |||
| 100 | time_t firstAired; /*!< @brief (optional) first aired in UTC */ | 100 | time_t firstAired; /*!< @brief (optional) first aired in UTC */ |
| 101 | int iParentalRating; /*!< @brief (optional) parental rating */ | 101 | int iParentalRating; /*!< @brief (optional) parental rating */ |
| 102 | int iStarRating; /*!< @brief (optional) star rating */ | 102 | int iStarRating; /*!< @brief (optional) star rating */ |
| 103 | bool bNotify; /*!< @brief (optional) notify the user when this event starts */ | ||
| 104 | int iSeriesNumber; /*!< @brief (optional) series number */ | 103 | int iSeriesNumber; /*!< @brief (optional) series number */ |
| 105 | int iEpisodeNumber; /*!< @brief (optional) episode number */ | 104 | int iEpisodeNumber; /*!< @brief (optional) episode number */ |
| 106 | int iEpisodePartNumber; /*!< @brief (optional) episode part number */ | 105 | int iEpisodePartNumber; /*!< @brief (optional) episode part number */ |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h index 27fa800..26e9099 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | |||
| @@ -78,14 +78,14 @@ extern "C" | |||
| 78 | * Request the EPG for a channel from the backend. | 78 | * Request the EPG for a channel from the backend. |
| 79 | * EPG entries are added to Kodi by calling TransferEpgEntry() on the callback. | 79 | * EPG entries are added to Kodi by calling TransferEpgEntry() on the callback. |
| 80 | * @param handle Handle to pass to the callback method. | 80 | * @param handle Handle to pass to the callback method. |
| 81 | * @param channel The channel to get the EPG table for. | 81 | * @param iChannelUid The UID of the channel to get the EPG table for. |
| 82 | * @param iStart Get events after this time (UTC). | 82 | * @param iStart Get events after this time (UTC). |
| 83 | * @param iEnd Get events before this time (UTC). | 83 | * @param iEnd Get events before this time (UTC). |
| 84 | * @return PVR_ERROR_NO_ERROR if the table has been fetched successfully. | 84 | * @return PVR_ERROR_NO_ERROR if the table has been fetched successfully. |
| 85 | * @remarks Required if bSupportsEPG is set to true. | 85 | * @remarks Required if bSupportsEPG is set to true. |
| 86 | * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | 86 | * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. |
| 87 | */ | 87 | */ |
| 88 | PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channel, time_t iStart, time_t iEnd); | 88 | PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd); |
| 89 | 89 | ||
| 90 | /* | 90 | /* |
| 91 | * Check if the given EPG tag can be recorded. | 91 | * Check if the given EPG tag can be recorded. |
| @@ -413,6 +413,7 @@ extern "C" | |||
| 413 | * @param channel The channel to stream. | 413 | * @param channel The channel to stream. |
| 414 | * @return True if the stream has been opened successfully, false otherwise. | 414 | * @return True if the stream has been opened successfully, false otherwise. |
| 415 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. | 415 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. |
| 416 | * CloseLiveStream() will always be called by Kodi prior to calling this function. | ||
| 416 | * Return false if this add-on won't provide this function. | 417 | * Return false if this add-on won't provide this function. |
| 417 | */ | 418 | */ |
| 418 | bool OpenLiveStream(const PVR_CHANNEL& channel); | 419 | bool OpenLiveStream(const PVR_CHANNEL& channel); |
| @@ -497,7 +498,7 @@ extern "C" | |||
| 497 | * Get the stream properties of the stream that's currently being read. | 498 | * Get the stream properties of the stream that's currently being read. |
| 498 | * @param pProperties The properties of the currently playing stream. | 499 | * @param pProperties The properties of the currently playing stream. |
| 499 | * @return PVR_ERROR_NO_ERROR if the properties have been fetched successfully. | 500 | * @return PVR_ERROR_NO_ERROR if the properties have been fetched successfully. |
| 500 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. | 501 | * @remarks Required if bHandlesDemuxing is set to true. |
| 501 | * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | 502 | * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. |
| 502 | */ | 503 | */ |
| 503 | PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties); | 504 | PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties); |
| @@ -523,6 +524,7 @@ extern "C" | |||
| 523 | * @param recording The recording to open. | 524 | * @param recording The recording to open. |
| 524 | * @return True if the stream has been opened successfully, false otherwise. | 525 | * @return True if the stream has been opened successfully, false otherwise. |
| 525 | * @remarks Optional, and only used if bSupportsRecordings is set to true. | 526 | * @remarks Optional, and only used if bSupportsRecordings is set to true. |
| 527 | * CloseRecordedStream() will always be called by Kodi prior to calling this function. | ||
| 526 | * Return false if this add-on won't provide this function. | 528 | * Return false if this add-on won't provide this function. |
| 527 | */ | 529 | */ |
| 528 | bool OpenRecordedStream(const PVR_RECORDING& recording); | 530 | bool OpenRecordedStream(const PVR_RECORDING& recording); |
| @@ -639,16 +641,17 @@ extern "C" | |||
| 639 | void SetSpeed(int speed); | 641 | void SetSpeed(int speed); |
| 640 | 642 | ||
| 641 | /*! | 643 | /*! |
| 642 | * Get the hostname of the pvr backend server | 644 | * Notify the pvr addon/demuxer that Kodi wishes to fill demux queue |
| 643 | * @return hostname as ip address or alias. If backend does not utilize a server, return empty string. | 645 | * @param mode The requested filling mode |
| 646 | * @remarks Optional, and only used if addon has its own demuxer. | ||
| 644 | */ | 647 | */ |
| 645 | const char* GetBackendHostname(); | 648 | void FillBuffer(bool mode); |
| 646 | 649 | ||
| 647 | /*! | 650 | /*! |
| 648 | * Check if timeshift is active | 651 | * Get the hostname of the pvr backend server |
| 649 | * @return true if timeshift is active | 652 | * @return hostname as ip address or alias. If backend does not utilize a server, return empty string. |
| 650 | */ | 653 | */ |
| 651 | bool IsTimeshifting(); | 654 | const char* GetBackendHostname(); |
| 652 | 655 | ||
| 653 | /*! | 656 | /*! |
| 654 | * Check for real-time streaming | 657 | * Check for real-time streaming |
| @@ -751,6 +754,7 @@ extern "C" | |||
| 751 | pClient->toAddon.CanSeekStream = CanSeekStream; | 754 | pClient->toAddon.CanSeekStream = CanSeekStream; |
| 752 | pClient->toAddon.SeekTime = SeekTime; | 755 | pClient->toAddon.SeekTime = SeekTime; |
| 753 | pClient->toAddon.SetSpeed = SetSpeed; | 756 | pClient->toAddon.SetSpeed = SetSpeed; |
| 757 | pClient->toAddon.FillBuffer = FillBuffer; | ||
| 754 | 758 | ||
| 755 | pClient->toAddon.OpenRecordedStream = OpenRecordedStream; | 759 | pClient->toAddon.OpenRecordedStream = OpenRecordedStream; |
| 756 | pClient->toAddon.CloseRecordedStream = CloseRecordedStream; | 760 | pClient->toAddon.CloseRecordedStream = CloseRecordedStream; |
| @@ -765,7 +769,6 @@ extern "C" | |||
| 765 | 769 | ||
| 766 | pClient->toAddon.GetBackendHostname = GetBackendHostname; | 770 | pClient->toAddon.GetBackendHostname = GetBackendHostname; |
| 767 | 771 | ||
| 768 | pClient->toAddon.IsTimeshifting = IsTimeshifting; | ||
| 769 | pClient->toAddon.IsRealTimeStream = IsRealTimeStream; | 772 | pClient->toAddon.IsRealTimeStream = IsRealTimeStream; |
| 770 | 773 | ||
| 771 | pClient->toAddon.SetEPGTimeFrame = SetEPGTimeFrame; | 774 | pClient->toAddon.SetEPGTimeFrame = SetEPGTimeFrame; |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h index f1562b6..999d3b3 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h | |||
| @@ -55,8 +55,8 @@ struct DemuxPacket; | |||
| 55 | #define PVR_ADDON_TIMERTYPE_ARRAY_SIZE 32 | 55 | #define PVR_ADDON_TIMERTYPE_ARRAY_SIZE 32 |
| 56 | #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE 512 | 56 | #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE 512 |
| 57 | #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL 128 | 57 | #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL 128 |
| 58 | #define PVR_ADDON_TIMERTYPE_STRING_LENGTH 64 | 58 | #define PVR_ADDON_TIMERTYPE_STRING_LENGTH 128 |
| 59 | #define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 64 | 59 | #define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 128 |
| 60 | #define PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE 512 | 60 | #define PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE 512 |
| 61 | #define PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH 64 | 61 | #define PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH 64 |
| 62 | 62 | ||
| @@ -154,6 +154,7 @@ extern "C" { | |||
| 154 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = 0x01000000; /*!< @brief this type supports 'any channel', for example when defining a timer rule that should match any channel instaed of a particular channel */ | 154 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = 0x01000000; /*!< @brief this type supports 'any channel', for example when defining a timer rule that should match any channel instaed of a particular channel */ |
| 155 | const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = 0x02000000; /*!< @brief this type should not appear on any create menus which don't provide an associated EPG tag with a series link */ | 155 | const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = 0x02000000; /*!< @brief this type should not appear on any create menus which don't provide an associated EPG tag with a series link */ |
| 156 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = 0x04000000; /*!< @brief this type allows deletion of an otherwise read-only timer */ | 156 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = 0x04000000; /*!< @brief this type allows deletion of an otherwise read-only timer */ |
| 157 | const unsigned int PVR_TIMER_TYPE_IS_REMINDER = 0x08000000; /*!< @brief timers of this type do trigger a reminder if time is up by calling the Kodi callback 'ReminderNotification'. */ | ||
| 157 | 158 | ||
| 158 | /*! | 159 | /*! |
| 159 | * @brief PVR timer weekdays (PVR_TIMER.iWeekdays values) | 160 | * @brief PVR timer weekdays (PVR_TIMER.iWeekdays values) |
| @@ -310,12 +311,10 @@ extern "C" { | |||
| 310 | bool bSupportsRecordingsRename; /*!< @brief true if the backend supports renaming recordings. */ | 311 | bool bSupportsRecordingsRename; /*!< @brief true if the backend supports renaming recordings. */ |
| 311 | bool bSupportsRecordingsLifetimeChange; /*!< @brief true if the backend supports changing lifetime for recordings. */ | 312 | bool bSupportsRecordingsLifetimeChange; /*!< @brief true if the backend supports changing lifetime for recordings. */ |
| 312 | bool bSupportsDescrambleInfo; /*!< @brief true if the backend supports descramble information for playing channels. */ | 313 | bool bSupportsDescrambleInfo; /*!< @brief true if the backend supports descramble information for playing channels. */ |
| 314 | bool bSupportsAsyncEPGTransfer; /*!< @brief true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback function EpgEventStateChange. */ | ||
| 313 | 315 | ||
| 314 | unsigned int iRecordingsLifetimesSize; /*!< @brief (required) Count of possible values for PVR_RECORDING.iLifetime. 0 means lifetime is not supported for recordings or no own value definition wanted, but to use Kodi defaults of 1..365. */ | 316 | unsigned int iRecordingsLifetimesSize; /*!< @brief (required) Count of possible values for PVR_RECORDING.iLifetime. 0 means lifetime is not supported for recordings or no own value definition wanted, but to use Kodi defaults of 1..365. */ |
| 315 | PVR_ATTRIBUTE_INT_VALUE recordingsLifetimeValues[PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE]; /*!< @brief (optional) Array containing the possible values for PVR_RECORDING.iLifetime. Must be filled if iLifetimesSize > 0 */ | 317 | PVR_ATTRIBUTE_INT_VALUE recordingsLifetimeValues[PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE]; /*!< @brief (optional) Array containing the possible values for PVR_RECORDING.iLifetime. Must be filled if iLifetimesSize > 0 */ |
| 316 | |||
| 317 | // TODO: cleanup: move this member up after the other bools with the next incompatible pvr addon api change. | ||
| 318 | bool bSupportsAsyncEPGTransfer; /*!< @brief true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback function EpgEventStateChange. */ | ||
| 319 | } ATTRIBUTE_PACKED PVR_ADDON_CAPABILITIES; | 318 | } ATTRIBUTE_PACKED PVR_ADDON_CAPABILITIES; |
| 320 | 319 | ||
| 321 | /*! | 320 | /*! |
| @@ -402,6 +401,7 @@ extern "C" { | |||
| 402 | unsigned int iEncryptionSystem; /*!< @brief (optional) the encryption ID or CaID of this channel */ | 401 | unsigned int iEncryptionSystem; /*!< @brief (optional) the encryption ID or CaID of this channel */ |
| 403 | char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) path to the channel icon (if present) */ | 402 | char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) path to the channel icon (if present) */ |
| 404 | bool bIsHidden; /*!< @brief (optional) true if this channel is marked as hidden */ | 403 | bool bIsHidden; /*!< @brief (optional) true if this channel is marked as hidden */ |
| 404 | bool bHasArchive; /*!< @brief (optional) true if this channel has a server-side back buffer */ | ||
| 405 | } ATTRIBUTE_PACKED PVR_CHANNEL; | 405 | } ATTRIBUTE_PACKED PVR_CHANNEL; |
| 406 | 406 | ||
| 407 | typedef struct PVR_CHANNEL_GROUP | 407 | typedef struct PVR_CHANNEL_GROUP |
| @@ -634,7 +634,7 @@ extern "C" { | |||
| 634 | const char* (__cdecl* GetConnectionString)(void); | 634 | const char* (__cdecl* GetConnectionString)(void); |
| 635 | PVR_ERROR (__cdecl* GetDriveSpace)(long long*, long long*); | 635 | PVR_ERROR (__cdecl* GetDriveSpace)(long long*, long long*); |
| 636 | PVR_ERROR (__cdecl* MenuHook)(const PVR_MENUHOOK&, const PVR_MENUHOOK_DATA&); | 636 | PVR_ERROR (__cdecl* MenuHook)(const PVR_MENUHOOK&, const PVR_MENUHOOK_DATA&); |
| 637 | PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, const PVR_CHANNEL&, time_t, time_t); | 637 | PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, int, time_t, time_t); |
| 638 | PVR_ERROR (__cdecl* IsEPGTagRecordable)(const EPG_TAG*, bool*); | 638 | PVR_ERROR (__cdecl* IsEPGTagRecordable)(const EPG_TAG*, bool*); |
| 639 | PVR_ERROR (__cdecl* IsEPGTagPlayable)(const EPG_TAG*, bool*); | 639 | PVR_ERROR (__cdecl* IsEPGTagPlayable)(const EPG_TAG*, bool*); |
| 640 | PVR_ERROR (__cdecl* GetEPGTagEdl)(const EPG_TAG*, PVR_EDL_ENTRY[], int*); | 640 | PVR_ERROR (__cdecl* GetEPGTagEdl)(const EPG_TAG*, PVR_EDL_ENTRY[], int*); |
| @@ -690,8 +690,8 @@ extern "C" { | |||
| 690 | bool (__cdecl* CanSeekStream)(void); | 690 | bool (__cdecl* CanSeekStream)(void); |
| 691 | bool (__cdecl* SeekTime)(double, bool, double*); | 691 | bool (__cdecl* SeekTime)(double, bool, double*); |
| 692 | void (__cdecl* SetSpeed)(int); | 692 | void (__cdecl* SetSpeed)(int); |
| 693 | void (__cdecl* FillBuffer)(bool); | ||
| 693 | const char* (__cdecl* GetBackendHostname)(void); | 694 | const char* (__cdecl* GetBackendHostname)(void); |
| 694 | bool (__cdecl* IsTimeshifting)(void); | ||
| 695 | bool (__cdecl* IsRealTimeStream)(void); | 695 | bool (__cdecl* IsRealTimeStream)(void); |
| 696 | PVR_ERROR (__cdecl* SetEPGTimeFrame)(int); | 696 | PVR_ERROR (__cdecl* SetEPGTimeFrame)(int); |
| 697 | void (__cdecl* OnSystemSleep)(void); | 697 | void (__cdecl* OnSystemSleep)(void); |
