diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-dev-kit/include/kodi/versions.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/versions.h')
| -rw-r--r-- | xbmc/addons/kodi-dev-kit/include/kodi/versions.h | 492 |
1 files changed, 492 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-dev-kit/include/kodi/versions.h new file mode 100644 index 0000000..e632f5a --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/versions.h | |||
| @@ -0,0 +1,492 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2016-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include <string.h> | ||
| 12 | |||
| 13 | #define STR_HELPER(x) #x | ||
| 14 | #define STR(x) STR_HELPER(x) | ||
| 15 | |||
| 16 | /* | ||
| 17 | *------------------------------------------------------------------------------ | ||
| 18 | * Some parts on headers are only be used for Kodi itself and internally (not | ||
| 19 | * for add-on development). | ||
| 20 | * | ||
| 21 | * For this reason also no doxygen part with "///" defined there. | ||
| 22 | * ----------------------------------------------------------------------------- | ||
| 23 | */ | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Versions of all add-on globals and instances are defined below. | ||
| 27 | * | ||
| 28 | * This is added here and not in related header to prevent not | ||
| 29 | * needed includes during compile. Also have it here a better | ||
| 30 | * overview. | ||
| 31 | */ | ||
| 32 | |||
| 33 | // Ignore clang here, as this must be good in overview and as the main reason, | ||
| 34 | // because cmake uses this area in this form to perform its addon dependency | ||
| 35 | // check. | ||
| 36 | // clang-format off | ||
| 37 | #define ADDON_GLOBAL_VERSION_MAIN "1.2.4" | ||
| 38 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.2.0" | ||
| 39 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" | ||
| 40 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ | ||
| 41 | "addon-instance/" \ | ||
| 42 | "c-api/addon_base.h" | ||
| 43 | |||
| 44 | #define ADDON_GLOBAL_VERSION_GENERAL "1.0.5" | ||
| 45 | #define ADDON_GLOBAL_VERSION_GENERAL_MIN "1.0.4" | ||
| 46 | #define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general" | ||
| 47 | #define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h" | ||
| 48 | |||
| 49 | #define ADDON_GLOBAL_VERSION_GUI "5.15.0" | ||
| 50 | #define ADDON_GLOBAL_VERSION_GUI_MIN "5.15.0" | ||
| 51 | #define ADDON_GLOBAL_VERSION_GUI_XML_ID "kodi.binary.global.gui" | ||
| 52 | #define ADDON_GLOBAL_VERSION_GUI_DEPENDS "c-api/gui/input/action_ids.h" \ | ||
| 53 | "c-api/gui/" \ | ||
| 54 | "gui/" | ||
| 55 | |||
| 56 | #define ADDON_GLOBAL_VERSION_AUDIOENGINE "1.1.1" | ||
| 57 | #define ADDON_GLOBAL_VERSION_AUDIOENGINE_MIN "1.1.0" | ||
| 58 | #define ADDON_GLOBAL_VERSION_AUDIOENGINE_XML_ID "kodi.binary.global.audioengine" | ||
| 59 | #define ADDON_GLOBAL_VERSION_AUDIOENGINE_DEPENDS "AudioEngine.h" \ | ||
| 60 | "c-api/audio_engine.h" | ||
| 61 | |||
| 62 | #define ADDON_GLOBAL_VERSION_FILESYSTEM "1.1.6" | ||
| 63 | #define ADDON_GLOBAL_VERSION_FILESYSTEM_MIN "1.1.0" | ||
| 64 | #define ADDON_GLOBAL_VERSION_FILESYSTEM_XML_ID "kodi.binary.global.filesystem" | ||
| 65 | #define ADDON_GLOBAL_VERSION_FILESYSTEM_DEPENDS "Filesystem.h" \ | ||
| 66 | "c-api/filesystem.h" \ | ||
| 67 | "gui/gl/Shader.h" \ | ||
| 68 | "tools/DllHelper.h" | ||
| 69 | |||
| 70 | #define ADDON_GLOBAL_VERSION_NETWORK "1.0.4" | ||
| 71 | #define ADDON_GLOBAL_VERSION_NETWORK_MIN "1.0.0" | ||
| 72 | #define ADDON_GLOBAL_VERSION_NETWORK_XML_ID "kodi.binary.global.network" | ||
| 73 | #define ADDON_GLOBAL_VERSION_NETWORK_DEPENDS "Network.h" \ | ||
| 74 | "c-api/network.h" | ||
| 75 | |||
| 76 | #define ADDON_GLOBAL_VERSION_TOOLS "1.0.4" | ||
| 77 | #define ADDON_GLOBAL_VERSION_TOOLS_MIN "1.0.0" | ||
| 78 | #define ADDON_GLOBAL_VERSION_TOOLS_XML_ID "kodi.binary.global.tools" | ||
| 79 | #define ADDON_GLOBAL_VERSION_TOOLS_DEPENDS "tools/DllHelper.h" \ | ||
| 80 | "tools/EndTime.h" \ | ||
| 81 | "tools/StringUtils.h" \ | ||
| 82 | "tools/Thread.h" \ | ||
| 83 | "tools/Timer.h" | ||
| 84 | |||
| 85 | #define ADDON_INSTANCE_VERSION_AUDIODECODER "3.0.0" | ||
| 86 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_MIN "3.0.0" | ||
| 87 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_XML_ID "kodi.binary.instance.audiodecoder" | ||
| 88 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_DEPENDS "c-api/addon-instance/audio_decoder.h" \ | ||
| 89 | "addon-instance/AudioDecoder.h" | ||
| 90 | |||
| 91 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER "2.1.0" | ||
| 92 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_MIN "2.1.0" | ||
| 93 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" | ||
| 94 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "c-api/addon-instance/audio_encoder.h" \ | ||
| 95 | "addon-instance/AudioEncoder.h" | ||
| 96 | |||
| 97 | #define ADDON_INSTANCE_VERSION_GAME "2.1.0" | ||
| 98 | #define ADDON_INSTANCE_VERSION_GAME_MIN "2.1.0" | ||
| 99 | #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" | ||
| 100 | #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "addon-instance/Game.h" | ||
| 101 | |||
| 102 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER "2.1.1" | ||
| 103 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_MIN "2.1.0" | ||
| 104 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_XML_ID "kodi.binary.instance.imagedecoder" | ||
| 105 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_DEPENDS "addon-instance/ImageDecoder.h" | ||
| 106 | |||
| 107 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM "2.3.4" | ||
| 108 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_MIN "2.3.4" | ||
| 109 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream" | ||
| 110 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "addon-instance/Inputstream.h" | ||
| 111 | |||
| 112 | #define ADDON_INSTANCE_VERSION_PERIPHERAL "2.0.0" | ||
| 113 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "2.0.0" | ||
| 114 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_XML_ID "kodi.binary.instance.peripheral" | ||
| 115 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ | ||
| 116 | "addon-instance/PeripheralUtils.h" | ||
| 117 | |||
| 118 | #define ADDON_INSTANCE_VERSION_PVR "7.0.1" | ||
| 119 | #define ADDON_INSTANCE_VERSION_PVR_MIN "7.0.0" | ||
| 120 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" | ||
| 121 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "c-api/addon-instance/pvr.h" \ | ||
| 122 | "c-api/addon-instance/pvr/pvr_channel_groups.h" \ | ||
| 123 | "c-api/addon-instance/pvr/pvr_channels.h" \ | ||
| 124 | "c-api/addon-instance/pvr/pvr_defines.h" \ | ||
| 125 | "c-api/addon-instance/pvr/pvr_edl.h" \ | ||
| 126 | "c-api/addon-instance/pvr/pvr_epg.h" \ | ||
| 127 | "c-api/addon-instance/pvr/pvr_general.h" \ | ||
| 128 | "c-api/addon-instance/pvr/pvr_menu_hook.h" \ | ||
| 129 | "c-api/addon-instance/pvr/pvr_recordings.h" \ | ||
| 130 | "c-api/addon-instance/pvr/pvr_stream.h" \ | ||
| 131 | "c-api/addon-instance/pvr/pvr_timers.h" \ | ||
| 132 | "addon-instance/PVR.h" \ | ||
| 133 | "addon-instance/pvr/ChannelGroups.h" \ | ||
| 134 | "addon-instance/pvr/Channels.h" \ | ||
| 135 | "addon-instance/pvr/EDL.h" \ | ||
| 136 | "addon-instance/pvr/EPG.h" \ | ||
| 137 | "addon-instance/pvr/General.h" \ | ||
| 138 | "addon-instance/pvr/MenuHook.h" \ | ||
| 139 | "addon-instance/pvr/Recordings.h" \ | ||
| 140 | "addon-instance/pvr/Stream.h" \ | ||
| 141 | "addon-instance/pvr/Timers.h" | ||
| 142 | |||
| 143 | #define ADDON_INSTANCE_VERSION_SCREENSAVER "2.1.0" | ||
| 144 | #define ADDON_INSTANCE_VERSION_SCREENSAVER_MIN "2.1.0" | ||
| 145 | #define ADDON_INSTANCE_VERSION_SCREENSAVER_XML_ID "kodi.binary.instance.screensaver" | ||
| 146 | #define ADDON_INSTANCE_VERSION_SCREENSAVER_DEPENDS "c-api/addon-instance/screensaver.h" \ | ||
| 147 | "addon-instance/Screensaver.h" | ||
| 148 | |||
| 149 | #define ADDON_INSTANCE_VERSION_VFS "3.0.0" | ||
| 150 | #define ADDON_INSTANCE_VERSION_VFS_MIN "3.0.0" | ||
| 151 | #define ADDON_INSTANCE_VERSION_VFS_XML_ID "kodi.binary.instance.vfs" | ||
| 152 | #define ADDON_INSTANCE_VERSION_VFS_DEPENDS "c-api/addon-instance/vfs.h" \ | ||
| 153 | "addon-instance/VFS.h" | ||
| 154 | |||
| 155 | #define ADDON_INSTANCE_VERSION_VISUALIZATION "3.0.0" | ||
| 156 | #define ADDON_INSTANCE_VERSION_VISUALIZATION_MIN "3.0.0" | ||
| 157 | #define ADDON_INSTANCE_VERSION_VISUALIZATION_XML_ID "kodi.binary.instance.visualization" | ||
| 158 | #define ADDON_INSTANCE_VERSION_VISUALIZATION_DEPENDS "addon-instance/Visualization.h" \ | ||
| 159 | "c-api/addon-instance/visualization.h" | ||
| 160 | |||
| 161 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC "1.0.4" | ||
| 162 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_MIN "1.0.4" | ||
| 163 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_XML_ID "kodi.binary.instance.videocodec" | ||
| 164 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_DEPENDS "addon-instance/VideoCodec.h" \ | ||
| 165 | "StreamCodec.h" \ | ||
| 166 | "StreamCrypto.h" | ||
| 167 | // clang-format on | ||
| 168 | |||
| 169 | //============================================================================== | ||
| 170 | /// | ||
| 171 | /// @ingroup cpp_kodi_addon_addonbase | ||
| 172 | /// The currently available instance types for Kodi add-ons | ||
| 173 | /// | ||
| 174 | /// \internal | ||
| 175 | /// @note For add of new types take a new number on end. To change | ||
| 176 | /// existing numbers can be make problems on already compiled add-ons. | ||
| 177 | /// \endinternal | ||
| 178 | /// | ||
| 179 | typedef enum ADDON_TYPE | ||
| 180 | { | ||
| 181 | /* addon global parts */ | ||
| 182 | ADDON_GLOBAL_MAIN = 0, | ||
| 183 | ADDON_GLOBAL_GUI = 1, | ||
| 184 | ADDON_GLOBAL_AUDIOENGINE = 2, | ||
| 185 | ADDON_GLOBAL_GENERAL = 3, | ||
| 186 | ADDON_GLOBAL_NETWORK = 4, | ||
| 187 | ADDON_GLOBAL_FILESYSTEM = 5, | ||
| 188 | ADDON_GLOBAL_TOOLS = 6, | ||
| 189 | // Last used global id, used in loops to check versions. | ||
| 190 | // Need to change if new global type becomes added! | ||
| 191 | ADDON_GLOBAL_MAX = 6, | ||
| 192 | |||
| 193 | /* addon type instances */ | ||
| 194 | |||
| 195 | /// Audio decoder instance, see \ref cpp_kodi_addon_audiodecoder "kodi::addon::CInstanceAudioDecoder" | ||
| 196 | ADDON_INSTANCE_AUDIODECODER = 102, | ||
| 197 | |||
| 198 | /// Audio encoder instance, see \ref cpp_kodi_addon_audioencoder "kodi::addon::CInstanceAudioEncoder" | ||
| 199 | ADDON_INSTANCE_AUDIOENCODER = 103, | ||
| 200 | |||
| 201 | /// Game instance, see \ref cpp_kodi_addon_game "kodi::addon::CInstanceGame" | ||
| 202 | ADDON_INSTANCE_GAME = 104, | ||
| 203 | |||
| 204 | /// Input stream instance, see \ref cpp_kodi_addon_inputstream "kodi::addon::CInstanceInputStream" | ||
| 205 | ADDON_INSTANCE_INPUTSTREAM = 105, | ||
| 206 | |||
| 207 | /// Peripheral instance, see \ref cpp_kodi_addon_peripheral "kodi::addon::CInstancePeripheral" | ||
| 208 | ADDON_INSTANCE_PERIPHERAL = 106, | ||
| 209 | |||
| 210 | /// Game instance, see \ref cpp_kodi_addon_pvr "kodi::addon::CInstancePVRClient" | ||
| 211 | ADDON_INSTANCE_PVR = 107, | ||
| 212 | |||
| 213 | /// PVR client instance, see \ref cpp_kodi_addon_screensaver "kodi::addon::CInstanceScreensaver" | ||
| 214 | ADDON_INSTANCE_SCREENSAVER = 108, | ||
| 215 | |||
| 216 | /// Music visualization instance, see \ref cpp_kodi_addon_visualization "kodi::addon::CInstanceVisualization" | ||
| 217 | ADDON_INSTANCE_VISUALIZATION = 109, | ||
| 218 | |||
| 219 | /// Virtual Filesystem (VFS) instance, see \ref cpp_kodi_addon_vfs "kodi::addon::CInstanceVFS" | ||
| 220 | ADDON_INSTANCE_VFS = 110, | ||
| 221 | |||
| 222 | /// Image Decoder instance, see \ref cpp_kodi_addon_imagedecoder "kodi::addon::CInstanceImageDecoder" | ||
| 223 | ADDON_INSTANCE_IMAGEDECODER = 111, | ||
| 224 | |||
| 225 | /// Video Decoder instance, see \ref cpp_kodi_addon_videocodec "kodi::addon::CInstanceVideoCodec" | ||
| 226 | ADDON_INSTANCE_VIDEOCODEC = 112, | ||
| 227 | } ADDON_TYPE; | ||
| 228 | //------------------------------------------------------------------------------ | ||
| 229 | |||
| 230 | #ifdef __cplusplus | ||
| 231 | extern "C" { | ||
| 232 | namespace kodi { | ||
| 233 | namespace addon { | ||
| 234 | #endif | ||
| 235 | |||
| 236 | /// | ||
| 237 | /// This is used from Kodi to get the active version of add-on parts. | ||
| 238 | /// It is compiled in add-on and also in Kodi itself, with this can be Kodi | ||
| 239 | /// compare the version from him with them on add-on. | ||
| 240 | /// | ||
| 241 | /// @param[in] type The with 'enum ADDON_TYPE' type to ask | ||
| 242 | /// @return version The current version of asked type | ||
| 243 | /// | ||
| 244 | inline const char* GetTypeVersion(int type) | ||
| 245 | { | ||
| 246 | /* | ||
| 247 | * #ifdef's below becomes set by cmake, no set by hand needed. | ||
| 248 | */ | ||
| 249 | switch (type) | ||
| 250 | { | ||
| 251 | /* addon global parts */ | ||
| 252 | case ADDON_GLOBAL_MAIN: | ||
| 253 | return ADDON_GLOBAL_VERSION_MAIN; | ||
| 254 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_GENERAL_USED) | ||
| 255 | case ADDON_GLOBAL_GENERAL: | ||
| 256 | return ADDON_GLOBAL_VERSION_GENERAL; | ||
| 257 | #endif | ||
| 258 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_GUI_USED) | ||
| 259 | case ADDON_GLOBAL_GUI: | ||
| 260 | return ADDON_GLOBAL_VERSION_GUI; | ||
| 261 | #endif | ||
| 262 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_AUDIOENGINE_USED) | ||
| 263 | case ADDON_GLOBAL_AUDIOENGINE: | ||
| 264 | return ADDON_GLOBAL_VERSION_AUDIOENGINE; | ||
| 265 | #endif | ||
| 266 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_FILESYSTEM_USED) | ||
| 267 | case ADDON_GLOBAL_FILESYSTEM: | ||
| 268 | return ADDON_GLOBAL_VERSION_FILESYSTEM; | ||
| 269 | #endif | ||
| 270 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_NETWORK_USED) | ||
| 271 | case ADDON_GLOBAL_NETWORK: | ||
| 272 | return ADDON_GLOBAL_VERSION_NETWORK; | ||
| 273 | #endif | ||
| 274 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_TOOLS_USED) | ||
| 275 | case ADDON_GLOBAL_TOOLS: | ||
| 276 | return ADDON_GLOBAL_VERSION_TOOLS; | ||
| 277 | #endif | ||
| 278 | |||
| 279 | /* addon type instances */ | ||
| 280 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_AUDIODECODER_USED) | ||
| 281 | case ADDON_INSTANCE_AUDIODECODER: | ||
| 282 | return ADDON_INSTANCE_VERSION_AUDIODECODER; | ||
| 283 | #endif | ||
| 284 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_AUDIOENCODER_USED) | ||
| 285 | case ADDON_INSTANCE_AUDIOENCODER: | ||
| 286 | return ADDON_INSTANCE_VERSION_AUDIOENCODER; | ||
| 287 | #endif | ||
| 288 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_GAME_USED) | ||
| 289 | case ADDON_INSTANCE_GAME: | ||
| 290 | return ADDON_INSTANCE_VERSION_GAME; | ||
| 291 | #endif | ||
| 292 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_IMAGEDECODER_USED) | ||
| 293 | case ADDON_INSTANCE_IMAGEDECODER: | ||
| 294 | return ADDON_INSTANCE_VERSION_IMAGEDECODER; | ||
| 295 | #endif | ||
| 296 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_INPUTSTREAM_USED) | ||
| 297 | case ADDON_INSTANCE_INPUTSTREAM: | ||
| 298 | return ADDON_INSTANCE_VERSION_INPUTSTREAM; | ||
| 299 | #endif | ||
| 300 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_PERIPHERAL_USED) | ||
| 301 | case ADDON_INSTANCE_PERIPHERAL: | ||
| 302 | return ADDON_INSTANCE_VERSION_PERIPHERAL; | ||
| 303 | #endif | ||
| 304 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_PVR_USED) | ||
| 305 | case ADDON_INSTANCE_PVR: | ||
| 306 | return ADDON_INSTANCE_VERSION_PVR; | ||
| 307 | #endif | ||
| 308 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_SCREENSAVER_USED) | ||
| 309 | case ADDON_INSTANCE_SCREENSAVER: | ||
| 310 | return ADDON_INSTANCE_VERSION_SCREENSAVER; | ||
| 311 | #endif | ||
| 312 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_VFS_USED) | ||
| 313 | case ADDON_INSTANCE_VFS: | ||
| 314 | return ADDON_INSTANCE_VERSION_VFS; | ||
| 315 | #endif | ||
| 316 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_VISUALIZATION_USED) | ||
| 317 | case ADDON_INSTANCE_VISUALIZATION: | ||
| 318 | return ADDON_INSTANCE_VERSION_VISUALIZATION; | ||
| 319 | #endif | ||
| 320 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_VIDEOCODEC_USED) | ||
| 321 | case ADDON_INSTANCE_VIDEOCODEC: | ||
| 322 | return ADDON_INSTANCE_VERSION_VIDEOCODEC; | ||
| 323 | #endif | ||
| 324 | } | ||
| 325 | return "0.0.0"; | ||
| 326 | } | ||
| 327 | |||
| 328 | /// | ||
| 329 | /// This is used from Kodi to get the minimum supported version of add-on parts. | ||
| 330 | /// It is compiled in add-on and also in Kodi itself, with this can be Kodi | ||
| 331 | /// compare the version from him with them on add-on. | ||
| 332 | /// | ||
| 333 | /// @param[in] type The with 'enum ADDON_TYPE' type to ask | ||
| 334 | /// @return version The minimum version of asked type | ||
| 335 | /// | ||
| 336 | inline const char* GetTypeMinVersion(int type) | ||
| 337 | { | ||
| 338 | switch (type) | ||
| 339 | { | ||
| 340 | /* addon global parts */ | ||
| 341 | case ADDON_GLOBAL_MAIN: | ||
| 342 | return ADDON_GLOBAL_VERSION_MAIN_MIN; | ||
| 343 | case ADDON_GLOBAL_GUI: | ||
| 344 | return ADDON_GLOBAL_VERSION_GUI_MIN; | ||
| 345 | case ADDON_GLOBAL_GENERAL: | ||
| 346 | return ADDON_GLOBAL_VERSION_GENERAL_MIN; | ||
| 347 | case ADDON_GLOBAL_AUDIOENGINE: | ||
| 348 | return ADDON_GLOBAL_VERSION_AUDIOENGINE_MIN; | ||
| 349 | case ADDON_GLOBAL_FILESYSTEM: | ||
| 350 | return ADDON_GLOBAL_VERSION_FILESYSTEM_MIN; | ||
| 351 | case ADDON_GLOBAL_NETWORK: | ||
| 352 | return ADDON_GLOBAL_VERSION_NETWORK_MIN; | ||
| 353 | case ADDON_GLOBAL_TOOLS: | ||
| 354 | return ADDON_GLOBAL_VERSION_TOOLS_MIN; | ||
| 355 | |||
| 356 | /* addon type instances */ | ||
| 357 | case ADDON_INSTANCE_AUDIODECODER: | ||
| 358 | return ADDON_INSTANCE_VERSION_AUDIODECODER_MIN; | ||
| 359 | case ADDON_INSTANCE_AUDIOENCODER: | ||
| 360 | return ADDON_INSTANCE_VERSION_AUDIOENCODER_MIN; | ||
| 361 | case ADDON_INSTANCE_GAME: | ||
| 362 | return ADDON_INSTANCE_VERSION_GAME_MIN; | ||
| 363 | case ADDON_INSTANCE_IMAGEDECODER: | ||
| 364 | return ADDON_INSTANCE_VERSION_IMAGEDECODER_MIN; | ||
| 365 | case ADDON_INSTANCE_INPUTSTREAM: | ||
| 366 | return ADDON_INSTANCE_VERSION_INPUTSTREAM_MIN; | ||
| 367 | case ADDON_INSTANCE_PERIPHERAL: | ||
| 368 | return ADDON_INSTANCE_VERSION_PERIPHERAL_MIN; | ||
| 369 | case ADDON_INSTANCE_PVR: | ||
| 370 | return ADDON_INSTANCE_VERSION_PVR_MIN; | ||
| 371 | case ADDON_INSTANCE_SCREENSAVER: | ||
| 372 | return ADDON_INSTANCE_VERSION_SCREENSAVER_MIN; | ||
| 373 | case ADDON_INSTANCE_VFS: | ||
| 374 | return ADDON_INSTANCE_VERSION_VFS_MIN; | ||
| 375 | case ADDON_INSTANCE_VISUALIZATION: | ||
| 376 | return ADDON_INSTANCE_VERSION_VISUALIZATION_MIN; | ||
| 377 | case ADDON_INSTANCE_VIDEOCODEC: | ||
| 378 | return ADDON_INSTANCE_VERSION_VIDEOCODEC_MIN; | ||
| 379 | } | ||
| 380 | return "0.0.0"; | ||
| 381 | } | ||
| 382 | |||
| 383 | /// | ||
| 384 | /// Function used internally on add-on and in Kodi itself to get name | ||
| 385 | /// about given type. | ||
| 386 | /// | ||
| 387 | /// @param[in] type The with 'enum ADDON_TYPE' defined type to ask | ||
| 388 | /// @return Name of the asked instance type | ||
| 389 | /// | ||
| 390 | inline const char* GetTypeName(int type) | ||
| 391 | { | ||
| 392 | switch (type) | ||
| 393 | { | ||
| 394 | /* addon global parts */ | ||
| 395 | case ADDON_GLOBAL_MAIN: | ||
| 396 | return "Addon"; | ||
| 397 | case ADDON_GLOBAL_GUI: | ||
| 398 | return "GUI"; | ||
| 399 | case ADDON_GLOBAL_GENERAL: | ||
| 400 | return "General"; | ||
| 401 | case ADDON_GLOBAL_AUDIOENGINE: | ||
| 402 | return "AudioEngine"; | ||
| 403 | case ADDON_GLOBAL_FILESYSTEM: | ||
| 404 | return "Filesystem"; | ||
| 405 | case ADDON_GLOBAL_NETWORK: | ||
| 406 | return "Network"; | ||
| 407 | case ADDON_GLOBAL_TOOLS: | ||
| 408 | return "Tools"; | ||
| 409 | |||
| 410 | /* addon type instances */ | ||
| 411 | case ADDON_INSTANCE_AUDIODECODER: | ||
| 412 | return "AudioDecoder"; | ||
| 413 | case ADDON_INSTANCE_AUDIOENCODER: | ||
| 414 | return "AudioEncoder"; | ||
| 415 | case ADDON_INSTANCE_GAME: | ||
| 416 | return "Game"; | ||
| 417 | case ADDON_INSTANCE_IMAGEDECODER: | ||
| 418 | return "ImageDecoder"; | ||
| 419 | case ADDON_INSTANCE_INPUTSTREAM: | ||
| 420 | return "Inputstream"; | ||
| 421 | case ADDON_INSTANCE_PERIPHERAL: | ||
| 422 | return "Peripheral"; | ||
| 423 | case ADDON_INSTANCE_PVR: | ||
| 424 | return "PVR"; | ||
| 425 | case ADDON_INSTANCE_SCREENSAVER: | ||
| 426 | return "ScreenSaver"; | ||
| 427 | case ADDON_INSTANCE_VISUALIZATION: | ||
| 428 | return "Visualization"; | ||
| 429 | case ADDON_INSTANCE_VIDEOCODEC: | ||
| 430 | return "VideoCodec"; | ||
| 431 | } | ||
| 432 | return "unknown"; | ||
| 433 | } | ||
| 434 | |||
| 435 | /// | ||
| 436 | /// Function used internally on add-on and in Kodi itself to get id number | ||
| 437 | /// about given type name. | ||
| 438 | /// | ||
| 439 | /// @param[in] name The type name string to ask | ||
| 440 | /// @return Id number of the asked instance type | ||
| 441 | /// | ||
| 442 | /// @warning String must be lower case here! | ||
| 443 | /// | ||
| 444 | inline int GetTypeId(const char* name) | ||
| 445 | { | ||
| 446 | if (name) | ||
| 447 | { | ||
| 448 | if (strcmp(name, "addon") == 0) | ||
| 449 | return ADDON_GLOBAL_MAIN; | ||
| 450 | else if (strcmp(name, "general") == 0) | ||
| 451 | return ADDON_GLOBAL_GENERAL; | ||
| 452 | else if (strcmp(name, "gui") == 0) | ||
| 453 | return ADDON_GLOBAL_GUI; | ||
| 454 | else if (strcmp(name, "audioengine") == 0) | ||
| 455 | return ADDON_GLOBAL_AUDIOENGINE; | ||
| 456 | else if (strcmp(name, "filesystem") == 0) | ||
| 457 | return ADDON_GLOBAL_FILESYSTEM; | ||
| 458 | else if (strcmp(name, "network") == 0) | ||
| 459 | return ADDON_GLOBAL_NETWORK; | ||
| 460 | else if (strcmp(name, "tools") == 0) | ||
| 461 | return ADDON_GLOBAL_TOOLS; | ||
| 462 | else if (strcmp(name, "audiodecoder") == 0) | ||
| 463 | return ADDON_INSTANCE_AUDIODECODER; | ||
| 464 | else if (strcmp(name, "audioencoder") == 0) | ||
| 465 | return ADDON_INSTANCE_AUDIOENCODER; | ||
| 466 | else if (strcmp(name, "game") == 0) | ||
| 467 | return ADDON_INSTANCE_GAME; | ||
| 468 | else if (strcmp(name, "imagedecoder") == 0) | ||
| 469 | return ADDON_INSTANCE_IMAGEDECODER; | ||
| 470 | else if (strcmp(name, "inputstream") == 0) | ||
| 471 | return ADDON_INSTANCE_INPUTSTREAM; | ||
| 472 | else if (strcmp(name, "peripheral") == 0) | ||
| 473 | return ADDON_INSTANCE_PERIPHERAL; | ||
| 474 | else if (strcmp(name, "pvr") == 0) | ||
| 475 | return ADDON_INSTANCE_PVR; | ||
| 476 | else if (strcmp(name, "screensaver") == 0) | ||
| 477 | return ADDON_INSTANCE_SCREENSAVER; | ||
| 478 | else if (strcmp(name, "vfs") == 0) | ||
| 479 | return ADDON_INSTANCE_VFS; | ||
| 480 | else if (strcmp(name, "visualization") == 0) | ||
| 481 | return ADDON_INSTANCE_VISUALIZATION; | ||
| 482 | else if (strcmp(name, "videocodec") == 0) | ||
| 483 | return ADDON_INSTANCE_VIDEOCODEC; | ||
| 484 | } | ||
| 485 | return -1; | ||
| 486 | } | ||
| 487 | |||
| 488 | #ifdef __cplusplus | ||
| 489 | } /* namespace addon */ | ||
| 490 | } /* namespace kodi */ | ||
| 491 | } /* extern "C" */ | ||
| 492 | #endif | ||
