diff options
Diffstat (limited to 'xbmc')
32 files changed, 4902 insertions, 151 deletions
diff --git a/xbmc/addons/addon-bindings.mk b/xbmc/addons/addon-bindings.mk index e7185a7..49978b7 100644 --- a/xbmc/addons/addon-bindings.mk +++ b/xbmc/addons/addon-bindings.mk | |||
| @@ -1,22 +1,31 @@ | |||
| 1 | BINDINGS =xbmc/addons/include/xbmc_addon_cpp_dll.h | 1 | BINDINGS =xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h |
| 2 | BINDINGS+=xbmc/addons/include/xbmc_addon_dll.h | 2 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h |
| 3 | BINDINGS+=xbmc/addons/include/xbmc_addon_types.h | 3 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h |
| 4 | BINDINGS+=xbmc/addons/include/xbmc_audioenc_dll.h | 4 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h |
| 5 | BINDINGS+=xbmc/addons/include/xbmc_audioenc_types.h | 5 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h |
| 6 | BINDINGS+=xbmc/addons/include/kodi_audiodec_dll.h | 6 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h |
| 7 | BINDINGS+=xbmc/addons/include/kodi_audiodec_types.h | 7 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h |
| 8 | BINDINGS+=xbmc/addons/include/xbmc_codec_types.h | 8 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h |
| 9 | BINDINGS+=xbmc/addons/include/xbmc_epg_types.h | 9 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h |
| 10 | BINDINGS+=xbmc/addons/include/xbmc_pvr_dll.h | 10 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h |
| 11 | BINDINGS+=xbmc/addons/include/xbmc_pvr_types.h | 11 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h |
| 12 | BINDINGS+=xbmc/addons/include/xbmc_scr_dll.h | 12 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h |
| 13 | BINDINGS+=xbmc/addons/include/xbmc_scr_types.h | 13 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h |
| 14 | BINDINGS+=xbmc/addons/include/xbmc_vis_dll.h | 14 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h |
| 15 | BINDINGS+=xbmc/addons/include/xbmc_vis_types.h | 15 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h |
| 16 | BINDINGS+=xbmc/addons/include/xbmc_stream_utils.hpp | 16 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h |
| 17 | BINDINGS+=addons/library.xbmc.addon/libXBMC_addon.h | 17 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h |
| 18 | BINDINGS+=addons/library.kodi.guilib/libKODI_guilib.h | 18 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h |
| 19 | BINDINGS+=addons/library.xbmc.pvr/libXBMC_pvr.h | 19 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h |
| 20 | BINDINGS+=addons/library.xbmc.codec/libXBMC_codec.h | 20 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h |
| 21 | BINDINGS+=xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h | 21 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_stream_utils.hpp |
| 22 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h | ||
| 23 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h | ||
| 24 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h | ||
| 25 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h | ||
| 26 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | ||
| 27 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h | ||
| 28 | BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h | ||
| 29 | BINDINGS+=xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h | ||
| 22 | BINDINGS+=xbmc/cores/AudioEngine/Utils/AEChannelData.h | 30 | BINDINGS+=xbmc/cores/AudioEngine/Utils/AEChannelData.h |
| 31 | BINDINGS+=xbmc/filesystem/IFileTypes.h | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h new file mode 100644 index 0000000..c1d8238 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h | |||
| @@ -0,0 +1,564 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2015 Team Kodi | ||
| 5 | * http://kodi.tv | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with Kodi; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | /*! | ||
| 24 | * @file kodi_adsp_dll.h | ||
| 25 | * @section sec1 Basic audio dsp addon interface description | ||
| 26 | * @author Team Kodi | ||
| 27 | * @date 10. May 2014 | ||
| 28 | * @version 0.1.5 | ||
| 29 | * | ||
| 30 | * @subsection sec1_1 General | ||
| 31 | * @li The basic support on the addon is supplied with the | ||
| 32 | * AE_DSP_ADDON_CAPABILITIES data which becomes asked over | ||
| 33 | * GetAddonCapabilities(...), further the addon must register his available | ||
| 34 | * modes on startup with the RegisterMode(...) callback function (see | ||
| 35 | * libKODI_adsp.h). If one of this two points is not set the addon becomes | ||
| 36 | * ignored for the chain step. | ||
| 37 | * | ||
| 38 | * @subsection sec1_2 Processing | ||
| 39 | * @li On start of new stream the addon becomes called with StreamCreate(...) | ||
| 40 | * to check about given values that it support it basically and can create | ||
| 41 | * his structure, if nothing is supported it can return AE_DSP_ERROR_IGNORE_ME. | ||
| 42 | * | ||
| 43 | * @li As next step StreamIsModeSupported(...) becomes called for every | ||
| 44 | * available and enabled modes, is separated due to more as one available mode | ||
| 45 | * on the addon is possible, if the mode is not supported it can also be return | ||
| 46 | * AE_DSP_ERROR_IGNORE_ME. | ||
| 47 | * - If mode is a resample mode and returns no error it becomes asked with | ||
| 48 | * InputResampleSampleRate(...) or OutputResampleSampleRate(...) (relevant | ||
| 49 | * to his type) about his given sample rate. | ||
| 50 | * - About the from user selected master processing mode the related addon | ||
| 51 | * becomes called now with MasterProcessSetMode(...) to handle it's | ||
| 52 | * selectionon the addon given by the own addon type identifier or by | ||
| 53 | * KODI's useddatabase id, also the currently used stream type (e.g. | ||
| 54 | * Music or Video) is send. | ||
| 55 | * - If the addon supports only one master mode it can ignore this function | ||
| 56 | * and return always AE_DSP_ERROR_NO_ERROR. | ||
| 57 | * - If the master mode is set the addon becomes asked about the from him | ||
| 58 | * given output channel layout related to up- or downmix modes, if | ||
| 59 | * nothing becomes changed on the layout it can return -1. | ||
| 60 | * - The MasterProcessSetMode(...) is also called if from user a another | ||
| 61 | * mode becomes selected. | ||
| 62 | * | ||
| 63 | * @li Then as last step shortly before the first process call becomes executed | ||
| 64 | * the addon is called one time with StreamInitialize(...) to inform that | ||
| 65 | * processing is started on the given settings. | ||
| 66 | * - This function becomes also called on all add-ons if the master process | ||
| 67 | * becomes changed. | ||
| 68 | * - Also every process after StreamInitialize on the addon mode becomes asked | ||
| 69 | * with _..._ProcessNeededSamplesize(...) about required memory size for the | ||
| 70 | * output of his data, if no other size is required it can return 0. | ||
| 71 | * | ||
| 72 | * @li From now the processing becomes handled for the different steps with | ||
| 73 | * _..._Process(...). | ||
| 74 | * - Further it becomes asked with _..._GetDelay(...) about his processing | ||
| 75 | * time as float value in seconds, needed for video and audio alignment. | ||
| 76 | * | ||
| 77 | * @li On the end of the processing if the source becomes stopped the | ||
| 78 | * StreamDestroy(...) function becomes called on all active processing add-ons. | ||
| 79 | * | ||
| 80 | * @note | ||
| 81 | * The StreamCreate(...) can be becomes called for a new stream before the | ||
| 82 | * previous was closed with StreamDestroy(...) ! To have a speed improve. | ||
| 83 | */ | ||
| 84 | |||
| 85 | #include "xbmc_addon_dll.h" | ||
| 86 | #include "kodi_adsp_types.h" | ||
| 87 | |||
| 88 | /*! | ||
| 89 | * Functions that the Audio DSP add-on must implement, but some can be empty. | ||
| 90 | * | ||
| 91 | * The 'remarks' field indicates which methods should be implemented, and which | ||
| 92 | * ones are optional. | ||
| 93 | */ | ||
| 94 | |||
| 95 | extern "C" | ||
| 96 | { | ||
| 97 | /*! @name Audio DSP add-on methods */ | ||
| 98 | //@{ | ||
| 99 | /*! | ||
| 100 | * Get the KODI_AE_DSP_API_VERSION that was used to compile this add-on. | ||
| 101 | * Used to check if this add-on is compatible with KODI. | ||
| 102 | * @return The KODI_AE_DSP_API_VERSION that was used to compile this add-on. | ||
| 103 | * @remarks Valid implementation required. | ||
| 104 | */ | ||
| 105 | const char* GetAudioDSPAPIVersion(void); | ||
| 106 | |||
| 107 | /*! | ||
| 108 | * Get the KODI_AE_DSP_MIN_API_VERSION that was used to compile this add-on. | ||
| 109 | * Used to check if this add-on is compatible with KODI. | ||
| 110 | * @return The KODI_AE_DSP_MIN_API_VERSION that was used to compile this add-on. | ||
| 111 | * @remarks Valid implementation required. | ||
| 112 | */ | ||
| 113 | const char* GetMinimumAudioDSPAPIVersion(void); | ||
| 114 | |||
| 115 | /*! | ||
| 116 | * @brief Get the KODI_GUI_API_VERSION that was used to compile this add-on. | ||
| 117 | * Used to check if this add-on is compatible with KODI. | ||
| 118 | * @return The KODI_GUI_API_VERSION that was used to compile this add-on. | ||
| 119 | * @remarks Valid implementation required. | ||
| 120 | */ | ||
| 121 | const char* GetGUIAPIVersion(void); | ||
| 122 | |||
| 123 | /*! | ||
| 124 | * @brief Get the KODI_GUI_MIN_API_VERSION that was used to compile this | ||
| 125 | * add-on. | ||
| 126 | * Used to check if this add-on is compatible with KODI. | ||
| 127 | * @return The KODI_GUI_MIN_API_VERSION that was used to compile this add-on. | ||
| 128 | * @remarks Valid implementation required. | ||
| 129 | */ | ||
| 130 | const char* GetMinimumGUIAPIVersion(void); | ||
| 131 | |||
| 132 | /*! | ||
| 133 | * @brief Get the list of features that this add-on provides. | ||
| 134 | * Called by KODI to query the add-ons capabilities. | ||
| 135 | * Used to check which options should be presented in the DSP, which methods | ||
| 136 | * to call, etc. | ||
| 137 | * All capabilities that the add-on supports should be set to true. | ||
| 138 | * @param pCapabilities The add-ons capabilities. | ||
| 139 | * @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully. | ||
| 140 | * @remarks Valid implementation required. | ||
| 141 | */ | ||
| 142 | AE_DSP_ERROR GetAddonCapabilities(AE_DSP_ADDON_CAPABILITIES *pCapabilities); | ||
| 143 | |||
| 144 | /*! | ||
| 145 | * @return The name reported by the back end that will be displayed in the | ||
| 146 | * UI. | ||
| 147 | * @remarks Valid implementation required. | ||
| 148 | */ | ||
| 149 | const char* GetDSPName(void); | ||
| 150 | |||
| 151 | /*! | ||
| 152 | * @return The version string reported by the back end that will be displayed | ||
| 153 | * in the UI. | ||
| 154 | * @remarks Valid implementation required. | ||
| 155 | */ | ||
| 156 | const char* GetDSPVersion(void); | ||
| 157 | |||
| 158 | /*! | ||
| 159 | * @brief Call one of the menu hooks (if supported). | ||
| 160 | * Supported AE_DSP_MENUHOOK instances have to be added in ADDON_Create(), | ||
| 161 | * by calling AddMenuHook() on the callback. | ||
| 162 | * @param menuhook The hook to call. | ||
| 163 | * @param item The selected item for which the hook was called. | ||
| 164 | * @return AE_DSP_ERROR_NO_ERROR if the hook was called successfully. | ||
| 165 | * @remarks Optional. Return AE_DSP_ERROR_NOT_IMPLEMENTED if this add-on | ||
| 166 | * won't provide this function. | ||
| 167 | */ | ||
| 168 | AE_DSP_ERROR CallMenuHook(const AE_DSP_MENUHOOK& menuhook, const AE_DSP_MENUHOOK_DATA &item); | ||
| 169 | //@} | ||
| 170 | |||
| 171 | /** @name DSP processing control, used to open and close a stream | ||
| 172 | * @remarks Valid implementation required. | ||
| 173 | */ | ||
| 174 | //@{ | ||
| 175 | /*! | ||
| 176 | * @brief Set up Audio DSP with selected audio settings (use the basic | ||
| 177 | * present audio stream data format). | ||
| 178 | * Used to detect available add-ons for present stream, as example stereo | ||
| 179 | * surround upmix not needed on 5.1 audio stream. | ||
| 180 | * @param addonSettings The add-ons audio settings. | ||
| 181 | * @param pProperties The properties of the currently playing stream. | ||
| 182 | * @param handle On this becomes addon informated about stream id and can set function addresses which need on calls | ||
| 183 | * @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully | ||
| 184 | * and data can be performed. AE_DSP_ERROR_IGNORE_ME if format is not | ||
| 185 | * supported, but without fault. | ||
| 186 | * @remarks Valid implementation required. | ||
| 187 | */ | ||
| 188 | AE_DSP_ERROR StreamCreate(const AE_DSP_SETTINGS *addonSettings, const AE_DSP_STREAM_PROPERTIES* pProperties, ADDON_HANDLE handle); | ||
| 189 | |||
| 190 | /*! | ||
| 191 | * Remove the selected id from currently used DSP processes | ||
| 192 | * @param handle identification data for stream | ||
| 193 | * @return AE_DSP_ERROR_NO_ERROR if the becomes found and removed | ||
| 194 | * @remarks Valid implementation required. | ||
| 195 | */ | ||
| 196 | AE_DSP_ERROR StreamDestroy(const ADDON_HANDLE handle); | ||
| 197 | |||
| 198 | /*! | ||
| 199 | * @brief Ask the add-on about a requested processing mode that it is | ||
| 200 | * supported on the current stream. Is called about every add-on mode after | ||
| 201 | * successed StreamCreate. | ||
| 202 | * @param handle identification data for stream | ||
| 203 | * @param type The processing mode type, see AE_DSP_MODE_TYPE for definitions | ||
| 204 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 205 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 206 | * RegisterMode callback, | ||
| 207 | * @param unique_db_mode_id The Mode unique id generated from dsp database. | ||
| 208 | * @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully | ||
| 209 | * or if the stream is not supported the add-on must return | ||
| 210 | * AE_DSP_ERROR_IGNORE_ME. | ||
| 211 | * @remarks Valid implementation required. | ||
| 212 | */ | ||
| 213 | AE_DSP_ERROR StreamIsModeSupported(const ADDON_HANDLE handle, AE_DSP_MODE_TYPE type, unsigned int mode_id, int unique_db_mode_id); | ||
| 214 | |||
| 215 | /*! | ||
| 216 | * @brief Set up Audio DSP with selected audio settings (detected on data of | ||
| 217 | * first present audio packet) | ||
| 218 | * @param addonSettings The add-ons audio settings. | ||
| 219 | * @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully. | ||
| 220 | * @remarks Valid implementation required. | ||
| 221 | */ | ||
| 222 | AE_DSP_ERROR StreamInitialize(const ADDON_HANDLE handle, const AE_DSP_SETTINGS *addonSettings); | ||
| 223 | //@} | ||
| 224 | |||
| 225 | /** @name DSP input processing | ||
| 226 | * @remarks Only used by KODI if bSupportsInputProcess is set to true. | ||
| 227 | */ | ||
| 228 | //@{ | ||
| 229 | /*! | ||
| 230 | * @brief DSP input processing | ||
| 231 | * Can be used to have unchanged stream.. | ||
| 232 | * All DSP add-ons allowed to-do this. | ||
| 233 | * @param handle identification data for stream | ||
| 234 | * @param array_in Pointer to data memory | ||
| 235 | * @param samples Amount of samples inside array_in | ||
| 236 | * @return true if work was OK | ||
| 237 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 238 | * GetAddonCapabilities | ||
| 239 | */ | ||
| 240 | bool InputProcess(const ADDON_HANDLE handle, const float **array_in, unsigned int samples); | ||
| 241 | //@} | ||
| 242 | |||
| 243 | /** @name DSP pre-resampling | ||
| 244 | * @remarks Only used by KODI if bSupportsInputResample is set to true. | ||
| 245 | */ | ||
| 246 | //@{ | ||
| 247 | /*! | ||
| 248 | * @brief If the add-on operate with buffered arrays and the output size can | ||
| 249 | * be higher as the input it becomes asked about needed size before any | ||
| 250 | * InputResampleProcess call. | ||
| 251 | * @param handle identification data for stream | ||
| 252 | * @return The needed size of output array or 0 if no changes within it | ||
| 253 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 254 | * GetAddonCapabilities | ||
| 255 | */ | ||
| 256 | unsigned int InputResampleProcessNeededSamplesize(const ADDON_HANDLE handle); | ||
| 257 | |||
| 258 | /*! | ||
| 259 | * @brief DSP re sample processing before master. | ||
| 260 | * Here a high quality resample can be performed. | ||
| 261 | * Only one DSP add-on is allowed to-do this! | ||
| 262 | * @param handle identification data for stream | ||
| 263 | * @param array_in Pointer to input data memory | ||
| 264 | * @param array_out Pointer to output data memory | ||
| 265 | * @param samples Amount of samples inside array_in | ||
| 266 | * @return Amount of samples processed | ||
| 267 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 268 | * GetAddonCapabilities | ||
| 269 | */ | ||
| 270 | unsigned int InputResampleProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples); | ||
| 271 | |||
| 272 | /*! | ||
| 273 | * @brief Returns the re-sampling generated new sample rate used before the | ||
| 274 | * master process | ||
| 275 | * @param handle identification data for stream | ||
| 276 | * @return The new sample rate | ||
| 277 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 278 | * GetAddonCapabilities | ||
| 279 | */ | ||
| 280 | int InputResampleSampleRate(const ADDON_HANDLE handle); | ||
| 281 | |||
| 282 | /*! | ||
| 283 | * @brief Returns the time in seconds that it will take | ||
| 284 | * for the next added packet to be returned to KODI. | ||
| 285 | * @param handle identification data for stream | ||
| 286 | * @return the delay in seconds | ||
| 287 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 288 | * GetAddonCapabilities | ||
| 289 | */ | ||
| 290 | float InputResampleGetDelay(const ADDON_HANDLE handle); | ||
| 291 | //@} | ||
| 292 | |||
| 293 | /** @name DSP Pre processing | ||
| 294 | * @remarks Only used by KODI if bSupportsPreProcess is set to true. | ||
| 295 | */ | ||
| 296 | //@{ | ||
| 297 | /*! | ||
| 298 | * @brief If the addon operate with buffered arrays and the output size can | ||
| 299 | * be higher as the input it becomes asked about needed size before any | ||
| 300 | * PreProcess call. | ||
| 301 | * @param handle identification data for stream | ||
| 302 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 303 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 304 | * RegisterMode callback and can be defined from add-on as a structure | ||
| 305 | * pointer or anything else what is needed to find it. | ||
| 306 | * @return The needed size of output array or 0 if no changes within it | ||
| 307 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 308 | * GetAddonCapabilities | ||
| 309 | */ | ||
| 310 | unsigned int PreProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id); | ||
| 311 | |||
| 312 | /*! | ||
| 313 | * @brief Returns the time in seconds that it will take | ||
| 314 | * for the next added packet to be returned to KODI. | ||
| 315 | * @param handle identification data for stream | ||
| 316 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 317 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 318 | * RegisterMode callback and can be defined from add-on as a structure | ||
| 319 | * pointer or anything else what is needed to find it. | ||
| 320 | * @return the delay in seconds | ||
| 321 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 322 | * GetAddonCapabilities | ||
| 323 | */ | ||
| 324 | float PreProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id); | ||
| 325 | |||
| 326 | /*! | ||
| 327 | * @brief DSP preprocessing | ||
| 328 | * All DSP add-ons allowed to-do this. | ||
| 329 | * @param handle identification data for stream | ||
| 330 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 331 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 332 | * RegisterMode callback and can be defined from add-on as a structure | ||
| 333 | * pointer or anything else what is needed to find it. | ||
| 334 | * @param array_in Pointer to input data memory | ||
| 335 | * @param array_out Pointer to output data memory | ||
| 336 | * @param samples Amount of samples inside array_in | ||
| 337 | * @return Amount of samples processed | ||
| 338 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 339 | * GetAddonCapabilities | ||
| 340 | */ | ||
| 341 | unsigned int PreProcess(const ADDON_HANDLE handle, unsigned int mode_id, float **array_in, float **array_out, unsigned int samples); | ||
| 342 | //@} | ||
| 343 | |||
| 344 | /** @name DSP Master processing | ||
| 345 | * @remarks Only used by KODI if bSupportsMasterProcess is set to true. | ||
| 346 | */ | ||
| 347 | //@{ | ||
| 348 | /*! | ||
| 349 | * @brief Set the active master process mode | ||
| 350 | * @param handle identification data for stream | ||
| 351 | * @param type Requested stream type for the selected master mode | ||
| 352 | * @param mode_id The Mode identifier. | ||
| 353 | * @param unique_db_mode_id The Mode unique id generated from DSP database. | ||
| 354 | * @return AE_DSP_ERROR_NO_ERROR if the setup was successful | ||
| 355 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 356 | * GetAddonCapabilities | ||
| 357 | */ | ||
| 358 | AE_DSP_ERROR MasterProcessSetMode(const ADDON_HANDLE handle, AE_DSP_STREAMTYPE type, unsigned int mode_id, int unique_db_mode_id); | ||
| 359 | |||
| 360 | /*! | ||
| 361 | * @brief If the add-on operate with buffered arrays and the output size can | ||
| 362 | * be higher as the input it becomes asked about needed size before any | ||
| 363 | * MasterProcess call. | ||
| 364 | * @param handle identification data for stream | ||
| 365 | * @return The needed size of output array or 0 if no changes within it | ||
| 366 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 367 | * GetAddonCapabilities | ||
| 368 | */ | ||
| 369 | unsigned int MasterProcessNeededSamplesize(const ADDON_HANDLE handle); | ||
| 370 | |||
| 371 | /*! | ||
| 372 | * @brief Returns the time in seconds that it will take | ||
| 373 | * for the next added packet to be returned to KODI. | ||
| 374 | * @param handle identification data for stream | ||
| 375 | * @return the delay in seconds | ||
| 376 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 377 | * GetAddonCapabilities | ||
| 378 | */ | ||
| 379 | float MasterProcessGetDelay(const ADDON_HANDLE handle); | ||
| 380 | |||
| 381 | /*! | ||
| 382 | * @brief Returns the from selected master mode performed channel alignment | ||
| 383 | * @param handle identification data for stream | ||
| 384 | * @retval out_channel_present_flags the exact channel present flags after | ||
| 385 | * performed up-/downmix | ||
| 386 | * @return the amount channels | ||
| 387 | * @remarks Optional. Must be used and set if a channel up- or downmix is | ||
| 388 | * processed from the active master mode | ||
| 389 | */ | ||
| 390 | int MasterProcessGetOutChannels(const ADDON_HANDLE handle, unsigned long &out_channel_present_flags); | ||
| 391 | |||
| 392 | /*! | ||
| 393 | * @brief Master processing becomes performed with it | ||
| 394 | * Here a channel up-mix/down-mix for stereo surround sound can be performed | ||
| 395 | * Only one DSP add-on is allowed to-do this! | ||
| 396 | * @param handle identification data for stream | ||
| 397 | * @param array_in Pointer to input data memory | ||
| 398 | * @param array_out Pointer to output data memory | ||
| 399 | * @param samples Amount of samples inside array_in | ||
| 400 | * @return Amount of samples processed | ||
| 401 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 402 | * GetAddonCapabilities | ||
| 403 | */ | ||
| 404 | unsigned int MasterProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples); | ||
| 405 | |||
| 406 | /*! | ||
| 407 | * Used to get a information string about the processed work to show on skin | ||
| 408 | * @return A string to show | ||
| 409 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 410 | * GetAddonCapabilities | ||
| 411 | */ | ||
| 412 | const char *MasterProcessGetStreamInfoString(const ADDON_HANDLE handle); | ||
| 413 | //@} | ||
| 414 | |||
| 415 | /** @name DSP Post processing | ||
| 416 | * @remarks Only used by KODI if bSupportsPostProcess is set to true. | ||
| 417 | */ | ||
| 418 | //@{ | ||
| 419 | /*! | ||
| 420 | * If the add-on operate with buffered arrays and the output size can be | ||
| 421 | * higher as the input it becomes asked about needed size before any | ||
| 422 | * PostProcess call. | ||
| 423 | * @param handle identification data for stream | ||
| 424 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 425 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 426 | * RegisterMode callback, and can be defined from add-on as a structure | ||
| 427 | * pointer or anything else what is needed to find it. | ||
| 428 | * @return The needed size of output array or 0 if no changes within it | ||
| 429 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 430 | * GetAddonCapabilities | ||
| 431 | */ | ||
| 432 | unsigned int PostProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id); | ||
| 433 | |||
| 434 | /*! | ||
| 435 | * Returns the time in seconds that it will take | ||
| 436 | * for the next added packet to be returned to KODI. | ||
| 437 | * @param handle identification data for stream | ||
| 438 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 439 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 440 | * RegisterMode callback, and can be defined from add-on as a structure | ||
| 441 | * pointer or anything else what is needed to find it. | ||
| 442 | * @return the delay in seconds | ||
| 443 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 444 | * GetAddonCapabilities | ||
| 445 | */ | ||
| 446 | float PostProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id); | ||
| 447 | |||
| 448 | /*! | ||
| 449 | * @brief DSP post processing | ||
| 450 | * On the post processing can be things performed with additional channel | ||
| 451 | * upmix like 6.1 to 7.1 | ||
| 452 | * or frequency/volume corrections, speaker distance handling, equalizer... . | ||
| 453 | * All DSP add-ons allowed to-do this. | ||
| 454 | * @param handle identification data for stream | ||
| 455 | * @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 456 | * is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 457 | * RegisterMode callback, and can be defined from add-on as a structure | ||
| 458 | * pointer or anything else what is needed to find it. | ||
| 459 | * @param array_in Pointer to input data memory | ||
| 460 | * @param array_out Pointer to output data memory | ||
| 461 | * @param samples Amount of samples inside array_in | ||
| 462 | * @return Amount of samples processed | ||
| 463 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 464 | * GetAddonCapabilities | ||
| 465 | */ | ||
| 466 | unsigned int PostProcess(const ADDON_HANDLE handle, unsigned int mode_id, float **array_in, float **array_out, unsigned int samples); | ||
| 467 | //@} | ||
| 468 | |||
| 469 | /** @name DSP Post re-sampling | ||
| 470 | * @remarks Only used by KODI if bSupportsOutputResample is set to true. | ||
| 471 | */ | ||
| 472 | //@{ | ||
| 473 | /*! | ||
| 474 | * @brief If the add-on operate with buffered arrays and the output size | ||
| 475 | * can be higher as the input | ||
| 476 | * it becomes asked about needed size before any OutputResampleProcess call. | ||
| 477 | * @param handle identification data for stream | ||
| 478 | * @return The needed size of output array or 0 if no changes within it | ||
| 479 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 480 | * GetAddonCapabilities | ||
| 481 | */ | ||
| 482 | unsigned int OutputResampleProcessNeededSamplesize(const ADDON_HANDLE handle); | ||
| 483 | |||
| 484 | /*! | ||
| 485 | * @brief Re-sampling after master processing becomes performed with it if | ||
| 486 | * needed, only | ||
| 487 | * one add-on can perform it. | ||
| 488 | * @param handle identification data for stream | ||
| 489 | * @param array_in Pointer to input data memory | ||
| 490 | * @param array_out Pointer to output data memory | ||
| 491 | * @param samples Amount of samples inside array_in | ||
| 492 | * @return Amount of samples processed | ||
| 493 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 494 | * GetAddonCapabilities | ||
| 495 | */ | ||
| 496 | unsigned int OutputResampleProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples); | ||
| 497 | |||
| 498 | /*! | ||
| 499 | * @brief Returns the re-sampling generated new sample rate used after the | ||
| 500 | * master process. | ||
| 501 | * @param handle identification data for stream | ||
| 502 | * @return The new sample rate | ||
| 503 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 504 | * GetAddonCapabilities | ||
| 505 | */ | ||
| 506 | int OutputResampleSampleRate(const ADDON_HANDLE handle); | ||
| 507 | |||
| 508 | /*! | ||
| 509 | * @brief Returns the time in seconds that it will take for the next added | ||
| 510 | * packet to be returned to KODI. | ||
| 511 | * @param handle identification data for stream | ||
| 512 | * @return the delay in seconds | ||
| 513 | * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 514 | * GetAddonCapabilities | ||
| 515 | */ | ||
| 516 | float OutputResampleGetDelay(const ADDON_HANDLE handle); | ||
| 517 | //@} | ||
| 518 | |||
| 519 | // function to export the above structure to KODI | ||
| 520 | void __declspec(dllexport) get_addon(struct AudioDSP* pDSP) | ||
| 521 | { | ||
| 522 | pDSP->GetAudioDSPAPIVersion = GetAudioDSPAPIVersion; | ||
| 523 | pDSP->GetMinimumAudioDSPAPIVersion = GetMinimumAudioDSPAPIVersion; | ||
| 524 | pDSP->GetGUIAPIVersion = GetGUIAPIVersion; | ||
| 525 | pDSP->GetMinimumGUIAPIVersion = GetMinimumGUIAPIVersion; | ||
| 526 | pDSP->GetAddonCapabilities = GetAddonCapabilities; | ||
| 527 | pDSP->GetDSPName = GetDSPName; | ||
| 528 | pDSP->GetDSPVersion = GetDSPVersion; | ||
| 529 | pDSP->MenuHook = CallMenuHook; | ||
| 530 | |||
| 531 | pDSP->StreamCreate = StreamCreate; | ||
| 532 | pDSP->StreamDestroy = StreamDestroy; | ||
| 533 | pDSP->StreamIsModeSupported = StreamIsModeSupported; | ||
| 534 | pDSP->StreamInitialize = StreamInitialize; | ||
| 535 | |||
| 536 | pDSP->InputProcess = InputProcess; | ||
| 537 | |||
| 538 | pDSP->InputResampleProcessNeededSamplesize = InputResampleProcessNeededSamplesize; | ||
| 539 | pDSP->InputResampleProcess = InputResampleProcess; | ||
| 540 | pDSP->InputResampleGetDelay = InputResampleGetDelay; | ||
| 541 | pDSP->InputResampleSampleRate = InputResampleSampleRate; | ||
| 542 | |||
| 543 | pDSP->PreProcessNeededSamplesize = PreProcessNeededSamplesize; | ||
| 544 | pDSP->PreProcessGetDelay = PreProcessGetDelay; | ||
| 545 | pDSP->PreProcess = PreProcess; | ||
| 546 | |||
| 547 | pDSP->MasterProcessSetMode = MasterProcessSetMode; | ||
| 548 | pDSP->MasterProcessNeededSamplesize = MasterProcessNeededSamplesize; | ||
| 549 | pDSP->MasterProcessGetDelay = MasterProcessGetDelay; | ||
| 550 | pDSP->MasterProcessGetOutChannels = MasterProcessGetOutChannels; | ||
| 551 | pDSP->MasterProcess = MasterProcess; | ||
| 552 | pDSP->MasterProcessGetStreamInfoString = MasterProcessGetStreamInfoString; | ||
| 553 | |||
| 554 | pDSP->PostProcessNeededSamplesize = PostProcessNeededSamplesize; | ||
| 555 | pDSP->PostProcessGetDelay = PostProcessGetDelay; | ||
| 556 | pDSP->PostProcess = PostProcess; | ||
| 557 | |||
| 558 | pDSP->OutputResampleProcessNeededSamplesize = OutputResampleProcessNeededSamplesize; | ||
| 559 | pDSP->OutputResampleProcess = OutputResampleProcess; | ||
| 560 | pDSP->OutputResampleSampleRate = OutputResampleSampleRate; | ||
| 561 | pDSP->OutputResampleGetDelay = OutputResampleGetDelay; | ||
| 562 | }; | ||
| 563 | }; | ||
| 564 | |||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h new file mode 100644 index 0000000..6e492c8 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h | |||
| @@ -0,0 +1,524 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2015 Team Kodi | ||
| 5 | * http://kodi.tv | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with Kodi; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | /*! | ||
| 24 | * Common data structures shared between KODI and KODI's audio DSP add-ons | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifdef TARGET_WINDOWS | ||
| 28 | #include <windows.h> | ||
| 29 | #else | ||
| 30 | #ifndef __cdecl | ||
| 31 | #define __cdecl | ||
| 32 | #endif | ||
| 33 | #ifndef __declspec | ||
| 34 | #define __declspec(X) | ||
| 35 | #endif | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #include <cstddef> | ||
| 39 | |||
| 40 | #include "xbmc_addon_types.h" | ||
| 41 | #include "xbmc_codec_types.h" | ||
| 42 | |||
| 43 | #undef ATTRIBUTE_PACKED | ||
| 44 | #undef PRAGMA_PACK_BEGIN | ||
| 45 | #undef PRAGMA_PACK_END | ||
| 46 | |||
| 47 | #if defined(__GNUC__) | ||
| 48 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | ||
| 49 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) | ||
| 50 | #define PRAGMA_PACK 0 | ||
| 51 | #endif | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #if !defined(ATTRIBUTE_PACKED) | ||
| 55 | #define ATTRIBUTE_PACKED | ||
| 56 | #define PRAGMA_PACK 1 | ||
| 57 | #endif | ||
| 58 | |||
| 59 | #define AE_DSP_ADDON_STRING_LENGTH 1024 | ||
| 60 | |||
| 61 | #define AE_DSP_STREAM_MAX_STREAMS 8 | ||
| 62 | #define AE_DSP_STREAM_MAX_MODES 32 | ||
| 63 | |||
| 64 | /* current Audio DSP API version */ | ||
| 65 | #define KODI_AE_DSP_API_VERSION "0.1.8" | ||
| 66 | |||
| 67 | /* min. Audio DSP API version */ | ||
| 68 | #define KODI_AE_DSP_MIN_API_VERSION "0.1.8" | ||
| 69 | |||
| 70 | #ifdef __cplusplus | ||
| 71 | extern "C" { | ||
| 72 | #endif | ||
| 73 | |||
| 74 | typedef unsigned int AE_DSP_STREAM_ID; | ||
| 75 | |||
| 76 | /*! | ||
| 77 | * @brief Audio DSP add-on error codes | ||
| 78 | */ | ||
| 79 | typedef enum | ||
| 80 | { | ||
| 81 | AE_DSP_ERROR_NO_ERROR = 0, /*!< @brief no error occurred */ | ||
| 82 | AE_DSP_ERROR_UNKNOWN = -1, /*!< @brief an unknown error occurred */ | ||
| 83 | AE_DSP_ERROR_IGNORE_ME = -2, /*!< @brief the used input stream can not processed and add-on want to ignore */ | ||
| 84 | AE_DSP_ERROR_NOT_IMPLEMENTED = -3, /*!< @brief the method that KODI called is not implemented by the add-on */ | ||
| 85 | AE_DSP_ERROR_REJECTED = -4, /*!< @brief the command was rejected by the DSP */ | ||
| 86 | AE_DSP_ERROR_INVALID_PARAMETERS = -5, /*!< @brief the parameters of the method that was called are invalid for this operation */ | ||
| 87 | AE_DSP_ERROR_INVALID_SAMPLERATE = -6, /*!< @brief the processed samplerate is not supported */ | ||
| 88 | AE_DSP_ERROR_INVALID_IN_CHANNELS = -7, /*!< @brief the processed input channel format is not supported */ | ||
| 89 | AE_DSP_ERROR_INVALID_OUT_CHANNELS = -8, /*!< @brief the processed output channel format is not supported */ | ||
| 90 | AE_DSP_ERROR_FAILED = -9, /*!< @brief the command failed */ | ||
| 91 | } AE_DSP_ERROR; | ||
| 92 | |||
| 93 | /*! | ||
| 94 | * @brief The possible DSP channels (used as pointer inside arrays) | ||
| 95 | */ | ||
| 96 | typedef enum | ||
| 97 | { | ||
| 98 | AE_DSP_CH_INVALID = -1, | ||
| 99 | AE_DSP_CH_FL = 0, | ||
| 100 | AE_DSP_CH_FR, | ||
| 101 | AE_DSP_CH_FC, | ||
| 102 | AE_DSP_CH_LFE, | ||
| 103 | AE_DSP_CH_BL, | ||
| 104 | AE_DSP_CH_BR, | ||
| 105 | AE_DSP_CH_FLOC, | ||
| 106 | AE_DSP_CH_FROC, | ||
| 107 | AE_DSP_CH_BC, | ||
| 108 | AE_DSP_CH_SL, | ||
| 109 | AE_DSP_CH_SR, | ||
| 110 | AE_DSP_CH_TFL, | ||
| 111 | AE_DSP_CH_TFR, | ||
| 112 | AE_DSP_CH_TFC, | ||
| 113 | AE_DSP_CH_TC, | ||
| 114 | AE_DSP_CH_TBL, | ||
| 115 | AE_DSP_CH_TBR, | ||
| 116 | AE_DSP_CH_TBC, | ||
| 117 | AE_DSP_CH_BLOC, | ||
| 118 | AE_DSP_CH_BROC, | ||
| 119 | |||
| 120 | AE_DSP_CH_MAX | ||
| 121 | } AE_DSP_CHANNEL; | ||
| 122 | |||
| 123 | /*! | ||
| 124 | * @brief Present channel flags | ||
| 125 | */ | ||
| 126 | typedef enum | ||
| 127 | { | ||
| 128 | AE_DSP_PRSNT_CH_UNDEFINED = 0, | ||
| 129 | AE_DSP_PRSNT_CH_FL = 1<<0, | ||
| 130 | AE_DSP_PRSNT_CH_FR = 1<<1, | ||
| 131 | AE_DSP_PRSNT_CH_FC = 1<<2, | ||
| 132 | AE_DSP_PRSNT_CH_LFE = 1<<3, | ||
| 133 | AE_DSP_PRSNT_CH_BL = 1<<4, | ||
| 134 | AE_DSP_PRSNT_CH_BR = 1<<5, | ||
| 135 | AE_DSP_PRSNT_CH_FLOC = 1<<6, | ||
| 136 | AE_DSP_PRSNT_CH_FROC = 1<<7, | ||
| 137 | AE_DSP_PRSNT_CH_BC = 1<<8, | ||
| 138 | AE_DSP_PRSNT_CH_SL = 1<<9, | ||
| 139 | AE_DSP_PRSNT_CH_SR = 1<<10, | ||
| 140 | AE_DSP_PRSNT_CH_TFL = 1<<11, | ||
| 141 | AE_DSP_PRSNT_CH_TFR = 1<<12, | ||
| 142 | AE_DSP_PRSNT_CH_TFC = 1<<13, | ||
| 143 | AE_DSP_PRSNT_CH_TC = 1<<14, | ||
| 144 | AE_DSP_PRSNT_CH_TBL = 1<<15, | ||
| 145 | AE_DSP_PRSNT_CH_TBR = 1<<16, | ||
| 146 | AE_DSP_PRSNT_CH_TBC = 1<<17, | ||
| 147 | AE_DSP_PRSNT_CH_BLOC = 1<<18, | ||
| 148 | AE_DSP_PRSNT_CH_BROC = 1<<19 | ||
| 149 | } AE_DSP_CHANNEL_PRESENT; | ||
| 150 | |||
| 151 | /** | ||
| 152 | * @brief The various stream type formats | ||
| 153 | * Used for audio DSP processing to know input audio type | ||
| 154 | */ | ||
| 155 | typedef enum | ||
| 156 | { | ||
| 157 | AE_DSP_ASTREAM_INVALID = -1, | ||
| 158 | AE_DSP_ASTREAM_BASIC = 0, | ||
| 159 | AE_DSP_ASTREAM_MUSIC, | ||
| 160 | AE_DSP_ASTREAM_MOVIE, | ||
| 161 | AE_DSP_ASTREAM_GAME, | ||
| 162 | AE_DSP_ASTREAM_APP, | ||
| 163 | AE_DSP_ASTREAM_PHONE, | ||
| 164 | AE_DSP_ASTREAM_MESSAGE, | ||
| 165 | |||
| 166 | AE_DSP_ASTREAM_AUTO, | ||
| 167 | AE_DSP_ASTREAM_MAX | ||
| 168 | } AE_DSP_STREAMTYPE; | ||
| 169 | |||
| 170 | /*! | ||
| 171 | * @brief Add-ons supported audio stream type flags | ||
| 172 | * used on master mode information on AE_DSP_MODES to know | ||
| 173 | * on which audio stream the master mode is supported | ||
| 174 | */ | ||
| 175 | typedef enum | ||
| 176 | { | ||
| 177 | AE_DSP_PRSNT_ASTREAM_BASIC = 1<<0, | ||
| 178 | AE_DSP_PRSNT_ASTREAM_MUSIC = 1<<1, | ||
| 179 | AE_DSP_PRSNT_ASTREAM_MOVIE = 1<<2, | ||
| 180 | AE_DSP_PRSNT_ASTREAM_GAME = 1<<3, | ||
| 181 | AE_DSP_PRSNT_ASTREAM_APP = 1<<4, | ||
| 182 | AE_DSP_PRSNT_ASTREAM_MESSAGE = 1<<5, | ||
| 183 | AE_DSP_PRSNT_ASTREAM_PHONE = 1<<6, | ||
| 184 | } AE_DSP_ASTREAM_PRESENT; | ||
| 185 | |||
| 186 | /** | ||
| 187 | * @brief The various base type formats | ||
| 188 | * Used for audio DSP processing to know input audio source | ||
| 189 | */ | ||
| 190 | typedef enum | ||
| 191 | { | ||
| 192 | AE_DSP_ABASE_INVALID = -1, | ||
| 193 | AE_DSP_ABASE_STEREO = 0, | ||
| 194 | AE_DSP_ABASE_MONO, | ||
| 195 | AE_DSP_ABASE_MULTICHANNEL, | ||
| 196 | AE_DSP_ABASE_AC3, | ||
| 197 | AE_DSP_ABASE_EAC3, | ||
| 198 | AE_DSP_ABASE_DTS, | ||
| 199 | AE_DSP_ABASE_DTSHD_MA, | ||
| 200 | AE_DSP_ABASE_DTSHD_HRA, | ||
| 201 | AE_DSP_ABASE_TRUEHD, | ||
| 202 | AE_DSP_ABASE_MLP, | ||
| 203 | AE_DSP_ABASE_FLAC, | ||
| 204 | |||
| 205 | AE_DSP_ABASE_MAX | ||
| 206 | } AE_DSP_BASETYPE; | ||
| 207 | |||
| 208 | |||
| 209 | /** | ||
| 210 | * @brief The from KODI in settings requested audio process quality. | ||
| 211 | * The KODI internal used quality levels is translated to this values | ||
| 212 | * for usage on DSP processing add-ons. Is present on iQualityLevel | ||
| 213 | * inside AE_DSP_SETTINGS. | ||
| 214 | */ | ||
| 215 | typedef enum | ||
| 216 | { | ||
| 217 | AE_DSP_QUALITY_UNKNOWN = -1, /*!< @brief Unset, unknown or incorrect quality level */ | ||
| 218 | AE_DSP_QUALITY_DEFAULT = 0, /*!< @brief Engine's default quality level */ | ||
| 219 | |||
| 220 | /* Basic quality levels */ | ||
| 221 | AE_DSP_QUALITY_LOW = 20, /*!< @brief Low quality level */ | ||
| 222 | AE_DSP_QUALITY_MID = 30, /*!< @brief Standard quality level */ | ||
| 223 | AE_DSP_QUALITY_HIGH = 50, /*!< @brief Best sound processing quality */ | ||
| 224 | |||
| 225 | /* Optional quality levels */ | ||
| 226 | AE_DSP_QUALITY_REALLYHIGH = 100 /*!< @brief Uncompromising optional quality level, usually with unmeasurable and unnoticeable improvement */ | ||
| 227 | } AE_DSP_QUALITY; | ||
| 228 | |||
| 229 | /*! | ||
| 230 | * @brief Audio DSP menu hook categories. | ||
| 231 | * Used to identify on AE_DSP_MENUHOOK given add-on related skin dialog/windows. | ||
| 232 | * Except AE_DSP_MENUHOOK_ALL and AE_DSP_MENUHOOK_SETTING are the menus available | ||
| 233 | * from DSP playback dialogue which can be opened over KODI file context menu and over | ||
| 234 | * button on full screen OSD window. | ||
| 235 | * | ||
| 236 | * Menu hook AE_DSP_MENUHOOK_SETTING is available from DSP processing setup dialogue. | ||
| 237 | */ | ||
| 238 | typedef enum | ||
| 239 | { | ||
| 240 | AE_DSP_MENUHOOK_UNKNOWN =-1, /*!< @brief unknown menu hook */ | ||
| 241 | AE_DSP_MENUHOOK_ALL = 0, /*!< @brief all categories */ | ||
| 242 | AE_DSP_MENUHOOK_PRE_PROCESS = 1, /*!< @brief for pre processing */ | ||
| 243 | AE_DSP_MENUHOOK_MASTER_PROCESS = 2, /*!< @brief for master processing */ | ||
| 244 | AE_DSP_MENUHOOK_POST_PROCESS = 3, /*!< @brief for post processing */ | ||
| 245 | AE_DSP_MENUHOOK_RESAMPLE = 4, /*!< @brief for re sample */ | ||
| 246 | AE_DSP_MENUHOOK_MISCELLANEOUS = 5, /*!< @brief for miscellaneous dialogues */ | ||
| 247 | AE_DSP_MENUHOOK_INFORMATION = 6, /*!< @brief dialogue to show processing information */ | ||
| 248 | AE_DSP_MENUHOOK_SETTING = 7, /*!< @brief for settings */ | ||
| 249 | } AE_DSP_MENUHOOK_CAT; | ||
| 250 | |||
| 251 | /*! | ||
| 252 | * @brief Menu hooks that are available in the menus while playing a stream via this add-on. | ||
| 253 | */ | ||
| 254 | typedef struct AE_DSP_MENUHOOK | ||
| 255 | { | ||
| 256 | unsigned int iHookId; /*!< @brief (required) this hook's identifier */ | ||
| 257 | unsigned int iLocalizedStringId; /*!< @brief (required) the id of the label for this hook in g_localizeStrings */ | ||
| 258 | AE_DSP_MENUHOOK_CAT category; /*!< @brief (required) category of menu hook */ | ||
| 259 | unsigned int iRelevantModeId; /*!< @brief (required) except category AE_DSP_MENUHOOK_SETTING and AE_DSP_MENUHOOK_ALL must be the related mode id present here */ | ||
| 260 | bool bNeedPlayback; /*!< @brief (required) set to true if menu hook need playback and active processing */ | ||
| 261 | } ATTRIBUTE_PACKED AE_DSP_MENUHOOK; | ||
| 262 | |||
| 263 | /*! | ||
| 264 | * @brief Properties passed to the Create() method of an add-on. | ||
| 265 | */ | ||
| 266 | typedef struct AE_DSP_PROPERTIES | ||
| 267 | { | ||
| 268 | const char* strUserPath; /*!< @brief path to the user profile */ | ||
| 269 | const char* strAddonPath; /*!< @brief path to this add-on */ | ||
| 270 | } AE_DSP_PROPERTIES; | ||
| 271 | |||
| 272 | /*! | ||
| 273 | * @brief Audio DSP add-on capabilities. All capabilities are set to "false" as default. | ||
| 274 | * If a capability is set to true, then the corresponding methods from kodi_audiodsp_dll.h need to be implemented. | ||
| 275 | */ | ||
| 276 | typedef struct AE_DSP_ADDON_CAPABILITIES | ||
| 277 | { | ||
| 278 | bool bSupportsInputProcess; /*!< @brief true if this add-on provides audio input processing */ | ||
| 279 | bool bSupportsInputResample; /*!< @brief true if this add-on provides audio resample before master handling */ | ||
| 280 | bool bSupportsPreProcess; /*!< @brief true if this add-on provides audio pre processing */ | ||
| 281 | bool bSupportsMasterProcess; /*!< @brief true if this add-on provides audio master processing */ | ||
| 282 | bool bSupportsPostProcess; /*!< @brief true if this add-on provides audio post processing */ | ||
| 283 | bool bSupportsOutputResample; /*!< @brief true if this add-on provides audio re sample after master handling */ | ||
| 284 | } ATTRIBUTE_PACKED AE_DSP_ADDON_CAPABILITIES; | ||
| 285 | |||
| 286 | /*! | ||
| 287 | * @brief Audio processing settings for in and out arrays | ||
| 288 | * Send on creation and before first processed audio packet to add-on | ||
| 289 | */ | ||
| 290 | typedef struct AE_DSP_SETTINGS | ||
| 291 | { | ||
| 292 | AE_DSP_STREAM_ID iStreamID; /*!< @brief id of the audio stream packets */ | ||
| 293 | AE_DSP_STREAMTYPE iStreamType; /*!< @brief the input stream type source eg, Movie or Music */ | ||
| 294 | int iInChannels; /*!< @brief the amount of input channels */ | ||
| 295 | unsigned long lInChannelPresentFlags; /*!< @brief the exact channel mapping flags of input */ | ||
| 296 | int iInFrames; /*!< @brief the input frame size from KODI */ | ||
| 297 | unsigned int iInSamplerate; /*!< @brief the basic sample rate of the audio packet */ | ||
| 298 | int iProcessFrames; /*!< @brief the processing frame size inside add-on's */ | ||
| 299 | unsigned int iProcessSamplerate; /*!< @brief the sample rate after input resample present in master processing */ | ||
| 300 | int iOutChannels; /*!< @brief the amount of output channels */ | ||
| 301 | unsigned long lOutChannelPresentFlags; /*!< @brief the exact channel mapping flags for output */ | ||
| 302 | int iOutFrames; /*!< @brief the final out frame size for KODI */ | ||
| 303 | unsigned int iOutSamplerate; /*!< @brief the final sample rate of the audio packet */ | ||
| 304 | bool bInputResamplingActive; /*!< @brief if a re-sampling is performed before master processing this flag is set to true */ | ||
| 305 | bool bStereoUpmix; /*!< @brief true if the stereo upmix setting on kodi is set */ | ||
| 306 | int iQualityLevel; /*!< @brief the from KODI selected quality level for signal processing */ | ||
| 307 | /*! | ||
| 308 | * @note about "iProcessSamplerate" and "iProcessFrames" is set from KODI after call of StreamCreate on input re sample add-on, if re-sampling | ||
| 309 | * and processing is handled inside the same add-on, this value must be ignored! | ||
| 310 | */ | ||
| 311 | } ATTRIBUTE_PACKED AE_DSP_SETTINGS; | ||
| 312 | |||
| 313 | /*! | ||
| 314 | * @brief Stream profile properties | ||
| 315 | * Can be used to detect best master processing mode and for post processing methods. | ||
| 316 | */ | ||
| 317 | //@{ | ||
| 318 | |||
| 319 | /*! | ||
| 320 | * @brief Dolby profile types. Given from several formats, e.g. Dolby Digital or TrueHD | ||
| 321 | * Used on AE_DSP_PROFILE_AC3_EAC3 and AE_DSP_PROFILE_MLP_TRUEHD | ||
| 322 | */ | ||
| 323 | #define AE_DSP_PROFILE_DOLBY_NONE 0 | ||
| 324 | #define AE_DSP_PROFILE_DOLBY_SURROUND 1 | ||
| 325 | #define AE_DSP_PROFILE_DOLBY_PLII 2 | ||
| 326 | #define AE_DSP_PROFILE_DOLBY_PLIIX 3 | ||
| 327 | #define AE_DSP_PROFILE_DOLBY_PLIIZ 4 | ||
| 328 | #define AE_DSP_PROFILE_DOLBY_EX 5 | ||
| 329 | #define AE_DSP_PROFILE_DOLBY_HEADPHONE 6 | ||
| 330 | |||
| 331 | /*! | ||
| 332 | * @brief DTS/DTS HD profile types | ||
| 333 | * Used on AE_DSP_PROFILE_DTS_DTSHD | ||
| 334 | */ | ||
| 335 | #define AE_DSP_PROFILE_DTS 0 | ||
| 336 | #define AE_DSP_PROFILE_DTS_ES 1 | ||
| 337 | #define AE_DSP_PROFILE_DTS_96_24 2 | ||
| 338 | #define AE_DSP_PROFILE_DTS_HD_HRA 3 | ||
| 339 | #define AE_DSP_PROFILE_DTS_HD_MA 4 | ||
| 340 | |||
| 341 | /*! | ||
| 342 | * @brief AC3/EAC3 based service types | ||
| 343 | * Used on AE_DSP_PROFILE_AC3_EAC3 | ||
| 344 | */ | ||
| 345 | #define AE_DSP_SERVICE_TYPE_MAIN 0 | ||
| 346 | #define AE_DSP_SERVICE_TYPE_EFFECTS 1 | ||
| 347 | #define AE_DSP_SERVICE_TYPE_VISUALLY_IMPAIRED 2 | ||
| 348 | #define AE_DSP_SERVICE_TYPE_HEARING_IMPAIRED 3 | ||
| 349 | #define AE_DSP_SERVICE_TYPE_DIALOGUE 4 | ||
| 350 | #define AE_DSP_SERVICE_TYPE_COMMENTARY 5 | ||
| 351 | #define AE_DSP_SERVICE_TYPE_EMERGENCY 6 | ||
| 352 | #define AE_DSP_SERVICE_TYPE_VOICE_OVER 7 | ||
| 353 | #define AE_DSP_SERVICE_TYPE_KARAOKE 8 | ||
| 354 | |||
| 355 | /*! | ||
| 356 | * @brief AC3/EAC3 based room types | ||
| 357 | * Present on AE_DSP_PROFILE_AC3_EAC3 and can be used for frequency corrections | ||
| 358 | * at post processing, e.g. THX Re-Equalization | ||
| 359 | */ | ||
| 360 | #define AE_DSP_ROOM_TYPE_UNDEFINED 0 | ||
| 361 | #define AE_DSP_ROOM_TYPE_SMALL 1 | ||
| 362 | #define AE_DSP_ROOM_TYPE_LARGE 2 | ||
| 363 | |||
| 364 | /*! | ||
| 365 | * @brief AC3/EAC3 stream profile properties | ||
| 366 | */ | ||
| 367 | //! @todo add handling for it (currently never becomes set) | ||
| 368 | typedef struct AE_DSP_PROFILE_AC3_EAC3 | ||
| 369 | { | ||
| 370 | unsigned int iProfile; /*!< defined by AE_DSP_PROFILE_DOLBY_* */ | ||
| 371 | unsigned int iServiceType; /*!< defined by AE_DSP_SERVICE_TYPE_* */ | ||
| 372 | unsigned int iRoomType; /*!< defined by AE_DSP_ROOM_TYPE_* (NOTICE: Information about it currently not supported from ffmpeg and must be implemented) */ | ||
| 373 | } ATTRIBUTE_PACKED AE_DSP_PROFILE_AC3_EAC3; | ||
| 374 | |||
| 375 | /*! | ||
| 376 | * @brief MLP/Dolby TrueHD stream profile properties | ||
| 377 | */ | ||
| 378 | //! @todo add handling for it (currently never becomes set) | ||
| 379 | typedef struct AE_DSP_PROFILE_MLP_TRUEHD | ||
| 380 | { | ||
| 381 | unsigned int iProfile; /*!< defined by AE_DSP_PROFILE_DOLBY_* */ | ||
| 382 | } ATTRIBUTE_PACKED AE_DSP_PROFILE_MLP_TRUEHD; | ||
| 383 | |||
| 384 | /*! | ||
| 385 | * @brief DTS/DTS HD stream profile properties | ||
| 386 | */ | ||
| 387 | //! @todo add handling for it (currently never becomes set) | ||
| 388 | typedef struct AE_DSP_PROFILE_DTS_DTSHD | ||
| 389 | { | ||
| 390 | unsigned int iProfile; /*!< defined by AE_DSP_PROFILE_DTS* */ | ||
| 391 | bool bSurroundMatrix; /*!< if set to true given 2.0 stream is surround encoded */ | ||
| 392 | } ATTRIBUTE_PACKED AE_DSP_PROFILE_DTS_DTSHD; | ||
| 393 | |||
| 394 | union AE_DSP_PROFILE | ||
| 395 | { | ||
| 396 | AE_DSP_PROFILE_AC3_EAC3 ac3_eac3; /*!< Dolby Digital/Digital+ profile data */ | ||
| 397 | AE_DSP_PROFILE_MLP_TRUEHD mlp_truehd; /*!< MLP or Dolby TrueHD profile data */ | ||
| 398 | AE_DSP_PROFILE_DTS_DTSHD dts_dtshd; /*!< DTS/DTS-HD profile data */ | ||
| 399 | }; | ||
| 400 | //@} | ||
| 401 | |||
| 402 | /*! | ||
| 403 | * @brief Audio DSP stream properties | ||
| 404 | * Used to check for the DSP add-on that the stream is supported, | ||
| 405 | * as example Dolby Digital Ex processing is only required on Dolby Digital with 5.1 layout | ||
| 406 | */ | ||
| 407 | typedef struct AE_DSP_STREAM_PROPERTIES | ||
| 408 | { | ||
| 409 | AE_DSP_STREAM_ID iStreamID; /*!< @brief stream id of the audio stream packets */ | ||
| 410 | AE_DSP_STREAMTYPE iStreamType; /*!< @brief the input stream type source eg, Movie or Music */ | ||
| 411 | int iBaseType; /*!< @brief the input stream base type source eg, Dolby Digital */ | ||
| 412 | const char* strName; /*!< @brief the audio stream name */ | ||
| 413 | const char* strCodecId; /*!< @brief codec id string of the audio stream */ | ||
| 414 | const char* strLanguage; /*!< @brief language id of the audio stream */ | ||
| 415 | int iIdentifier; /*!< @brief audio stream id inside player */ | ||
| 416 | int iChannels; /*!< @brief amount of basic channels */ | ||
| 417 | int iSampleRate; /*!< @brief sample rate */ | ||
| 418 | AE_DSP_PROFILE Profile; /*!< @brief current running stream profile data */ | ||
| 419 | } ATTRIBUTE_PACKED AE_DSP_STREAM_PROPERTIES; | ||
| 420 | |||
| 421 | /*! | ||
| 422 | * @brief Audio DSP mode categories | ||
| 423 | */ | ||
| 424 | typedef enum | ||
| 425 | { | ||
| 426 | AE_DSP_MODE_TYPE_UNDEFINED = -1, /*!< @brief undefined type, never be used from add-on! */ | ||
| 427 | AE_DSP_MODE_TYPE_INPUT_RESAMPLE = 0, /*!< @brief for input re sample */ | ||
| 428 | AE_DSP_MODE_TYPE_PRE_PROCESS = 1, /*!< @brief for preprocessing */ | ||
| 429 | AE_DSP_MODE_TYPE_MASTER_PROCESS = 2, /*!< @brief for master processing */ | ||
| 430 | AE_DSP_MODE_TYPE_POST_PROCESS = 3, /*!< @brief for post processing */ | ||
| 431 | AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE = 4, /*!< @brief for output re sample */ | ||
| 432 | AE_DSP_MODE_TYPE_MAX = 5 | ||
| 433 | } AE_DSP_MODE_TYPE; | ||
| 434 | |||
| 435 | /*! | ||
| 436 | * @brief Audio DSP master mode information | ||
| 437 | * Used to get all available modes for current input stream | ||
| 438 | */ | ||
| 439 | typedef struct AE_DSP_MODES | ||
| 440 | { | ||
| 441 | unsigned int iModesCount; /*!< @brief (required) count of how much modes are in AE_DSP_MODES */ | ||
| 442 | struct AE_DSP_MODE | ||
| 443 | { | ||
| 444 | int iUniqueDBModeId; /*!< @brief (required) the inside add-on used identifier for the mode, set by KODI's audio DSP database */ | ||
| 445 | AE_DSP_MODE_TYPE iModeType; /*!< @brief (required) the processong mode type, see AE_DSP_MODE_TYPE */ | ||
| 446 | char strModeName[AE_DSP_ADDON_STRING_LENGTH]; /*!< @brief (required) the addon name of the mode, used on KODI's logs */ | ||
| 447 | |||
| 448 | unsigned int iModeNumber; /*!< @brief (required) number of this mode on the add-on, is used on process functions with value "mode_id" */ | ||
| 449 | unsigned int iModeSupportTypeFlags; /*!< @brief (required) flags about supported input types for this mode, see AE_DSP_ASTREAM_PRESENT */ | ||
| 450 | bool bHasSettingsDialog; /*!< @brief (required) if setting dialog(s) are available it must be set to true */ | ||
| 451 | bool bIsDisabled; /*!< @brief (optional) true if this mode is marked as disabled and not enabled default, only relevant for master processes, all other types always disabled as default */ | ||
| 452 | |||
| 453 | unsigned int iModeName; /*!< @brief (required) the name id of the mode for this hook in g_localizeStrings */ | ||
| 454 | unsigned int iModeSetupName; /*!< @brief (optional) the name id of the mode inside settings for this hook in g_localizeStrings */ | ||
| 455 | unsigned int iModeDescription; /*!< @brief (optional) the description id of the mode for this hook in g_localizeStrings */ | ||
| 456 | unsigned int iModeHelp; /*!< @brief (optional) help string id for inside DSP settings dialog of the mode for this hook in g_localizeStrings */ | ||
| 457 | |||
| 458 | char strOwnModeImage[AE_DSP_ADDON_STRING_LENGTH]; /*!< @brief (optional) flag image for the mode */ | ||
| 459 | char strOverrideModeImage[AE_DSP_ADDON_STRING_LENGTH]; /*!< @brief (optional) image to override KODI Image for the mode, eg. Dolby Digital with Dolby Digital Ex (only used on master modes) */ | ||
| 460 | } mode[AE_DSP_STREAM_MAX_MODES]; /*!< @brief Modes array storage */ | ||
| 461 | } ATTRIBUTE_PACKED AE_DSP_MODES; | ||
| 462 | |||
| 463 | /*! | ||
| 464 | * @brief Audio DSP menu hook data | ||
| 465 | */ | ||
| 466 | typedef struct AE_DSP_MENUHOOK_DATA | ||
| 467 | { | ||
| 468 | AE_DSP_MENUHOOK_CAT category; /*!< @brief (required) related menuhook data category */ | ||
| 469 | union data { | ||
| 470 | AE_DSP_STREAM_ID iStreamId; /*!< @brief currently only stream id is used, is used as union to have extension possibility */ | ||
| 471 | } data; /*!< @brief related category related data */ | ||
| 472 | } ATTRIBUTE_PACKED AE_DSP_MENUHOOK_DATA; | ||
| 473 | |||
| 474 | /*! | ||
| 475 | * @brief Structure to transfer the methods from kodi_audiodsp_dll.h to KODI | ||
| 476 | */ | ||
| 477 | struct AudioDSP | ||
| 478 | { | ||
| 479 | const char* (__cdecl* GetAudioDSPAPIVersion) (void); | ||
| 480 | const char* (__cdecl* GetMinimumAudioDSPAPIVersion) (void); | ||
| 481 | const char* (__cdecl* GetGUIAPIVersion) (void); | ||
| 482 | const char* (__cdecl* GetMinimumGUIAPIVersion) (void); | ||
| 483 | AE_DSP_ERROR (__cdecl* GetAddonCapabilities) (AE_DSP_ADDON_CAPABILITIES*); | ||
| 484 | const char* (__cdecl* GetDSPName) (void); | ||
| 485 | const char* (__cdecl* GetDSPVersion) (void); | ||
| 486 | AE_DSP_ERROR (__cdecl* MenuHook) (const AE_DSP_MENUHOOK&, const AE_DSP_MENUHOOK_DATA&); | ||
| 487 | |||
| 488 | AE_DSP_ERROR (__cdecl* StreamCreate) (const AE_DSP_SETTINGS*, const AE_DSP_STREAM_PROPERTIES*, ADDON_HANDLE); | ||
| 489 | AE_DSP_ERROR (__cdecl* StreamDestroy) (const ADDON_HANDLE); | ||
| 490 | AE_DSP_ERROR (__cdecl* StreamIsModeSupported) (const ADDON_HANDLE, AE_DSP_MODE_TYPE, unsigned int, int); | ||
| 491 | AE_DSP_ERROR (__cdecl* StreamInitialize) (const ADDON_HANDLE, const AE_DSP_SETTINGS*); | ||
| 492 | |||
| 493 | bool (__cdecl* InputProcess) (const ADDON_HANDLE, const float**, unsigned int); | ||
| 494 | |||
| 495 | unsigned int (__cdecl* InputResampleProcessNeededSamplesize) (const ADDON_HANDLE); | ||
| 496 | unsigned int (__cdecl* InputResampleProcess) (const ADDON_HANDLE, float**, float**, unsigned int); | ||
| 497 | float (__cdecl* InputResampleGetDelay) (const ADDON_HANDLE); | ||
| 498 | int (__cdecl* InputResampleSampleRate) (const ADDON_HANDLE); | ||
| 499 | |||
| 500 | unsigned int (__cdecl* PreProcessNeededSamplesize) (const ADDON_HANDLE, unsigned int); | ||
| 501 | float (__cdecl* PreProcessGetDelay) (const ADDON_HANDLE, unsigned int); | ||
| 502 | unsigned int (__cdecl* PreProcess) (const ADDON_HANDLE, unsigned int, float**, float**, unsigned int); | ||
| 503 | |||
| 504 | AE_DSP_ERROR (__cdecl* MasterProcessSetMode) (const ADDON_HANDLE, AE_DSP_STREAMTYPE, unsigned int, int); | ||
| 505 | unsigned int (__cdecl* MasterProcessNeededSamplesize) (const ADDON_HANDLE); | ||
| 506 | float (__cdecl* MasterProcessGetDelay) (const ADDON_HANDLE); | ||
| 507 | int (__cdecl* MasterProcessGetOutChannels) (const ADDON_HANDLE, unsigned long&); | ||
| 508 | unsigned int (__cdecl* MasterProcess) (const ADDON_HANDLE, float**, float**, unsigned int); | ||
| 509 | const char* (__cdecl* MasterProcessGetStreamInfoString) (const ADDON_HANDLE); | ||
| 510 | |||
| 511 | unsigned int (__cdecl* PostProcessNeededSamplesize) (const ADDON_HANDLE, unsigned int); | ||
| 512 | float (__cdecl* PostProcessGetDelay) (const ADDON_HANDLE, unsigned int); | ||
| 513 | unsigned int (__cdecl* PostProcess) (const ADDON_HANDLE, unsigned int, float**, float**, unsigned int); | ||
| 514 | |||
| 515 | unsigned int (__cdecl* OutputResampleProcessNeededSamplesize)(const ADDON_HANDLE); | ||
| 516 | unsigned int (__cdecl* OutputResampleProcess) (const ADDON_HANDLE, float**, float**, unsigned int); | ||
| 517 | float (__cdecl* OutputResampleGetDelay) (const ADDON_HANDLE); | ||
| 518 | int (__cdecl* OutputResampleSampleRate) (const ADDON_HANDLE); | ||
| 519 | }; | ||
| 520 | |||
| 521 | #ifdef __cplusplus | ||
| 522 | } | ||
| 523 | #endif | ||
| 524 | |||
diff --git a/xbmc/addons/include/kodi_audiodec_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h index 78bc3cc..78bc3cc 100644 --- a/xbmc/addons/include/kodi_audiodec_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h | |||
diff --git a/xbmc/addons/include/kodi_audiodec_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h index 50c4cc4..82d71e5 100644 --- a/xbmc/addons/include/kodi_audiodec_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #include <stdint.h> | 23 | #include <stdint.h> |
| 24 | #ifdef BUILD_KODI_ADDON | 24 | #ifdef BUILD_KODI_ADDON |
| 25 | #include "kodi/AEChannelData.h" | 25 | #include "AEChannelData.h" |
| 26 | #else | 26 | #else |
| 27 | #include "cores/AudioEngine/Utils/AEChannelData.h" | 27 | #include "cores/AudioEngine/Utils/AEChannelData.h" |
| 28 | #endif | 28 | #endif |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h new file mode 100644 index 0000000..0402ace --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h | |||
| @@ -0,0 +1,165 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2015 Team Kodi | ||
| 5 | * http://kodi.tv | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with Kodi; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | /*! | ||
| 24 | * Common data structures shared between KODI and KODI's binary add-ons | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifdef BUILD_KODI_ADDON | ||
| 28 | #include "kodi/AudioEngine/AEChannelInfo.h" | ||
| 29 | #else | ||
| 30 | #include "cores/AudioEngine/Utils/AEChannelInfo.h" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef TARGET_WINDOWS | ||
| 34 | #include <windows.h> | ||
| 35 | #else | ||
| 36 | #ifndef __cdecl | ||
| 37 | #define __cdecl | ||
| 38 | #endif | ||
| 39 | #ifndef __declspec | ||
| 40 | #define __declspec(X) | ||
| 41 | #endif | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #include <cstddef> | ||
| 45 | |||
| 46 | #undef ATTRIBUTE_PACKED | ||
| 47 | #undef PRAGMA_PACK_BEGIN | ||
| 48 | #undef PRAGMA_PACK_END | ||
| 49 | |||
| 50 | #if defined(__GNUC__) | ||
| 51 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | ||
| 52 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) | ||
| 53 | #define PRAGMA_PACK 0 | ||
| 54 | #endif | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #if !defined(ATTRIBUTE_PACKED) | ||
| 58 | #define ATTRIBUTE_PACKED | ||
| 59 | #define PRAGMA_PACK 1 | ||
| 60 | #endif | ||
| 61 | |||
| 62 | /* current Audio DSP API version */ | ||
| 63 | #define KODI_AUDIOENGINE_API_VERSION "0.0.1" | ||
| 64 | |||
| 65 | /* min. Audio DSP API version */ | ||
| 66 | #define KODI_AUDIOENGINE_MIN_API_VERSION "0.0.1" | ||
| 67 | |||
| 68 | |||
| 69 | #ifdef __cplusplus | ||
| 70 | extern "C" { | ||
| 71 | #endif | ||
| 72 | |||
| 73 | /** | ||
| 74 | * A stream handle pointer, which is only used internally by the addon stream handle | ||
| 75 | */ | ||
| 76 | typedef void AEStreamHandle; | ||
| 77 | |||
| 78 | /** | ||
| 79 | * The audio format structure that fully defines a stream's audio information | ||
| 80 | */ | ||
| 81 | typedef struct AudioEngineFormat | ||
| 82 | { | ||
| 83 | /** | ||
| 84 | * The stream's data format (eg, AE_FMT_S16LE) | ||
| 85 | */ | ||
| 86 | enum AEDataFormat m_dataFormat; | ||
| 87 | |||
| 88 | /** | ||
| 89 | * The stream's sample rate (eg, 48000) | ||
| 90 | */ | ||
| 91 | unsigned int m_sampleRate; | ||
| 92 | |||
| 93 | /** | ||
| 94 | * The encoded streams sample rate if a bitstream, otherwise undefined | ||
| 95 | */ | ||
| 96 | unsigned int m_encodedRate; | ||
| 97 | |||
| 98 | /** | ||
| 99 | * The amount of used speaker channels | ||
| 100 | */ | ||
| 101 | unsigned int m_channelCount; | ||
| 102 | |||
| 103 | /** | ||
| 104 | * The stream's channel layout | ||
| 105 | */ | ||
| 106 | enum AEChannel m_channels[AE_CH_MAX]; | ||
| 107 | |||
| 108 | /** | ||
| 109 | * The number of frames per period | ||
| 110 | */ | ||
| 111 | unsigned int m_frames; | ||
| 112 | |||
| 113 | /** | ||
| 114 | * The size of one frame in bytes | ||
| 115 | */ | ||
| 116 | unsigned int m_frameSize; | ||
| 117 | |||
| 118 | AudioEngineFormat() | ||
| 119 | { | ||
| 120 | m_dataFormat = AE_FMT_INVALID; | ||
| 121 | m_sampleRate = 0; | ||
| 122 | m_encodedRate = 0; | ||
| 123 | m_frames = 0; | ||
| 124 | m_frameSize = 0; | ||
| 125 | m_channelCount = 0; | ||
| 126 | |||
| 127 | for (unsigned int ch = 0; ch < AE_CH_MAX; ch++) | ||
| 128 | { | ||
| 129 | m_channels[ch] = AE_CH_NULL; | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | bool compareFormat(const AudioEngineFormat *fmt) | ||
| 134 | { | ||
| 135 | if (!fmt) | ||
| 136 | { | ||
| 137 | return false; | ||
| 138 | } | ||
| 139 | |||
| 140 | if (m_dataFormat != fmt->m_dataFormat || | ||
| 141 | m_sampleRate != fmt->m_sampleRate || | ||
| 142 | m_encodedRate != fmt->m_encodedRate || | ||
| 143 | m_frames != fmt->m_frames || | ||
| 144 | m_frameSize != fmt->m_frameSize || | ||
| 145 | m_channelCount != fmt->m_channelCount) | ||
| 146 | { | ||
| 147 | return false; | ||
| 148 | } | ||
| 149 | |||
| 150 | for (unsigned int ch = 0; ch < AE_CH_MAX; ch++) | ||
| 151 | { | ||
| 152 | if (fmt->m_channels[ch] != m_channels[ch]) | ||
| 153 | { | ||
| 154 | return false; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 158 | return true; | ||
| 159 | } | ||
| 160 | } AudioEngineFormat; | ||
| 161 | |||
| 162 | #ifdef __cplusplus | ||
| 163 | } | ||
| 164 | #endif | ||
| 165 | |||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h new file mode 100644 index 0000000..6ecf566 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h | |||
| @@ -0,0 +1,257 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2016 Team Kodi | ||
| 5 | * http://kodi.tv | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with Kodi; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #include "kodi_inputstream_types.h" | ||
| 24 | #include "xbmc_addon_dll.h" | ||
| 25 | |||
| 26 | /*! | ||
| 27 | * Functions that the InputStream client add-on must implement, but some can be empty. | ||
| 28 | * | ||
| 29 | * The 'remarks' field indicates which methods should be implemented, and which ones are optional. | ||
| 30 | */ | ||
| 31 | |||
| 32 | extern "C" | ||
| 33 | { | ||
| 34 | /*! | ||
| 35 | * Open a stream. | ||
| 36 | * @param props | ||
| 37 | * @return True if the stream has been opened successfully, false otherwise. | ||
| 38 | * @remarks | ||
| 39 | */ | ||
| 40 | bool Open(INPUTSTREAM& props); | ||
| 41 | |||
| 42 | /*! | ||
| 43 | * Close an open stream. | ||
| 44 | * @remarks | ||
| 45 | */ | ||
| 46 | void Close(void); | ||
| 47 | |||
| 48 | /*! | ||
| 49 | * Get path/url for this addon. | ||
| 50 | * @remarks | ||
| 51 | */ | ||
| 52 | const char* GetPathList(void); | ||
| 53 | |||
| 54 | /*! | ||
| 55 | * Get Capabilities of this addon. | ||
| 56 | * @remarks | ||
| 57 | */ | ||
| 58 | struct INPUTSTREAM_CAPABILITIES GetCapabilities(); | ||
| 59 | |||
| 60 | |||
| 61 | /*! | ||
| 62 | * Get IDs of available streams | ||
| 63 | * @remarks | ||
| 64 | */ | ||
| 65 | INPUTSTREAM_IDS GetStreamIds(); | ||
| 66 | |||
| 67 | /*! | ||
| 68 | * Get stream properties of a stream. | ||
| 69 | * @param streamId unique id of stream | ||
| 70 | * @return struc of stream properties | ||
| 71 | * @remarks | ||
| 72 | */ | ||
| 73 | INPUTSTREAM_INFO GetStream(int streamid); | ||
| 74 | |||
| 75 | /*! | ||
| 76 | * Enable or disable a stream. | ||
| 77 | * A disabled stream does not send demux packets | ||
| 78 | * @param streamId unique id of stream | ||
| 79 | * @param enable true for enable, false for disable | ||
| 80 | * @remarks | ||
| 81 | */ | ||
| 82 | void EnableStream(int streamid, bool enable); | ||
| 83 | |||
| 84 | /*! | ||
| 85 | * Enables a stream at the given PTS. | ||
| 86 | * @param streamId unique id of stream | ||
| 87 | * @param pts position in stream in microseconds | ||
| 88 | * @remarks will only be called if CAPABILITIES::m_supportsEnableAtPTS is set to true | ||
| 89 | */ | ||
| 90 | void EnableStreamAtPTS(int streamid, uint64_t pts); | ||
| 91 | |||
| 92 | /*! | ||
| 93 | * Reset the demultiplexer in the add-on. | ||
| 94 | * @remarks Required if bHandlesDemuxing is set to true. | ||
| 95 | */ | ||
| 96 | void DemuxReset(void); | ||
| 97 | |||
| 98 | /*! | ||
| 99 | * Abort the demultiplexer thread in the add-on. | ||
| 100 | * @remarks Required if bHandlesDemuxing is set to true. | ||
| 101 | */ | ||
| 102 | void DemuxAbort(void); | ||
| 103 | |||
| 104 | /*! | ||
| 105 | * Flush all data that's currently in the demultiplexer buffer in the add-on. | ||
| 106 | * @remarks Required if bHandlesDemuxing is set to true. | ||
| 107 | */ | ||
| 108 | void DemuxFlush(void); | ||
| 109 | |||
| 110 | /*! | ||
| 111 | * Read the next packet from the demultiplexer, if there is one. | ||
| 112 | * @return The next packet. | ||
| 113 | * If there is no next packet, then the add-on should return the | ||
| 114 | * packet created by calling AllocateDemuxPacket(0) on the callback. | ||
| 115 | * If the stream changed and XBMC's player needs to be reinitialised, | ||
| 116 | * then, the add-on should call AllocateDemuxPacket(0) on the | ||
| 117 | * callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and | ||
| 118 | * return the value. | ||
| 119 | * The add-on should return NULL if an error occured. | ||
| 120 | * @remarks Return NULL if this add-on won't provide this function. | ||
| 121 | */ | ||
| 122 | DemuxPacket* DemuxRead(void); | ||
| 123 | |||
| 124 | /*! | ||
| 125 | * Notify the InputStream addon/demuxer that XBMC wishes to seek the stream by time | ||
| 126 | * Demuxer is required to set stream to an IDR frame | ||
| 127 | * @param time The absolute time since stream start | ||
| 128 | * @param backwards True to seek to keyframe BEFORE time, else AFTER | ||
| 129 | * @param startpts can be updated to point to where display should start | ||
| 130 | * @return True if the seek operation was possible | ||
| 131 | * @remarks Optional, and only used if addon has its own demuxer. | ||
| 132 | */ | ||
| 133 | bool DemuxSeekTime(int time, bool backwards, double *startpts); | ||
| 134 | |||
| 135 | /*! | ||
| 136 | * Notify the InputStream addon/demuxer that XBMC wishes to change playback speed | ||
| 137 | * @param speed The requested playback speed | ||
| 138 | * @remarks Optional, and only used if addon has its own demuxer. | ||
| 139 | */ | ||
| 140 | void DemuxSetSpeed(int speed); | ||
| 141 | |||
| 142 | |||
| 143 | /*! | ||
| 144 | * Totel time in ms | ||
| 145 | * @remarks | ||
| 146 | */ | ||
| 147 | int GetTotalTime(); | ||
| 148 | |||
| 149 | /*! | ||
| 150 | * Playing time in ms | ||
| 151 | * @remarks | ||
| 152 | */ | ||
| 153 | int GetTime(); | ||
| 154 | |||
| 155 | /*! | ||
| 156 | * Positions inputstream to playing time given in ms | ||
| 157 | * @remarks | ||
| 158 | */ | ||
| 159 | bool PosTime(int ms); | ||
| 160 | |||
| 161 | |||
| 162 | /*! | ||
| 163 | * Check if the backend support pausing the currently playing stream | ||
| 164 | * This will enable/disable the pause button in XBMC based on the return value | ||
| 165 | * @return false if the InputStream addon/backend does not support pausing, true if possible | ||
| 166 | */ | ||
| 167 | bool CanPauseStream(); | ||
| 168 | |||
| 169 | /*! | ||
| 170 | * Check if the backend supports seeking for the currently playing stream | ||
| 171 | * This will enable/disable the rewind/forward buttons in XBMC based on the return value | ||
| 172 | * @return false if the InputStream addon/backend does not support seeking, true if possible | ||
| 173 | */ | ||
| 174 | bool CanSeekStream(); | ||
| 175 | |||
| 176 | |||
| 177 | /*! | ||
| 178 | * Read from an open stream. | ||
| 179 | * @param pBuffer The buffer to store the data in. | ||
| 180 | * @param iBufferSize The amount of bytes to read. | ||
| 181 | * @return The amount of bytes that were actually read from the stream. | ||
| 182 | * @remarks Return -1 if this add-on won't provide this function. | ||
| 183 | */ | ||
| 184 | int ReadStream(uint8_t* pBuffer, unsigned int iBufferSize); | ||
| 185 | |||
| 186 | /*! | ||
| 187 | * Seek in a stream. | ||
| 188 | * @param iPosition The position to seek to. | ||
| 189 | * @param iWhence ? | ||
| 190 | * @return The new position. | ||
| 191 | * @remarks Return -1 if this add-on won't provide this function. | ||
| 192 | */ | ||
| 193 | int64_t SeekStream(int64_t iPosition, int iWhence = SEEK_SET); | ||
| 194 | |||
| 195 | /*! | ||
| 196 | * @return The position in the stream that's currently being read. | ||
| 197 | * @remarks Return -1 if this add-on won't provide this function. | ||
| 198 | */ | ||
| 199 | int64_t PositionStream(void); | ||
| 200 | |||
| 201 | /*! | ||
| 202 | * @return The total length of the stream that's currently being read. | ||
| 203 | * @remarks Return -1 if this add-on won't provide this function. | ||
| 204 | */ | ||
| 205 | int64_t LengthStream(void); | ||
| 206 | |||
| 207 | |||
| 208 | /*! | ||
| 209 | * @brief Notify the InputStream addon that XBMC (un)paused the currently playing stream | ||
| 210 | */ | ||
| 211 | void PauseStream(double time); | ||
| 212 | |||
| 213 | |||
| 214 | /*! | ||
| 215 | * Check for real-time streaming | ||
| 216 | * @return true if current stream is real-time | ||
| 217 | */ | ||
| 218 | bool IsRealTimeStream(); | ||
| 219 | |||
| 220 | /*! | ||
| 221 | * Called by XBMC to assign the function pointers of this add-on to pClient. | ||
| 222 | * @param pClient The struct to assign the function pointers to. | ||
| 223 | */ | ||
| 224 | void __declspec(dllexport) get_addon(struct InputStreamAddonFunctions* pClient) | ||
| 225 | { | ||
| 226 | pClient->Open = Open; | ||
| 227 | pClient->Close = Close; | ||
| 228 | pClient->GetPathList = GetPathList; | ||
| 229 | pClient->GetCapabilities = GetCapabilities; | ||
| 230 | |||
| 231 | pClient->GetStreamIds = GetStreamIds; | ||
| 232 | pClient->GetStream = GetStream; | ||
| 233 | pClient->EnableStream = EnableStream; | ||
| 234 | pClient->EnableStreamAtPTS = EnableStreamAtPTS; | ||
| 235 | pClient->DemuxReset = DemuxReset; | ||
| 236 | pClient->DemuxAbort = DemuxAbort; | ||
| 237 | pClient->DemuxFlush = DemuxFlush; | ||
| 238 | pClient->DemuxRead = DemuxRead; | ||
| 239 | pClient->DemuxSeekTime = DemuxSeekTime; | ||
| 240 | pClient->DemuxSetSpeed = DemuxSetSpeed; | ||
| 241 | |||
| 242 | pClient->GetTotalTime = GetTotalTime; | ||
| 243 | pClient->GetTime = GetTime; | ||
| 244 | |||
| 245 | pClient->PosTime = PosTime; | ||
| 246 | |||
| 247 | pClient->CanPauseStream = CanPauseStream; | ||
| 248 | pClient->CanSeekStream = CanSeekStream; | ||
| 249 | |||
| 250 | pClient->ReadStream = ReadStream; | ||
| 251 | pClient->SeekStream = SeekStream; | ||
| 252 | pClient->PositionStream = PositionStream; | ||
| 253 | pClient->LengthStream = LengthStream; | ||
| 254 | pClient->PauseStream = PauseStream; | ||
| 255 | pClient->IsRealTimeStream = IsRealTimeStream; | ||
| 256 | }; | ||
| 257 | }; | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h new file mode 100644 index 0000000..33741d8 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2016 Team Kodi | ||
| 5 | * http://kodi.tv | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with Kodi; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __cdecl | ||
| 24 | #define __cdecl | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #ifdef BUILD_KODI_ADDON | ||
| 28 | #include "DVDDemuxPacket.h" | ||
| 29 | #else | ||
| 30 | #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | extern "C" { | ||
| 34 | |||
| 35 | // this are properties given to the addon on create | ||
| 36 | // at this time we have no parameters for the addon | ||
| 37 | typedef struct INPUTSTREAM_PROPS | ||
| 38 | { | ||
| 39 | int dummy; | ||
| 40 | } INPUTSTREAM_PROPS; | ||
| 41 | |||
| 42 | /*! | ||
| 43 | * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. | ||
| 44 | */ | ||
| 45 | typedef struct INPUTSTREAM_CAPABILITIES | ||
| 46 | { | ||
| 47 | bool m_supportsIDemux; /*!< @brief supports interface IDemux */ | ||
| 48 | bool m_supportsIPosTime; /*!< @brief supports interface IPosTime */ | ||
| 49 | bool m_supportsIDisplayTime; /*!< @brief supports interface IDisplayTime */ | ||
| 50 | bool m_supportsSeek; /*!< @brief supports seek */ | ||
| 51 | bool m_supportsPause; /*!< @brief supports pause */ | ||
| 52 | bool m_supportsEnableAtPTS; /*!< @brief supports enabling streams at a given PTS time */ | ||
| 53 | } INPUTSTREAM_CAPABILITIES; | ||
| 54 | |||
| 55 | /*! | ||
| 56 | * @brief structure of key/value pairs passed to addon on Open() | ||
| 57 | */ | ||
| 58 | typedef struct INPUTSTREAM | ||
| 59 | { | ||
| 60 | static const unsigned int MAX_INFO_COUNT = 8; | ||
| 61 | |||
| 62 | const char *m_strURL; | ||
| 63 | |||
| 64 | unsigned int m_nCountInfoValues; | ||
| 65 | struct LISTITEMPROPERTY | ||
| 66 | { | ||
| 67 | const char *m_strKey; | ||
| 68 | const char *m_strValue; | ||
| 69 | } m_ListItemProperties[MAX_INFO_COUNT]; | ||
| 70 | } INPUTSTREAM; | ||
| 71 | |||
| 72 | /*! | ||
| 73 | * @brief Array of stream IDs | ||
| 74 | */ | ||
| 75 | typedef struct INPUTSTREAM_IDS | ||
| 76 | { | ||
| 77 | static const unsigned int MAX_STREAM_COUNT = 32; | ||
| 78 | unsigned int m_streamCount; | ||
| 79 | unsigned int m_streamIds[MAX_STREAM_COUNT]; | ||
| 80 | } INPUTSTREAM_IDS; | ||
| 81 | |||
| 82 | /*! | ||
| 83 | * @brief stream properties | ||
| 84 | */ | ||
| 85 | typedef struct INPUTSTREAM_INFO | ||
| 86 | { | ||
| 87 | enum STREAM_TYPE | ||
| 88 | { | ||
| 89 | TYPE_NONE, | ||
| 90 | TYPE_VIDEO, | ||
| 91 | TYPE_AUDIO, | ||
| 92 | TYPE_SUBTITLE, | ||
| 93 | TYPE_TELETEXT | ||
| 94 | } m_streamType; | ||
| 95 | |||
| 96 | char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ | ||
| 97 | char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ | ||
| 98 | unsigned int m_pID; /*!< @brief (required) physical index */ | ||
| 99 | unsigned int m_Bandwidth; /*!< @brief (optional) bandwidth of the stream (selectionstream info) */ | ||
| 100 | |||
| 101 | const uint8_t *m_ExtraData; | ||
| 102 | unsigned int m_ExtraSize; | ||
| 103 | |||
| 104 | char m_language[4]; /*!< @brief ISO 639 3-letter language code (empty string if undefined) */ | ||
| 105 | |||
| 106 | unsigned int m_FpsScale; /*!< @brief Scale of 1000 and a rate of 29970 will result in 29.97 fps */ | ||
| 107 | unsigned int m_FpsRate; | ||
| 108 | unsigned int m_Height; /*!< @brief height of the stream reported by the demuxer */ | ||
| 109 | unsigned int m_Width; /*!< @brief width of the stream reported by the demuxer */ | ||
| 110 | float m_Aspect; /*!< @brief display aspect of stream */ | ||
| 111 | |||
| 112 | unsigned int m_Channels; /*!< @brief (required) amount of channels */ | ||
| 113 | unsigned int m_SampleRate; /*!< @brief (required) sample rate */ | ||
| 114 | unsigned int m_BitRate; /*!< @brief (required) bit rate */ | ||
| 115 | unsigned int m_BitsPerSample; /*!< @brief (required) bits per sample */ | ||
| 116 | unsigned int m_BlockAlign; | ||
| 117 | } INPUTSTREAM_INFO; | ||
| 118 | |||
| 119 | /*! | ||
| 120 | * @brief Structure to transfer the methods from xbmc_inputstream_dll.h to XBMC | ||
| 121 | */ | ||
| 122 | typedef struct InputStreamAddonFunctions | ||
| 123 | { | ||
| 124 | bool (__cdecl* Open)(INPUTSTREAM&); | ||
| 125 | void (__cdecl* Close)(void); | ||
| 126 | const char* (__cdecl* GetPathList)(void); | ||
| 127 | struct INPUTSTREAM_CAPABILITIES (__cdecl* GetCapabilities)(void); | ||
| 128 | |||
| 129 | // IDemux | ||
| 130 | struct INPUTSTREAM_IDS (__cdecl* GetStreamIds)(); | ||
| 131 | struct INPUTSTREAM_INFO (__cdecl* GetStream)(int); | ||
| 132 | void (__cdecl* EnableStream)(int, bool); | ||
| 133 | void (__cdecl* EnableStreamAtPTS)(int, uint64_t); | ||
| 134 | void (__cdecl* DemuxReset)(void); | ||
| 135 | void (__cdecl* DemuxAbort)(void); | ||
| 136 | void (__cdecl* DemuxFlush)(void); | ||
| 137 | DemuxPacket* (__cdecl* DemuxRead)(void); | ||
| 138 | bool (__cdecl* DemuxSeekTime)(int, bool, double*); | ||
| 139 | void (__cdecl* DemuxSetSpeed)(int); | ||
| 140 | |||
| 141 | // IDisplayTime | ||
| 142 | int (__cdecl* GetTotalTime)(void); | ||
| 143 | int (__cdecl* GetTime)(void); | ||
| 144 | |||
| 145 | // IPosTime | ||
| 146 | bool (__cdecl* PosTime)(int); | ||
| 147 | |||
| 148 | // Seekable (mandatory) | ||
| 149 | bool (__cdecl* CanPauseStream)(void); | ||
| 150 | bool (__cdecl* CanSeekStream)(void); | ||
| 151 | |||
| 152 | int (__cdecl* ReadStream)(uint8_t*, unsigned int); | ||
| 153 | int64_t(__cdecl* SeekStream)(int64_t, int); | ||
| 154 | int64_t (__cdecl* PositionStream)(void); | ||
| 155 | int64_t (__cdecl* LengthStream)(void); | ||
| 156 | void (__cdecl* PauseStream)(double); | ||
| 157 | bool (__cdecl* IsRealTimeStream)(void); | ||
| 158 | } InputStreamAddonFunctions; | ||
| 159 | } | ||
| 160 | |||
| 161 | |||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h new file mode 100644 index 0000000..46e34a6 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h | |||
| @@ -0,0 +1,232 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2014 Team KODI | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with KODI; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <string> | ||
| 23 | #include <vector> | ||
| 24 | #include <string.h> | ||
| 25 | #include <stdlib.h> | ||
| 26 | #include <stdio.h> | ||
| 27 | #include "kodi_adsp_types.h" | ||
| 28 | #include "libXBMC_addon.h" | ||
| 29 | |||
| 30 | typedef void* ADSPHANDLE; | ||
| 31 | |||
| 32 | #ifdef _WIN32 | ||
| 33 | #define ADSP_HELPER_DLL "\\library.kodi.adsp\\libKODI_adsp" ADDON_HELPER_EXT | ||
| 34 | #else | ||
| 35 | #define ADSP_HELPER_DLL_NAME "libKODI_adsp-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 36 | #define ADSP_HELPER_DLL "/library.kodi.adsp/" ADSP_HELPER_DLL_NAME | ||
| 37 | #endif | ||
| 38 | |||
| 39 | class CAddonSoundPlay; | ||
| 40 | |||
| 41 | class CHelper_libKODI_adsp | ||
| 42 | { | ||
| 43 | public: | ||
| 44 | CHelper_libKODI_adsp(void) | ||
| 45 | { | ||
| 46 | m_libKODI_adsp = NULL; | ||
| 47 | m_Handle = NULL; | ||
| 48 | } | ||
| 49 | |||
| 50 | ~CHelper_libKODI_adsp(void) | ||
| 51 | { | ||
| 52 | if (m_libKODI_adsp) | ||
| 53 | { | ||
| 54 | ADSP_unregister_me(m_Handle, m_Callbacks); | ||
| 55 | dlclose(m_libKODI_adsp); | ||
| 56 | } | ||
| 57 | } | ||
| 58 | |||
| 59 | /*! | ||
| 60 | * @brief Resolve all callback methods | ||
| 61 | * @param handle Pointer to the add-on | ||
| 62 | * @return True when all methods were resolved, false otherwise. | ||
| 63 | */ | ||
| 64 | bool RegisterMe(void* handle) | ||
| 65 | { | ||
| 66 | m_Handle = handle; | ||
| 67 | |||
| 68 | std::string libBasePath; | ||
| 69 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 70 | libBasePath += ADSP_HELPER_DLL; | ||
| 71 | |||
| 72 | #if defined(ANDROID) | ||
| 73 | struct stat st; | ||
| 74 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 75 | { | ||
| 76 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 77 | libBasePath = tempbin + "/" + ADSP_HELPER_DLL_NAME; | ||
| 78 | } | ||
| 79 | #endif | ||
| 80 | |||
| 81 | m_libKODI_adsp = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 82 | if (m_libKODI_adsp == NULL) | ||
| 83 | { | ||
| 84 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 85 | return false; | ||
| 86 | } | ||
| 87 | |||
| 88 | ADSP_register_me = (void* (*)(void *HANDLE)) | ||
| 89 | dlsym(m_libKODI_adsp, "ADSP_register_me"); | ||
| 90 | if (ADSP_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 91 | |||
| 92 | ADSP_unregister_me = (void (*)(void* HANDLE, void* CB)) | ||
| 93 | dlsym(m_libKODI_adsp, "ADSP_unregister_me"); | ||
| 94 | if (ADSP_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 95 | |||
| 96 | ADSP_add_menu_hook = (void (*)(void* HANDLE, void* CB, AE_DSP_MENUHOOK *hook)) | ||
| 97 | dlsym(m_libKODI_adsp, "ADSP_add_menu_hook"); | ||
| 98 | if (ADSP_add_menu_hook == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 99 | |||
| 100 | ADSP_remove_menu_hook = (void (*)(void* HANDLE, void* CB, AE_DSP_MENUHOOK *hook)) | ||
| 101 | dlsym(m_libKODI_adsp, "ADSP_remove_menu_hook"); | ||
| 102 | if (ADSP_remove_menu_hook == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 103 | |||
| 104 | ADSP_register_mode = (void (*)(void *HANDLE, void* CB, AE_DSP_MODES::AE_DSP_MODE *modes)) | ||
| 105 | dlsym(m_libKODI_adsp, "ADSP_register_mode"); | ||
| 106 | if (ADSP_register_mode == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 107 | |||
| 108 | ADSP_unregister_mode = (void (*)(void* HANDLE, void* CB, AE_DSP_MODES::AE_DSP_MODE *modes)) | ||
| 109 | dlsym(m_libKODI_adsp, "ADSP_unregister_mode"); | ||
| 110 | if (ADSP_unregister_mode == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 111 | |||
| 112 | ADSP_get_sound_play = (CAddonSoundPlay* (*)(void *HANDLE, void *CB, const char *filename)) | ||
| 113 | dlsym(m_libKODI_adsp, "ADSP_get_sound_play"); | ||
| 114 | if (ADSP_get_sound_play == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 115 | |||
| 116 | ADSP_release_sound_play = (void (*)(CAddonSoundPlay* p)) | ||
| 117 | dlsym(m_libKODI_adsp, "ADSP_release_sound_play"); | ||
| 118 | if (ADSP_release_sound_play == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 119 | |||
| 120 | m_Callbacks = ADSP_register_me(m_Handle); | ||
| 121 | return m_Callbacks != NULL; | ||
| 122 | } | ||
| 123 | |||
| 124 | /*! | ||
| 125 | * @brief Add or replace a menu hook for the context menu for this add-on | ||
| 126 | * @param hook The hook to add | ||
| 127 | */ | ||
| 128 | void AddMenuHook(AE_DSP_MENUHOOK* hook) | ||
| 129 | { | ||
| 130 | return ADSP_add_menu_hook(m_Handle, m_Callbacks, hook); | ||
| 131 | } | ||
| 132 | |||
| 133 | /*! | ||
| 134 | * @brief Remove a menu hook for the context menu for this add-on | ||
| 135 | * @param hook The hook to remove | ||
| 136 | */ | ||
| 137 | void RemoveMenuHook(AE_DSP_MENUHOOK* hook) | ||
| 138 | { | ||
| 139 | return ADSP_remove_menu_hook(m_Handle, m_Callbacks, hook); | ||
| 140 | } | ||
| 141 | |||
| 142 | /*! | ||
| 143 | * @brief Add or replace master mode information inside audio dsp database. | ||
| 144 | * Becomes identifier written inside mode to iModeID if it was 0 (undefined) | ||
| 145 | * @param mode The master mode to add or update inside database | ||
| 146 | */ | ||
| 147 | void RegisterMode(AE_DSP_MODES::AE_DSP_MODE* mode) | ||
| 148 | { | ||
| 149 | return ADSP_register_mode(m_Handle, m_Callbacks, mode); | ||
| 150 | } | ||
| 151 | |||
| 152 | /*! | ||
| 153 | * @brief Remove a master mode from audio dsp database | ||
| 154 | * @param mode The Mode to remove | ||
| 155 | */ | ||
| 156 | void UnregisterMode(AE_DSP_MODES::AE_DSP_MODE* mode) | ||
| 157 | { | ||
| 158 | return ADSP_unregister_mode(m_Handle, m_Callbacks, mode); | ||
| 159 | } | ||
| 160 | |||
| 161 | /*! | ||
| 162 | * @brief Open a sound playing class | ||
| 163 | * @param filename The wav filename to open | ||
| 164 | */ | ||
| 165 | CAddonSoundPlay* GetSoundPlay(const char *filename) | ||
| 166 | { | ||
| 167 | return ADSP_get_sound_play(m_Handle, m_Callbacks, filename); | ||
| 168 | } | ||
| 169 | |||
| 170 | /*! | ||
| 171 | * @brief Remove a played file class | ||
| 172 | * @param p The playback to remove | ||
| 173 | */ | ||
| 174 | void ReleaseSoundPlay(CAddonSoundPlay* p) | ||
| 175 | { | ||
| 176 | return ADSP_release_sound_play(p); | ||
| 177 | } | ||
| 178 | |||
| 179 | protected: | ||
| 180 | void* (*ADSP_register_me)(void*); | ||
| 181 | |||
| 182 | void (*ADSP_unregister_me)(void*, void*); | ||
| 183 | void (*ADSP_add_menu_hook)(void*, void*, AE_DSP_MENUHOOK*); | ||
| 184 | void (*ADSP_remove_menu_hook)(void*, void*, AE_DSP_MENUHOOK*); | ||
| 185 | void (*ADSP_register_mode)(void*, void*, AE_DSP_MODES::AE_DSP_MODE*); | ||
| 186 | void (*ADSP_unregister_mode)(void*, void*, AE_DSP_MODES::AE_DSP_MODE*); | ||
| 187 | CAddonSoundPlay* (*ADSP_get_sound_play)(void*, void*, const char *); | ||
| 188 | void (*ADSP_release_sound_play)(CAddonSoundPlay*); | ||
| 189 | |||
| 190 | private: | ||
| 191 | void* m_libKODI_adsp; | ||
| 192 | void* m_Handle; | ||
| 193 | void* m_Callbacks; | ||
| 194 | struct cb_array | ||
| 195 | { | ||
| 196 | const char* libPath; | ||
| 197 | }; | ||
| 198 | }; | ||
| 199 | |||
| 200 | class CAddonSoundPlay | ||
| 201 | { | ||
| 202 | public: | ||
| 203 | CAddonSoundPlay(void *hdl, void *cb, const char *filename); | ||
| 204 | virtual ~CAddonSoundPlay(); | ||
| 205 | |||
| 206 | /*! play the sound this object represents */ | ||
| 207 | virtual void Play(); | ||
| 208 | |||
| 209 | /*! stop playing the sound this object represents */ | ||
| 210 | virtual void Stop(); | ||
| 211 | |||
| 212 | /*! return true if the sound is currently playing */ | ||
| 213 | virtual bool IsPlaying(); | ||
| 214 | |||
| 215 | /*! set the playback channel position of this sound, AE_DSP_CH_INVALID for all */ | ||
| 216 | virtual void SetChannel(AE_DSP_CHANNEL channel); | ||
| 217 | |||
| 218 | /*! get the current playback volume of this sound, AE_DSP_CH_INVALID for all */ | ||
| 219 | virtual AE_DSP_CHANNEL GetChannel(); | ||
| 220 | |||
| 221 | /*! set the playback volume of this sound */ | ||
| 222 | virtual void SetVolume(float volume); | ||
| 223 | |||
| 224 | /*! get the current playback volume of this sound */ | ||
| 225 | virtual float GetVolume(); | ||
| 226 | |||
| 227 | private: | ||
| 228 | std::string m_Filename; | ||
| 229 | void *m_Handle; | ||
| 230 | void *m_cb; | ||
| 231 | ADSPHANDLE m_PlayHandle; | ||
| 232 | }; | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h new file mode 100644 index 0000000..f541637 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h | |||
| @@ -0,0 +1,324 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2014 Team KODI | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with KODI; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <stdio.h> | ||
| 23 | #include <stdlib.h> | ||
| 24 | #include <string> | ||
| 25 | #include <string.h> | ||
| 26 | #include <vector> | ||
| 27 | |||
| 28 | #include "kodi_audioengine_types.h" | ||
| 29 | #ifdef BUILD_KODI_ADDON | ||
| 30 | #include "kodi/AudioEngine/AEChannelData.h" | ||
| 31 | #include "kodi/AudioEngine/AEChannelInfo.h" | ||
| 32 | #include "kodi/AudioEngine/AEStreamData.h" | ||
| 33 | #else | ||
| 34 | #include "cores/AudioEngine/Utils/AEChannelData.h" | ||
| 35 | #include "cores/AudioEngine/Utils/AEChannelInfo.h" | ||
| 36 | #include "cores/AudioEngine/Utils/AEStreamData.h" | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #include "libXBMC_addon.h" | ||
| 40 | |||
| 41 | #ifdef _WIN32 | ||
| 42 | #define AUDIOENGINE_HELPER_DLL "\\library.kodi.audioengine\\libKODI_audioengine" ADDON_HELPER_EXT | ||
| 43 | #else | ||
| 44 | #define AUDIOENGINE_HELPER_DLL_NAME "libKODI_audioengine-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 45 | #define AUDIOENGINE_HELPER_DLL "/library.kodi.audioengine/" AUDIOENGINE_HELPER_DLL_NAME | ||
| 46 | #endif | ||
| 47 | |||
| 48 | class CAddonAEStream; | ||
| 49 | |||
| 50 | class CHelper_libKODI_audioengine | ||
| 51 | { | ||
| 52 | public: | ||
| 53 | CHelper_libKODI_audioengine(void) | ||
| 54 | { | ||
| 55 | m_libKODI_audioengine = NULL; | ||
| 56 | m_Handle = NULL; | ||
| 57 | } | ||
| 58 | |||
| 59 | ~CHelper_libKODI_audioengine(void) | ||
| 60 | { | ||
| 61 | if (m_libKODI_audioengine) | ||
| 62 | { | ||
| 63 | AudioEngine_unregister_me(m_Handle, m_Callbacks); | ||
| 64 | dlclose(m_libKODI_audioengine); | ||
| 65 | } | ||
| 66 | } | ||
| 67 | |||
| 68 | /*! | ||
| 69 | * @brief Resolve all callback methods | ||
| 70 | * @param handle Pointer to the add-on | ||
| 71 | * @return True when all methods were resolved, false otherwise. | ||
| 72 | */ | ||
| 73 | bool RegisterMe(void* handle) | ||
| 74 | { | ||
| 75 | m_Handle = handle; | ||
| 76 | |||
| 77 | std::string libBasePath; | ||
| 78 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 79 | libBasePath += AUDIOENGINE_HELPER_DLL; | ||
| 80 | |||
| 81 | #if defined(ANDROID) | ||
| 82 | struct stat st; | ||
| 83 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 84 | { | ||
| 85 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 86 | libBasePath = tempbin + "/" + AUDIOENGINE_HELPER_DLL; | ||
| 87 | } | ||
| 88 | #endif | ||
| 89 | |||
| 90 | m_libKODI_audioengine = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 91 | if (m_libKODI_audioengine == NULL) | ||
| 92 | { | ||
| 93 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 94 | return false; | ||
| 95 | } | ||
| 96 | |||
| 97 | AudioEngine_register_me = (void* (*)(void *HANDLE)) | ||
| 98 | dlsym(m_libKODI_audioengine, "AudioEngine_register_me"); | ||
| 99 | if (AudioEngine_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 100 | |||
| 101 | AudioEngine_unregister_me = (void(*)(void* HANDLE, void* CB)) | ||
| 102 | dlsym(m_libKODI_audioengine, "AudioEngine_unregister_me"); | ||
| 103 | if (AudioEngine_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 104 | |||
| 105 | AudioEngine_MakeStream = (CAddonAEStream* (*)(void*, void*, AudioEngineFormat, unsigned int)) | ||
| 106 | dlsym(m_libKODI_audioengine, "AudioEngine_make_stream"); | ||
| 107 | if (AudioEngine_MakeStream == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 108 | |||
| 109 | AudioEngine_FreeStream = (void(*)(CAddonAEStream*)) | ||
| 110 | dlsym(m_libKODI_audioengine, "AudioEngine_free_stream"); | ||
| 111 | if (AudioEngine_FreeStream == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 112 | |||
| 113 | AudioEngine_GetCurrentSinkFormat = (bool(*)(void*, void*, AudioEngineFormat*)) | ||
| 114 | dlsym(m_libKODI_audioengine, "AudioEngine_get_current_sink_Format"); | ||
| 115 | if (AudioEngine_GetCurrentSinkFormat == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 116 | |||
| 117 | m_Callbacks = AudioEngine_register_me(m_Handle); | ||
| 118 | return m_Callbacks != NULL; | ||
| 119 | } | ||
| 120 | |||
| 121 | /** | ||
| 122 | * Creates and returns a new handle to an IAEStream in the format specified, this function should never fail | ||
| 123 | * @param DataFormat The data format the incoming audio will be in (eg, AE_FMT_S16LE) | ||
| 124 | * @param SampleRate The sample rate of the audio data (eg, 48000) | ||
| 125 | * @param ChannelLayout The order of the channels in the audio data | ||
| 126 | * @param Options A bit field of stream options (see: enum AEStreamOptions) | ||
| 127 | * @return a new Handle to an IAEStream that will accept data in the requested format | ||
| 128 | */ | ||
| 129 | CAddonAEStream* MakeStream(AudioEngineFormat Format, unsigned int Options = 0) | ||
| 130 | { | ||
| 131 | return AudioEngine_MakeStream(m_Handle, m_Callbacks, Format, Options); | ||
| 132 | } | ||
| 133 | |||
| 134 | /** | ||
| 135 | * This method will remove the specifyed stream from the engine. | ||
| 136 | * For OSX/IOS this is essential to reconfigure the audio output. | ||
| 137 | * @param stream The stream to be altered | ||
| 138 | * @return NULL | ||
| 139 | */ | ||
| 140 | void FreeStream(CAddonAEStream **Stream) | ||
| 141 | { | ||
| 142 | AudioEngine_FreeStream(*Stream); | ||
| 143 | *Stream = NULL; | ||
| 144 | } | ||
| 145 | |||
| 146 | /** | ||
| 147 | * Get the current sink data format | ||
| 148 | * | ||
| 149 | * @param Current sink data format. For more details see AudioEngineFormat. | ||
| 150 | * @return Returns true on success, else false. | ||
| 151 | */ | ||
| 152 | bool GetCurrentSinkFormat(AudioEngineFormat &SinkFormat) | ||
| 153 | { | ||
| 154 | return AudioEngine_GetCurrentSinkFormat(m_Handle, m_Callbacks, &SinkFormat); | ||
| 155 | } | ||
| 156 | |||
| 157 | protected: | ||
| 158 | void* (*AudioEngine_register_me)(void*); | ||
| 159 | void (*AudioEngine_unregister_me)(void*, void*); | ||
| 160 | CAddonAEStream* (*AudioEngine_MakeStream)(void*, void*, AudioEngineFormat, unsigned int); | ||
| 161 | bool (*AudioEngine_GetCurrentSinkFormat)(void*, void*, AudioEngineFormat *SinkFormat); | ||
| 162 | void (*AudioEngine_FreeStream)(CAddonAEStream*); | ||
| 163 | |||
| 164 | private: | ||
| 165 | void* m_libKODI_audioengine; | ||
| 166 | void* m_Handle; | ||
| 167 | void* m_Callbacks; | ||
| 168 | struct cb_array | ||
| 169 | { | ||
| 170 | const char* libPath; | ||
| 171 | }; | ||
| 172 | }; | ||
| 173 | |||
| 174 | // Audio Engine Stream Class | ||
| 175 | class CAddonAEStream | ||
| 176 | { | ||
| 177 | public: | ||
| 178 | CAddonAEStream(void *Addon, void *Callbacks, AEStreamHandle *StreamHandle); | ||
| 179 | virtual ~CAddonAEStream(); | ||
| 180 | |||
| 181 | /** | ||
| 182 | * Returns the amount of space available in the stream | ||
| 183 | * @return The number of bytes AddData will consume | ||
| 184 | */ | ||
| 185 | virtual unsigned int GetSpace(); | ||
| 186 | |||
| 187 | /** | ||
| 188 | * Add planar or interleaved PCM data to the stream | ||
| 189 | * @param Data array of pointers to the planes | ||
| 190 | * @param Offset to frame in frames | ||
| 191 | * @param Frames number of frames | ||
| 192 | * @return The number of frames consumed | ||
| 193 | */ | ||
| 194 | virtual unsigned int AddData(uint8_t* const *Data, unsigned int Offset, unsigned int Frames); | ||
| 195 | |||
| 196 | /** | ||
| 197 | * Returns the time in seconds that it will take | ||
| 198 | * for the next added packet to be heard from the speakers. | ||
| 199 | * @return seconds | ||
| 200 | */ | ||
| 201 | virtual double GetDelay(); | ||
| 202 | |||
| 203 | /** | ||
| 204 | * Returns if the stream is buffering | ||
| 205 | * @return True if the stream is buffering | ||
| 206 | */ | ||
| 207 | virtual bool IsBuffering(); | ||
| 208 | |||
| 209 | /** | ||
| 210 | * Returns the time in seconds that it will take | ||
| 211 | * to underrun the cache if no sample is added. | ||
| 212 | * @return seconds | ||
| 213 | */ | ||
| 214 | virtual double GetCacheTime(); | ||
| 215 | |||
| 216 | /** | ||
| 217 | * Returns the total time in seconds of the cache | ||
| 218 | * @return seconds | ||
| 219 | */ | ||
| 220 | virtual double GetCacheTotal(); | ||
| 221 | |||
| 222 | /** | ||
| 223 | * Pauses the stream playback | ||
| 224 | */ | ||
| 225 | virtual void Pause(); | ||
| 226 | |||
| 227 | /** | ||
| 228 | * Resumes the stream after pausing | ||
| 229 | */ | ||
| 230 | virtual void Resume(); | ||
| 231 | |||
| 232 | /** | ||
| 233 | * Start draining the stream | ||
| 234 | * @note Once called AddData will not consume more data. | ||
| 235 | */ | ||
| 236 | virtual void Drain(bool Wait); | ||
| 237 | |||
| 238 | /** | ||
| 239 | * Returns true if the is stream draining | ||
| 240 | */ | ||
| 241 | virtual bool IsDraining(); | ||
| 242 | |||
| 243 | /** | ||
| 244 | * Returns true if the is stream has finished draining | ||
| 245 | */ | ||
| 246 | virtual bool IsDrained(); | ||
| 247 | |||
| 248 | /** | ||
| 249 | * Flush all buffers dropping the audio data | ||
| 250 | */ | ||
| 251 | virtual void Flush(); | ||
| 252 | |||
| 253 | /** | ||
| 254 | * Return the stream's current volume level | ||
| 255 | * @return The volume level between 0.0 and 1.0 | ||
| 256 | */ | ||
| 257 | virtual float GetVolume(); | ||
| 258 | |||
| 259 | /** | ||
| 260 | * Set the stream's volume level | ||
| 261 | * @param volume The new volume level between 0.0 and 1.0 | ||
| 262 | */ | ||
| 263 | virtual void SetVolume(float Volume); | ||
| 264 | |||
| 265 | /** | ||
| 266 | * Gets the stream's volume amplification in linear units. | ||
| 267 | * @return The volume amplification factor between 1.0 and 1000.0 | ||
| 268 | */ | ||
| 269 | virtual float GetAmplification(); | ||
| 270 | |||
| 271 | /** | ||
| 272 | * Sets the stream's volume amplification in linear units. | ||
| 273 | * @param The volume amplification factor between 1.0 and 1000.0 | ||
| 274 | */ | ||
| 275 | virtual void SetAmplification(float Amplify); | ||
| 276 | |||
| 277 | /** | ||
| 278 | * Returns the size of one audio frame in bytes (channelCount * resolution) | ||
| 279 | * @return The size in bytes of one frame | ||
| 280 | */ | ||
| 281 | virtual const unsigned int GetFrameSize() const; | ||
| 282 | |||
| 283 | /** | ||
| 284 | * Returns the number of channels the stream is configured to accept | ||
| 285 | * @return The channel count | ||
| 286 | */ | ||
| 287 | virtual const unsigned int GetChannelCount() const; | ||
| 288 | |||
| 289 | /** | ||
| 290 | * Returns the stream's sample rate, if the stream is using a dynamic sample rate, this value will NOT reflect any changes made by calls to SetResampleRatio() | ||
| 291 | * @return The stream's sample rate (eg, 48000) | ||
| 292 | */ | ||
| 293 | virtual const unsigned int GetSampleRate() const; | ||
| 294 | |||
| 295 | /** | ||
| 296 | * Return the data format the stream has been configured with | ||
| 297 | * @return The stream's data format (eg, AE_FMT_S16LE) | ||
| 298 | */ | ||
| 299 | virtual const AEDataFormat GetDataFormat() const; | ||
| 300 | |||
| 301 | /** | ||
| 302 | * Return the resample ratio | ||
| 303 | * @note This will return an undefined value if the stream is not resampling | ||
| 304 | * @return the current resample ratio or undefined if the stream is not resampling | ||
| 305 | */ | ||
| 306 | virtual double GetResampleRatio(); | ||
| 307 | |||
| 308 | /** | ||
| 309 | * Sets the resample ratio | ||
| 310 | * @note This function may return false if the stream is not resampling, if you wish to use this be sure to set the AESTREAM_FORCE_RESAMPLE option | ||
| 311 | * @param ratio the new sample rate ratio, calculated by ((double)desiredRate / (double)GetSampleRate()) | ||
| 312 | */ | ||
| 313 | virtual void SetResampleRatio(double Ratio); | ||
| 314 | |||
| 315 | /** | ||
| 316 | * Sginal a clock change | ||
| 317 | */ | ||
| 318 | virtual void Discontinuity(); | ||
| 319 | |||
| 320 | private: | ||
| 321 | AEStreamHandle *m_StreamHandle; | ||
| 322 | void *m_Callbacks; | ||
| 323 | void *m_AddonHandle; | ||
| 324 | }; | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h new file mode 100644 index 0000000..bdaeb4c --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h | |||
| @@ -0,0 +1,845 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2013 Team XBMC | ||
| 4 | * http://xbmc.org | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with XBMC; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <string> | ||
| 23 | #include <vector> | ||
| 24 | #include <string.h> | ||
| 25 | #include <stdlib.h> | ||
| 26 | #include <stdio.h> | ||
| 27 | #include "libXBMC_addon.h" | ||
| 28 | |||
| 29 | typedef void* GUIHANDLE; | ||
| 30 | |||
| 31 | #ifdef _WIN32 | ||
| 32 | #define GUI_HELPER_DLL "\\library.kodi.guilib\\libKODI_guilib" ADDON_HELPER_EXT | ||
| 33 | #else | ||
| 34 | #define GUI_HELPER_DLL_NAME "libKODI_guilib-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 35 | #define GUI_HELPER_DLL "/library.kodi.guilib/" GUI_HELPER_DLL_NAME | ||
| 36 | #endif | ||
| 37 | |||
| 38 | /* current ADDONGUI API version */ | ||
| 39 | #define KODI_GUILIB_API_VERSION "5.11.0" | ||
| 40 | |||
| 41 | /* min. ADDONGUI API version */ | ||
| 42 | #define KODI_GUILIB_MIN_API_VERSION "5.10.0" | ||
| 43 | |||
| 44 | #define ADDON_ACTION_PREVIOUS_MENU 10 | ||
| 45 | #define ADDON_ACTION_CLOSE_DIALOG 51 | ||
| 46 | #define ADDON_ACTION_NAV_BACK 92 | ||
| 47 | |||
| 48 | class CAddonGUIWindow; | ||
| 49 | class CAddonGUISpinControl; | ||
| 50 | class CAddonGUIRadioButton; | ||
| 51 | class CAddonGUIProgressControl; | ||
| 52 | class CAddonListItem; | ||
| 53 | class CAddonGUIRenderingControl; | ||
| 54 | class CAddonGUISliderControl; | ||
| 55 | class CAddonGUISettingsSliderControl; | ||
| 56 | |||
| 57 | class CHelper_libKODI_guilib | ||
| 58 | { | ||
| 59 | public: | ||
| 60 | CHelper_libKODI_guilib() | ||
| 61 | { | ||
| 62 | m_libKODI_guilib = NULL; | ||
| 63 | m_Handle = NULL; | ||
| 64 | } | ||
| 65 | |||
| 66 | ~CHelper_libKODI_guilib() | ||
| 67 | { | ||
| 68 | if (m_libKODI_guilib) | ||
| 69 | { | ||
| 70 | GUI_unregister_me(m_Handle, m_Callbacks); | ||
| 71 | dlclose(m_libKODI_guilib); | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | bool RegisterMe(void *Handle) | ||
| 76 | { | ||
| 77 | m_Handle = Handle; | ||
| 78 | |||
| 79 | std::string libBasePath; | ||
| 80 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 81 | libBasePath += GUI_HELPER_DLL; | ||
| 82 | |||
| 83 | #if defined(ANDROID) | ||
| 84 | struct stat st; | ||
| 85 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 86 | { | ||
| 87 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 88 | libBasePath = tempbin + "/" + GUI_HELPER_DLL_NAME; | ||
| 89 | } | ||
| 90 | #endif | ||
| 91 | |||
| 92 | m_libKODI_guilib = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 93 | if (m_libKODI_guilib == NULL) | ||
| 94 | { | ||
| 95 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 96 | return false; | ||
| 97 | } | ||
| 98 | |||
| 99 | GUI_register_me = (void* (*)(void *HANDLE)) | ||
| 100 | dlsym(m_libKODI_guilib, "GUI_register_me"); | ||
| 101 | if (GUI_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 102 | |||
| 103 | GUI_unregister_me = (void (*)(void *HANDLE, void *CB)) | ||
| 104 | dlsym(m_libKODI_guilib, "GUI_unregister_me"); | ||
| 105 | if (GUI_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 106 | |||
| 107 | GUI_lock = (void (*)(void *HANDLE, void *CB)) | ||
| 108 | dlsym(m_libKODI_guilib, "GUI_lock"); | ||
| 109 | if (GUI_lock == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 110 | |||
| 111 | GUI_unlock = (void (*)(void *HANDLE, void *CB)) | ||
| 112 | dlsym(m_libKODI_guilib, "GUI_unlock"); | ||
| 113 | if (GUI_unlock == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 114 | |||
| 115 | GUI_get_screen_height = (int (*)(void *HANDLE, void *CB)) | ||
| 116 | dlsym(m_libKODI_guilib, "GUI_get_screen_height"); | ||
| 117 | if (GUI_get_screen_height == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 118 | |||
| 119 | GUI_get_screen_width = (int (*)(void *HANDLE, void *CB)) | ||
| 120 | dlsym(m_libKODI_guilib, "GUI_get_screen_width"); | ||
| 121 | if (GUI_get_screen_width == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 122 | |||
| 123 | GUI_get_video_resolution = (int (*)(void *HANDLE, void *CB)) | ||
| 124 | dlsym(m_libKODI_guilib, "GUI_get_video_resolution"); | ||
| 125 | if (GUI_get_video_resolution == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 126 | |||
| 127 | GUI_Window_create = (CAddonGUIWindow* (*)(void *HANDLE, void *CB, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog)) | ||
| 128 | dlsym(m_libKODI_guilib, "GUI_Window_create"); | ||
| 129 | if (GUI_Window_create == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 130 | |||
| 131 | GUI_Window_destroy = (void (*)(CAddonGUIWindow* p)) | ||
| 132 | dlsym(m_libKODI_guilib, "GUI_Window_destroy"); | ||
| 133 | if (GUI_Window_destroy == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 134 | |||
| 135 | GUI_control_get_spin = (CAddonGUISpinControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 136 | dlsym(m_libKODI_guilib, "GUI_control_get_spin"); | ||
| 137 | if (GUI_control_get_spin == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 138 | |||
| 139 | GUI_control_release_spin = (void (*)(CAddonGUISpinControl* p)) | ||
| 140 | dlsym(m_libKODI_guilib, "GUI_control_release_spin"); | ||
| 141 | if (GUI_control_release_spin == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 142 | |||
| 143 | GUI_control_get_radiobutton = (CAddonGUIRadioButton* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 144 | dlsym(m_libKODI_guilib, "GUI_control_get_radiobutton"); | ||
| 145 | if (GUI_control_get_radiobutton == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 146 | |||
| 147 | GUI_control_release_radiobutton = (void (*)(CAddonGUIRadioButton* p)) | ||
| 148 | dlsym(m_libKODI_guilib, "GUI_control_release_radiobutton"); | ||
| 149 | if (GUI_control_release_radiobutton == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 150 | |||
| 151 | GUI_control_get_progress = (CAddonGUIProgressControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 152 | dlsym(m_libKODI_guilib, "GUI_control_get_progress"); | ||
| 153 | if (GUI_control_get_progress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 154 | |||
| 155 | GUI_control_release_progress = (void (*)(CAddonGUIProgressControl* p)) | ||
| 156 | dlsym(m_libKODI_guilib, "GUI_control_release_progress"); | ||
| 157 | if (GUI_control_release_progress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 158 | |||
| 159 | GUI_ListItem_create = (CAddonListItem* (*)(void *HANDLE, void *CB, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path)) | ||
| 160 | dlsym(m_libKODI_guilib, "GUI_ListItem_create"); | ||
| 161 | if (GUI_ListItem_create == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 162 | |||
| 163 | GUI_ListItem_destroy = (void (*)(CAddonListItem* p)) | ||
| 164 | dlsym(m_libKODI_guilib, "GUI_ListItem_destroy"); | ||
| 165 | if (GUI_ListItem_destroy == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 166 | |||
| 167 | GUI_control_get_rendering = (CAddonGUIRenderingControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 168 | dlsym(m_libKODI_guilib, "GUI_control_get_rendering"); | ||
| 169 | if (GUI_control_get_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 170 | |||
| 171 | GUI_control_release_rendering = (void (*)(CAddonGUIRenderingControl* p)) | ||
| 172 | dlsym(m_libKODI_guilib, "GUI_control_release_rendering"); | ||
| 173 | if (GUI_control_release_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 174 | |||
| 175 | GUI_control_get_slider = (CAddonGUISliderControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 176 | dlsym(m_libKODI_guilib, "GUI_control_get_slider"); | ||
| 177 | if (GUI_control_get_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 178 | |||
| 179 | GUI_control_release_slider = (void (*)(CAddonGUISliderControl* p)) | ||
| 180 | dlsym(m_libKODI_guilib, "GUI_control_release_slider"); | ||
| 181 | if (GUI_control_release_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 182 | |||
| 183 | GUI_control_get_settings_slider = (CAddonGUISettingsSliderControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 184 | dlsym(m_libKODI_guilib, "GUI_control_get_settings_slider"); | ||
| 185 | if (GUI_control_get_settings_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 186 | |||
| 187 | GUI_control_release_settings_slider = (void (*)(CAddonGUISettingsSliderControl* p)) | ||
| 188 | dlsym(m_libKODI_guilib, "GUI_control_release_settings_slider"); | ||
| 189 | if (GUI_control_release_settings_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 190 | |||
| 191 | GUI_dialog_keyboard_show_and_get_input_with_head = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs)) | ||
| 192 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_input_with_head"); | ||
| 193 | if (GUI_dialog_keyboard_show_and_get_input_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 194 | |||
| 195 | GUI_dialog_keyboard_show_and_get_input = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs)) | ||
| 196 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_input"); | ||
| 197 | if (GUI_dialog_keyboard_show_and_get_input == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 198 | |||
| 199 | GUI_dialog_keyboard_show_and_get_new_password_with_head = (bool (*)(void *HANDLE, void *CB, char &newPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs)) | ||
| 200 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_new_password_with_head"); | ||
| 201 | if (GUI_dialog_keyboard_show_and_get_new_password_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 202 | |||
| 203 | GUI_dialog_keyboard_show_and_get_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs)) | ||
| 204 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_new_password"); | ||
| 205 | if (GUI_dialog_keyboard_show_and_get_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 206 | |||
| 207 | GUI_dialog_keyboard_show_and_verify_new_password_with_head = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs)) | ||
| 208 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_verify_new_password_with_head"); | ||
| 209 | if (GUI_dialog_keyboard_show_and_verify_new_password_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 210 | |||
| 211 | GUI_dialog_keyboard_show_and_verify_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs)) | ||
| 212 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_verify_new_password"); | ||
| 213 | if (GUI_dialog_keyboard_show_and_verify_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 214 | |||
| 215 | GUI_dialog_keyboard_show_and_verify_password = (int (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs)) | ||
| 216 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_verify_password"); | ||
| 217 | if (GUI_dialog_keyboard_show_and_verify_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 218 | |||
| 219 | GUI_dialog_keyboard_show_and_get_filter = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs)) | ||
| 220 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_filter"); | ||
| 221 | if (GUI_dialog_keyboard_show_and_get_filter == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 222 | |||
| 223 | GUI_dialog_keyboard_send_text_to_active_keyboard = (bool (*)(void *HANDLE, void *CB, const char *aTextString, bool closeKeyboard)) | ||
| 224 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_send_text_to_active_keyboard"); | ||
| 225 | if (GUI_dialog_keyboard_send_text_to_active_keyboard == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 226 | |||
| 227 | GUI_dialog_keyboard_is_activated = (bool (*)(void *HANDLE, void *CB)) | ||
| 228 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_is_activated"); | ||
| 229 | if (GUI_dialog_keyboard_is_activated == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 230 | |||
| 231 | GUI_dialog_numeric_show_and_verify_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize)) | ||
| 232 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_verify_new_password"); | ||
| 233 | if (GUI_dialog_numeric_show_and_verify_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 234 | |||
| 235 | GUI_dialog_numeric_show_and_verify_password = (int (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries)) | ||
| 236 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_verify_password"); | ||
| 237 | if (GUI_dialog_numeric_show_and_verify_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 238 | |||
| 239 | GUI_dialog_numeric_show_and_verify_input = (bool (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput)) | ||
| 240 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_verify_input"); | ||
| 241 | if (GUI_dialog_numeric_show_and_verify_input == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 242 | |||
| 243 | GUI_dialog_numeric_show_and_get_time = (bool (*)(void *HANDLE, void *CB, tm &time, const char *strHeading)) | ||
| 244 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_time"); | ||
| 245 | if (GUI_dialog_numeric_show_and_get_time == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 246 | |||
| 247 | GUI_dialog_numeric_show_and_get_date = (bool (*)(void *HANDLE, void *CB, tm &date, const char *strHeading)) | ||
| 248 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_date"); | ||
| 249 | if (GUI_dialog_numeric_show_and_get_date == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 250 | |||
| 251 | GUI_dialog_numeric_show_and_get_ipaddress = (bool (*)(void *HANDLE, void *CB, char &IPAddress, unsigned int iMaxStringSize, const char *strHeading)) | ||
| 252 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_ipaddress"); | ||
| 253 | if (GUI_dialog_numeric_show_and_get_ipaddress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 254 | |||
| 255 | GUI_dialog_numeric_show_and_get_number = (bool (*)(void *HANDLE, void *CB, char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs)) | ||
| 256 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_number"); | ||
| 257 | if (GUI_dialog_numeric_show_and_get_number == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 258 | |||
| 259 | GUI_dialog_numeric_show_and_get_seconds = (bool (*)(void *HANDLE, void *CB, char &strTime, unsigned int iMaxStringSize, const char *strHeading)) | ||
| 260 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_seconds"); | ||
| 261 | if (GUI_dialog_numeric_show_and_get_seconds == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 262 | |||
| 263 | GUI_dialog_filebrowser_show_and_get_file = (bool (*)(void *HANDLE, void *CB, const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList)) | ||
| 264 | dlsym(m_libKODI_guilib, "GUI_dialog_filebrowser_show_and_get_file"); | ||
| 265 | if (GUI_dialog_filebrowser_show_and_get_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 266 | |||
| 267 | GUI_dialog_ok_show_and_get_input_single_text = (void (*)(void *HANDLE, void *CB, const char *heading, const char *text)) | ||
| 268 | dlsym(m_libKODI_guilib, "GUI_dialog_ok_show_and_get_input_single_text"); | ||
| 269 | if (GUI_dialog_ok_show_and_get_input_single_text == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 270 | |||
| 271 | GUI_dialog_ok_show_and_get_input_line_text = (void (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2)) | ||
| 272 | dlsym(m_libKODI_guilib, "GUI_dialog_ok_show_and_get_input_line_text"); | ||
| 273 | if (GUI_dialog_ok_show_and_get_input_line_text == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 274 | |||
| 275 | GUI_dialog_yesno_show_and_get_input_singletext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel)) | ||
| 276 | dlsym(m_libKODI_guilib, "GUI_dialog_yesno_show_and_get_input_singletext"); | ||
| 277 | if (GUI_dialog_yesno_show_and_get_input_singletext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 278 | |||
| 279 | GUI_dialog_yesno_show_and_get_input_linetext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel)) | ||
| 280 | dlsym(m_libKODI_guilib, "GUI_dialog_yesno_show_and_get_input_linetext"); | ||
| 281 | if (GUI_dialog_yesno_show_and_get_input_linetext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 282 | |||
| 283 | GUI_dialog_yesno_show_and_get_input_linebuttontext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel)) | ||
| 284 | dlsym(m_libKODI_guilib, "GUI_dialog_yesno_show_and_get_input_linebuttontext"); | ||
| 285 | if (GUI_dialog_yesno_show_and_get_input_linebuttontext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 286 | |||
| 287 | GUI_dialog_text_viewer = (void (*)(void *hdl, void *cb, const char *heading, const char *text)) | ||
| 288 | dlsym(m_libKODI_guilib, "GUI_dialog_text_viewer"); | ||
| 289 | if (GUI_dialog_text_viewer == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 290 | |||
| 291 | GUI_dialog_select = (int (*)(void *hdl, void *cb, const char *heading, const char *entries[], unsigned int size, int selected)) | ||
| 292 | dlsym(m_libKODI_guilib, "GUI_dialog_select"); | ||
| 293 | if (GUI_dialog_select == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 294 | |||
| 295 | m_Callbacks = GUI_register_me(m_Handle); | ||
| 296 | return m_Callbacks != NULL; | ||
| 297 | } | ||
| 298 | |||
| 299 | void Lock() | ||
| 300 | { | ||
| 301 | return GUI_lock(m_Handle, m_Callbacks); | ||
| 302 | } | ||
| 303 | |||
| 304 | void Unlock() | ||
| 305 | { | ||
| 306 | return GUI_unlock(m_Handle, m_Callbacks); | ||
| 307 | } | ||
| 308 | |||
| 309 | int GetScreenHeight() | ||
| 310 | { | ||
| 311 | return GUI_get_screen_height(m_Handle, m_Callbacks); | ||
| 312 | } | ||
| 313 | |||
| 314 | int GetScreenWidth() | ||
| 315 | { | ||
| 316 | return GUI_get_screen_width(m_Handle, m_Callbacks); | ||
| 317 | } | ||
| 318 | |||
| 319 | int GetVideoResolution() | ||
| 320 | { | ||
| 321 | return GUI_get_video_resolution(m_Handle, m_Callbacks); | ||
| 322 | } | ||
| 323 | |||
| 324 | CAddonGUIWindow* Window_create(const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) | ||
| 325 | { | ||
| 326 | return GUI_Window_create(m_Handle, m_Callbacks, xmlFilename, defaultSkin, forceFallback, asDialog); | ||
| 327 | } | ||
| 328 | |||
| 329 | void Window_destroy(CAddonGUIWindow* p) | ||
| 330 | { | ||
| 331 | return GUI_Window_destroy(p); | ||
| 332 | } | ||
| 333 | |||
| 334 | CAddonGUISpinControl* Control_getSpin(CAddonGUIWindow *window, int controlId) | ||
| 335 | { | ||
| 336 | return GUI_control_get_spin(m_Handle, m_Callbacks, window, controlId); | ||
| 337 | } | ||
| 338 | |||
| 339 | void Control_releaseSpin(CAddonGUISpinControl* p) | ||
| 340 | { | ||
| 341 | return GUI_control_release_spin(p); | ||
| 342 | } | ||
| 343 | |||
| 344 | CAddonGUIRadioButton* Control_getRadioButton(CAddonGUIWindow *window, int controlId) | ||
| 345 | { | ||
| 346 | return GUI_control_get_radiobutton(m_Handle, m_Callbacks, window, controlId); | ||
| 347 | } | ||
| 348 | |||
| 349 | void Control_releaseRadioButton(CAddonGUIRadioButton* p) | ||
| 350 | { | ||
| 351 | return GUI_control_release_radiobutton(p); | ||
| 352 | } | ||
| 353 | |||
| 354 | CAddonGUIProgressControl* Control_getProgress(CAddonGUIWindow *window, int controlId) | ||
| 355 | { | ||
| 356 | return GUI_control_get_progress(m_Handle, m_Callbacks, window, controlId); | ||
| 357 | } | ||
| 358 | |||
| 359 | void Control_releaseProgress(CAddonGUIProgressControl* p) | ||
| 360 | { | ||
| 361 | return GUI_control_release_progress(p); | ||
| 362 | } | ||
| 363 | |||
| 364 | CAddonListItem* ListItem_create(const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) | ||
| 365 | { | ||
| 366 | return GUI_ListItem_create(m_Handle, m_Callbacks, label, label2, iconImage, thumbnailImage, path); | ||
| 367 | } | ||
| 368 | |||
| 369 | void ListItem_destroy(CAddonListItem* p) | ||
| 370 | { | ||
| 371 | return GUI_ListItem_destroy(p); | ||
| 372 | } | ||
| 373 | |||
| 374 | CAddonGUIRenderingControl* Control_getRendering(CAddonGUIWindow *window, int controlId) | ||
| 375 | { | ||
| 376 | return GUI_control_get_rendering(m_Handle, m_Callbacks, window, controlId); | ||
| 377 | } | ||
| 378 | |||
| 379 | void Control_releaseRendering(CAddonGUIRenderingControl* p) | ||
| 380 | { | ||
| 381 | return GUI_control_release_rendering(p); | ||
| 382 | } | ||
| 383 | |||
| 384 | CAddonGUISliderControl* Control_getSlider(CAddonGUIWindow *window, int controlId) | ||
| 385 | { | ||
| 386 | return GUI_control_get_slider(m_Handle, m_Callbacks, window, controlId); | ||
| 387 | } | ||
| 388 | |||
| 389 | void Control_releaseSlider(CAddonGUISliderControl* p) | ||
| 390 | { | ||
| 391 | return GUI_control_release_slider(p); | ||
| 392 | } | ||
| 393 | |||
| 394 | CAddonGUISettingsSliderControl* Control_getSettingsSlider(CAddonGUIWindow *window, int controlId) | ||
| 395 | { | ||
| 396 | return GUI_control_get_settings_slider(m_Handle, m_Callbacks, window, controlId); | ||
| 397 | } | ||
| 398 | |||
| 399 | void Control_releaseSettingsSlider(CAddonGUISettingsSliderControl* p) | ||
| 400 | { | ||
| 401 | return GUI_control_release_settings_slider(p); | ||
| 402 | } | ||
| 403 | |||
| 404 | /*! @name GUI Keyboard functions */ | ||
| 405 | //@{ | ||
| 406 | bool Dialog_Keyboard_ShowAndGetInput(char &strText, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs = 0) | ||
| 407 | { | ||
| 408 | return GUI_dialog_keyboard_show_and_get_input_with_head(m_Handle, m_Callbacks, strText, iMaxStringSize, strHeading, allowEmptyResult, hiddenInput, autoCloseMs); | ||
| 409 | } | ||
| 410 | |||
| 411 | bool Dialog_Keyboard_ShowAndGetInput(char &strText, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs = 0) | ||
| 412 | { | ||
| 413 | return GUI_dialog_keyboard_show_and_get_input(m_Handle, m_Callbacks, strText, iMaxStringSize, allowEmptyResult, autoCloseMs); | ||
| 414 | } | ||
| 415 | |||
| 416 | bool Dialog_Keyboard_ShowAndGetNewPassword(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs = 0) | ||
| 417 | { | ||
| 418 | return GUI_dialog_keyboard_show_and_get_new_password_with_head(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, strHeading, allowEmptyResult, autoCloseMs); | ||
| 419 | } | ||
| 420 | |||
| 421 | bool Dialog_Keyboard_ShowAndGetNewPassword(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs = 0) | ||
| 422 | { | ||
| 423 | return GUI_dialog_keyboard_show_and_get_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, autoCloseMs); | ||
| 424 | } | ||
| 425 | |||
| 426 | bool Dialog_Keyboard_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs = 0) | ||
| 427 | { | ||
| 428 | return GUI_dialog_keyboard_show_and_verify_new_password_with_head(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, strHeading, allowEmptyResult, autoCloseMs); | ||
| 429 | } | ||
| 430 | |||
| 431 | bool Dialog_Keyboard_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs = 0) | ||
| 432 | { | ||
| 433 | return GUI_dialog_keyboard_show_and_verify_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, autoCloseMs); | ||
| 434 | } | ||
| 435 | |||
| 436 | int Dialog_Keyboard_ShowAndVerifyPassword(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs = 0) | ||
| 437 | { | ||
| 438 | return GUI_dialog_keyboard_show_and_verify_password(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, iRetries, autoCloseMs); | ||
| 439 | } | ||
| 440 | |||
| 441 | bool Dialog_Keyboard_ShowAndGetFilter(char &strText, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs = 0) | ||
| 442 | { | ||
| 443 | return GUI_dialog_keyboard_show_and_get_filter(m_Handle, m_Callbacks, strText, iMaxStringSize, searching, autoCloseMs); | ||
| 444 | } | ||
| 445 | |||
| 446 | bool Dialog_Keyboard_SendTextToActiveKeyboard(const char *aTextString, bool closeKeyboard = false) | ||
| 447 | { | ||
| 448 | return GUI_dialog_keyboard_send_text_to_active_keyboard(m_Handle, m_Callbacks, aTextString, closeKeyboard); | ||
| 449 | } | ||
| 450 | |||
| 451 | bool Dialog_Keyboard_isKeyboardActivated() | ||
| 452 | { | ||
| 453 | return GUI_dialog_keyboard_is_activated(m_Handle, m_Callbacks); | ||
| 454 | } | ||
| 455 | //@} | ||
| 456 | |||
| 457 | /*! @name GUI Numeric functions */ | ||
| 458 | //@{ | ||
| 459 | bool Dialog_Numeric_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize) | ||
| 460 | { | ||
| 461 | return GUI_dialog_numeric_show_and_verify_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize); | ||
| 462 | } | ||
| 463 | |||
| 464 | int Dialog_Numeric_ShowAndVerifyPassword(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries) | ||
| 465 | { | ||
| 466 | return GUI_dialog_numeric_show_and_verify_password(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, iRetries); | ||
| 467 | } | ||
| 468 | |||
| 469 | bool Dialog_Numeric_ShowAndVerifyInput(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput) | ||
| 470 | { | ||
| 471 | return GUI_dialog_numeric_show_and_verify_input(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, bGetUserInput); | ||
| 472 | } | ||
| 473 | |||
| 474 | bool Dialog_Numeric_ShowAndGetTime(tm &time, const char *strHeading) | ||
| 475 | { | ||
| 476 | return GUI_dialog_numeric_show_and_get_time(m_Handle, m_Callbacks, time, strHeading); | ||
| 477 | } | ||
| 478 | |||
| 479 | bool Dialog_Numeric_ShowAndGetDate(tm &date, const char *strHeading) | ||
| 480 | { | ||
| 481 | return GUI_dialog_numeric_show_and_get_date(m_Handle, m_Callbacks, date, strHeading); | ||
| 482 | } | ||
| 483 | |||
| 484 | bool Dialog_Numeric_ShowAndGetIPAddress(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading) | ||
| 485 | { | ||
| 486 | return GUI_dialog_numeric_show_and_get_ipaddress(m_Handle, m_Callbacks, strIPAddress, iMaxStringSize, strHeading); | ||
| 487 | } | ||
| 488 | |||
| 489 | bool Dialog_Numeric_ShowAndGetNumber(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs = 0) | ||
| 490 | { | ||
| 491 | return GUI_dialog_numeric_show_and_get_number(m_Handle, m_Callbacks, strInput, iMaxStringSize, strHeading, iAutoCloseTimeoutMs); | ||
| 492 | } | ||
| 493 | |||
| 494 | bool Dialog_Numeric_ShowAndGetSeconds(char &strTime, unsigned int iMaxStringSize, const char *strHeading) | ||
| 495 | { | ||
| 496 | return GUI_dialog_numeric_show_and_get_seconds(m_Handle, m_Callbacks, strTime, iMaxStringSize, strHeading); | ||
| 497 | } | ||
| 498 | //@} | ||
| 499 | |||
| 500 | /*! @name GUI File browser functions */ | ||
| 501 | //@{ | ||
| 502 | bool Dialog_FileBrowser_ShowAndGetFile(const char *directory, const char *mask, const char *heading, char &strPath, unsigned int iMaxStringSize, bool useThumbs = false, bool useFileDirectories = false, bool singleList = false) | ||
| 503 | { | ||
| 504 | return GUI_dialog_filebrowser_show_and_get_file(m_Handle, m_Callbacks, directory, mask, heading, strPath, iMaxStringSize, useThumbs, useFileDirectories, singleList); | ||
| 505 | } | ||
| 506 | //@} | ||
| 507 | |||
| 508 | /*! @name GUI OK Dialog functions */ | ||
| 509 | //@{ | ||
| 510 | void Dialog_OK_ShowAndGetInput(const char *heading, const char *text) | ||
| 511 | { | ||
| 512 | GUI_dialog_ok_show_and_get_input_single_text(m_Handle, m_Callbacks, heading, text); | ||
| 513 | } | ||
| 514 | |||
| 515 | void Dialog_OK_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2) | ||
| 516 | { | ||
| 517 | GUI_dialog_ok_show_and_get_input_line_text(m_Handle, m_Callbacks, heading, line0, line1, line2); | ||
| 518 | } | ||
| 519 | //@} | ||
| 520 | |||
| 521 | /*! @name GUI Yes No Dialog functions */ | ||
| 522 | //@{ | ||
| 523 | bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *text, bool& bCanceled, const char *noLabel = "", const char *yesLabel = "") | ||
| 524 | { | ||
| 525 | return GUI_dialog_yesno_show_and_get_input_singletext(m_Handle, m_Callbacks, heading, text, bCanceled, noLabel, yesLabel); | ||
| 526 | } | ||
| 527 | |||
| 528 | bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel = "", const char *yesLabel = "") | ||
| 529 | { | ||
| 530 | return GUI_dialog_yesno_show_and_get_input_linetext(m_Handle, m_Callbacks, heading, line0, line1, line2, noLabel, yesLabel); | ||
| 531 | } | ||
| 532 | |||
| 533 | bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel = "", const char *yesLabel = "") | ||
| 534 | { | ||
| 535 | return GUI_dialog_yesno_show_and_get_input_linebuttontext(m_Handle, m_Callbacks, heading, line0, line1, line2, bCanceled, noLabel, yesLabel); | ||
| 536 | } | ||
| 537 | //@} | ||
| 538 | |||
| 539 | /*! @name GUI Text viewer Dialog */ | ||
| 540 | //@{ | ||
| 541 | void Dialog_TextViewer(const char *heading, const char *text) | ||
| 542 | { | ||
| 543 | return GUI_dialog_text_viewer(m_Handle, m_Callbacks, heading, text); | ||
| 544 | } | ||
| 545 | //@} | ||
| 546 | |||
| 547 | /*! @name GUI select Dialog */ | ||
| 548 | //@{ | ||
| 549 | int Dialog_Select(const char *heading, const char *entries[], unsigned int size, int selected = -1) | ||
| 550 | { | ||
| 551 | return GUI_dialog_select(m_Handle, m_Callbacks, heading, entries, size, selected); | ||
| 552 | } | ||
| 553 | //@} | ||
| 554 | |||
| 555 | protected: | ||
| 556 | void* (*GUI_register_me)(void *HANDLE); | ||
| 557 | void (*GUI_unregister_me)(void *HANDLE, void* CB); | ||
| 558 | void (*GUI_lock)(void *HANDLE, void* CB); | ||
| 559 | void (*GUI_unlock)(void *HANDLE, void* CB); | ||
| 560 | int (*GUI_get_screen_height)(void *HANDLE, void* CB); | ||
| 561 | int (*GUI_get_screen_width)(void *HANDLE, void* CB); | ||
| 562 | int (*GUI_get_video_resolution)(void *HANDLE, void* CB); | ||
| 563 | CAddonGUIWindow* (*GUI_Window_create)(void *HANDLE, void* CB, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); | ||
| 564 | void (*GUI_Window_destroy)(CAddonGUIWindow* p); | ||
| 565 | CAddonGUISpinControl* (*GUI_control_get_spin)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 566 | void (*GUI_control_release_spin)(CAddonGUISpinControl* p); | ||
| 567 | CAddonGUIRadioButton* (*GUI_control_get_radiobutton)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 568 | void (*GUI_control_release_radiobutton)(CAddonGUIRadioButton* p); | ||
| 569 | CAddonGUIProgressControl* (*GUI_control_get_progress)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 570 | void (*GUI_control_release_progress)(CAddonGUIProgressControl* p); | ||
| 571 | CAddonListItem* (*GUI_ListItem_create)(void *HANDLE, void* CB, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); | ||
| 572 | void (*GUI_ListItem_destroy)(CAddonListItem* p); | ||
| 573 | CAddonGUIRenderingControl* (*GUI_control_get_rendering)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 574 | void (*GUI_control_release_rendering)(CAddonGUIRenderingControl* p); | ||
| 575 | CAddonGUISliderControl* (*GUI_control_get_slider)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 576 | void (*GUI_control_release_slider)(CAddonGUISliderControl* p); | ||
| 577 | CAddonGUISettingsSliderControl* (*GUI_control_get_settings_slider)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 578 | void (*GUI_control_release_settings_slider)(CAddonGUISettingsSliderControl* p); | ||
| 579 | bool (*GUI_dialog_keyboard_show_and_get_input_with_head)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs); | ||
| 580 | bool (*GUI_dialog_keyboard_show_and_get_input)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs); | ||
| 581 | bool (*GUI_dialog_keyboard_show_and_get_new_password_with_head)(void *HANDLE, void *CB, char &newPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs); | ||
| 582 | bool (*GUI_dialog_keyboard_show_and_get_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); | ||
| 583 | bool (*GUI_dialog_keyboard_show_and_verify_new_password_with_head)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs); | ||
| 584 | bool (*GUI_dialog_keyboard_show_and_verify_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); | ||
| 585 | int (*GUI_dialog_keyboard_show_and_verify_password)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs); | ||
| 586 | bool (*GUI_dialog_keyboard_show_and_get_filter)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs); | ||
| 587 | bool (*GUI_dialog_keyboard_send_text_to_active_keyboard)(void *HANDLE, void *CB, const char *aTextString, bool closeKeyboard); | ||
| 588 | bool (*GUI_dialog_keyboard_is_activated)(void *HANDLE, void *CB); | ||
| 589 | bool (*GUI_dialog_numeric_show_and_verify_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize); | ||
| 590 | int (*GUI_dialog_numeric_show_and_verify_password)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries); | ||
| 591 | bool (*GUI_dialog_numeric_show_and_verify_input)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput); | ||
| 592 | bool (*GUI_dialog_numeric_show_and_get_time)(void *HANDLE, void *CB, tm &time, const char *strHeading); | ||
| 593 | bool (*GUI_dialog_numeric_show_and_get_date)(void *HANDLE, void *CB, tm &date, const char *strHeading); | ||
| 594 | bool (*GUI_dialog_numeric_show_and_get_ipaddress)(void *HANDLE, void *CB, char &IPAddress, unsigned int iMaxStringSize, const char *strHeading); | ||
| 595 | bool (*GUI_dialog_numeric_show_and_get_number)(void *HANDLE, void *CB, char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs); | ||
| 596 | bool (*GUI_dialog_numeric_show_and_get_seconds)(void *HANDLE, void *CB, char &strTime, unsigned int iMaxStringSize, const char *strHeading); | ||
| 597 | bool (*GUI_dialog_filebrowser_show_and_get_file)(void *HANDLE, void *CB, const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList); | ||
| 598 | void (*GUI_dialog_ok_show_and_get_input_single_text)(void *HANDLE, void *CB, const char *heading, const char *text); | ||
| 599 | void (*GUI_dialog_ok_show_and_get_input_line_text)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2); | ||
| 600 | bool (*GUI_dialog_yesno_show_and_get_input_singletext)(void *HANDLE, void *CB, const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel); | ||
| 601 | bool (*GUI_dialog_yesno_show_and_get_input_linetext)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel); | ||
| 602 | bool (*GUI_dialog_yesno_show_and_get_input_linebuttontext)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel); | ||
| 603 | void (*GUI_dialog_text_viewer)(void *hdl, void *cb, const char *heading, const char *text); | ||
| 604 | int (*GUI_dialog_select)(void *hdl, void *cb, const char *heading, const char *entries[], unsigned int size, int selected); | ||
| 605 | |||
| 606 | private: | ||
| 607 | void *m_libKODI_guilib; | ||
| 608 | void *m_Handle; | ||
| 609 | void *m_Callbacks; | ||
| 610 | struct cb_array | ||
| 611 | { | ||
| 612 | const char* libPath; | ||
| 613 | }; | ||
| 614 | }; | ||
| 615 | |||
| 616 | class CAddonGUISpinControl | ||
| 617 | { | ||
| 618 | public: | ||
| 619 | CAddonGUISpinControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 620 | virtual ~CAddonGUISpinControl(void) {} | ||
| 621 | |||
| 622 | virtual void SetVisible(bool yesNo); | ||
| 623 | virtual void SetText(const char *label); | ||
| 624 | virtual void Clear(); | ||
| 625 | virtual void AddLabel(const char *label, int iValue); | ||
| 626 | virtual int GetValue(); | ||
| 627 | virtual void SetValue(int iValue); | ||
| 628 | |||
| 629 | private: | ||
| 630 | CAddonGUIWindow *m_Window; | ||
| 631 | int m_ControlId; | ||
| 632 | GUIHANDLE m_SpinHandle; | ||
| 633 | void *m_Handle; | ||
| 634 | void *m_cb; | ||
| 635 | }; | ||
| 636 | |||
| 637 | class CAddonGUIRadioButton | ||
| 638 | { | ||
| 639 | public: | ||
| 640 | CAddonGUIRadioButton(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 641 | virtual ~CAddonGUIRadioButton() {} | ||
| 642 | |||
| 643 | virtual void SetVisible(bool yesNo); | ||
| 644 | virtual void SetText(const char *label); | ||
| 645 | virtual void SetSelected(bool yesNo); | ||
| 646 | virtual bool IsSelected(); | ||
| 647 | |||
| 648 | private: | ||
| 649 | CAddonGUIWindow *m_Window; | ||
| 650 | int m_ControlId; | ||
| 651 | GUIHANDLE m_ButtonHandle; | ||
| 652 | void *m_Handle; | ||
| 653 | void *m_cb; | ||
| 654 | }; | ||
| 655 | |||
| 656 | class CAddonGUIProgressControl | ||
| 657 | { | ||
| 658 | public: | ||
| 659 | CAddonGUIProgressControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 660 | virtual ~CAddonGUIProgressControl(void) {} | ||
| 661 | |||
| 662 | virtual void SetPercentage(float fPercent); | ||
| 663 | virtual float GetPercentage() const; | ||
| 664 | virtual void SetInfo(int iInfo); | ||
| 665 | virtual int GetInfo() const; | ||
| 666 | virtual std::string GetDescription() const; | ||
| 667 | |||
| 668 | private: | ||
| 669 | CAddonGUIWindow *m_Window; | ||
| 670 | int m_ControlId; | ||
| 671 | GUIHANDLE m_ProgressHandle; | ||
| 672 | void *m_Handle; | ||
| 673 | void *m_cb; | ||
| 674 | }; | ||
| 675 | |||
| 676 | class CAddonGUISliderControl | ||
| 677 | { | ||
| 678 | public: | ||
| 679 | CAddonGUISliderControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 680 | virtual ~CAddonGUISliderControl(void) {} | ||
| 681 | |||
| 682 | virtual void SetVisible(bool yesNo); | ||
| 683 | virtual std::string GetDescription() const; | ||
| 684 | |||
| 685 | virtual void SetIntRange(int iStart, int iEnd); | ||
| 686 | virtual void SetIntValue(int iValue); | ||
| 687 | virtual int GetIntValue() const; | ||
| 688 | virtual void SetIntInterval(int iInterval); | ||
| 689 | |||
| 690 | virtual void SetPercentage(float fPercent); | ||
| 691 | virtual float GetPercentage() const; | ||
| 692 | |||
| 693 | virtual void SetFloatRange(float fStart, float fEnd); | ||
| 694 | virtual void SetFloatValue(float fValue); | ||
| 695 | virtual float GetFloatValue() const; | ||
| 696 | virtual void SetFloatInterval(float fInterval); | ||
| 697 | |||
| 698 | private: | ||
| 699 | CAddonGUIWindow *m_Window; | ||
| 700 | int m_ControlId; | ||
| 701 | GUIHANDLE m_SliderHandle; | ||
| 702 | void *m_Handle; | ||
| 703 | void *m_cb; | ||
| 704 | }; | ||
| 705 | |||
| 706 | class CAddonGUISettingsSliderControl | ||
| 707 | { | ||
| 708 | public: | ||
| 709 | CAddonGUISettingsSliderControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 710 | virtual ~CAddonGUISettingsSliderControl(void) {} | ||
| 711 | |||
| 712 | virtual void SetVisible(bool yesNo); | ||
| 713 | virtual void SetText(const char *label); | ||
| 714 | virtual std::string GetDescription() const; | ||
| 715 | |||
| 716 | virtual void SetIntRange(int iStart, int iEnd); | ||
| 717 | virtual void SetIntValue(int iValue); | ||
| 718 | virtual int GetIntValue() const; | ||
| 719 | virtual void SetIntInterval(int iInterval); | ||
| 720 | |||
| 721 | virtual void SetPercentage(float fPercent); | ||
| 722 | virtual float GetPercentage() const; | ||
| 723 | |||
| 724 | virtual void SetFloatRange(float fStart, float fEnd); | ||
| 725 | virtual void SetFloatValue(float fValue); | ||
| 726 | virtual float GetFloatValue() const; | ||
| 727 | virtual void SetFloatInterval(float fInterval); | ||
| 728 | |||
| 729 | private: | ||
| 730 | CAddonGUIWindow *m_Window; | ||
| 731 | int m_ControlId; | ||
| 732 | GUIHANDLE m_SettingsSliderHandle; | ||
| 733 | void *m_Handle; | ||
| 734 | void *m_cb; | ||
| 735 | }; | ||
| 736 | |||
| 737 | class CAddonListItem | ||
| 738 | { | ||
| 739 | friend class CAddonGUIWindow; | ||
| 740 | |||
| 741 | public: | ||
| 742 | CAddonListItem(void *hdl, void *cb, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); | ||
| 743 | virtual ~CAddonListItem(void) {} | ||
| 744 | |||
| 745 | virtual const char *GetLabel(); | ||
| 746 | virtual void SetLabel(const char *label); | ||
| 747 | virtual const char *GetLabel2(); | ||
| 748 | virtual void SetLabel2(const char *label); | ||
| 749 | virtual void SetIconImage(const char *image); | ||
| 750 | virtual void SetThumbnailImage(const char *image); | ||
| 751 | virtual void SetInfo(const char *Info); | ||
| 752 | virtual void SetProperty(const char *key, const char *value); | ||
| 753 | virtual const char *GetProperty(const char *key) const; | ||
| 754 | virtual void SetPath(const char *Path); | ||
| 755 | |||
| 756 | // {(char*)"select(); | ||
| 757 | // {(char*)"isSelected(); | ||
| 758 | protected: | ||
| 759 | GUIHANDLE m_ListItemHandle; | ||
| 760 | void *m_Handle; | ||
| 761 | void *m_cb; | ||
| 762 | }; | ||
| 763 | |||
| 764 | class CAddonGUIWindow | ||
| 765 | { | ||
| 766 | friend class CAddonGUISpinControl; | ||
| 767 | friend class CAddonGUIRadioButton; | ||
| 768 | friend class CAddonGUIProgressControl; | ||
| 769 | friend class CAddonGUIRenderingControl; | ||
| 770 | friend class CAddonGUISliderControl; | ||
| 771 | friend class CAddonGUISettingsSliderControl; | ||
| 772 | |||
| 773 | public: | ||
| 774 | CAddonGUIWindow(void *hdl, void *cb, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); | ||
| 775 | virtual ~CAddonGUIWindow(); | ||
| 776 | |||
| 777 | virtual bool Show(); | ||
| 778 | virtual void Close(); | ||
| 779 | virtual void DoModal(); | ||
| 780 | virtual bool SetFocusId(int iControlId); | ||
| 781 | virtual int GetFocusId(); | ||
| 782 | virtual bool SetCoordinateResolution(int res); | ||
| 783 | virtual void SetProperty(const char *key, const char *value); | ||
| 784 | virtual void SetPropertyInt(const char *key, int value); | ||
| 785 | virtual void SetPropertyBool(const char *key, bool value); | ||
| 786 | virtual void SetPropertyDouble(const char *key, double value); | ||
| 787 | virtual const char *GetProperty(const char *key) const; | ||
| 788 | virtual int GetPropertyInt(const char *key) const; | ||
| 789 | virtual bool GetPropertyBool(const char *key) const; | ||
| 790 | virtual double GetPropertyDouble(const char *key) const; | ||
| 791 | virtual void ClearProperties(); | ||
| 792 | virtual int GetListSize(); | ||
| 793 | virtual void ClearList(); | ||
| 794 | virtual GUIHANDLE AddStringItem(const char *name, int itemPosition = -1); | ||
| 795 | virtual void AddItem(GUIHANDLE item, int itemPosition = -1); | ||
| 796 | virtual void AddItem(CAddonListItem *item, int itemPosition = -1); | ||
| 797 | virtual void RemoveItem(int itemPosition); | ||
| 798 | virtual GUIHANDLE GetListItem(int listPos); | ||
| 799 | virtual void SetCurrentListPosition(int listPos); | ||
| 800 | virtual int GetCurrentListPosition(); | ||
| 801 | virtual void SetControlLabel(int controlId, const char *label); | ||
| 802 | virtual void MarkDirtyRegion(); | ||
| 803 | |||
| 804 | virtual bool OnClick(int controlId); | ||
| 805 | virtual bool OnFocus(int controlId); | ||
| 806 | virtual bool OnInit(); | ||
| 807 | virtual bool OnAction(int actionId); | ||
| 808 | |||
| 809 | GUIHANDLE m_cbhdl; | ||
| 810 | bool (*CBOnInit)(GUIHANDLE cbhdl); | ||
| 811 | bool (*CBOnFocus)(GUIHANDLE cbhdl, int controlId); | ||
| 812 | bool (*CBOnClick)(GUIHANDLE cbhdl, int controlId); | ||
| 813 | bool (*CBOnAction)(GUIHANDLE cbhdl, int actionId); | ||
| 814 | |||
| 815 | protected: | ||
| 816 | GUIHANDLE m_WindowHandle; | ||
| 817 | void *m_Handle; | ||
| 818 | void *m_cb; | ||
| 819 | }; | ||
| 820 | |||
| 821 | class CAddonGUIRenderingControl | ||
| 822 | { | ||
| 823 | public: | ||
| 824 | CAddonGUIRenderingControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 825 | virtual ~CAddonGUIRenderingControl(); | ||
| 826 | virtual void Init(); | ||
| 827 | |||
| 828 | virtual bool Create(int x, int y, int w, int h, void *device); | ||
| 829 | virtual void Render(); | ||
| 830 | virtual void Stop(); | ||
| 831 | virtual bool Dirty(); | ||
| 832 | |||
| 833 | GUIHANDLE m_cbhdl; | ||
| 834 | bool (*CBCreate)(GUIHANDLE cbhdl, int x, int y, int w, int h, void *device); | ||
| 835 | void (*CBRender)(GUIHANDLE cbhdl); | ||
| 836 | void (*CBStop)(GUIHANDLE cbhdl); | ||
| 837 | bool (*CBDirty)(GUIHANDLE cbhdl); | ||
| 838 | |||
| 839 | private: | ||
| 840 | CAddonGUIWindow *m_Window; | ||
| 841 | int m_ControlId; | ||
| 842 | GUIHANDLE m_RenderingHandle; | ||
| 843 | void *m_Handle; | ||
| 844 | void *m_cb; | ||
| 845 | }; | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h new file mode 100644 index 0000000..e0dc881 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2016 Team XBMC | ||
| 3 | * http://www.xbmc.org | ||
| 4 | * | ||
| 5 | * This Program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 8 | * any later version. | ||
| 9 | * | ||
| 10 | * This Program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with XBMC; see the file COPYING. If not, see | ||
| 17 | * <http://www.gnu.org/licenses/>. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #pragma once | ||
| 22 | |||
| 23 | #include <string> | ||
| 24 | #include <vector> | ||
| 25 | #include <string.h> | ||
| 26 | #include <stdlib.h> | ||
| 27 | #include <stdio.h> | ||
| 28 | #include "libXBMC_addon.h" | ||
| 29 | |||
| 30 | #ifdef BUILD_KODI_ADDON | ||
| 31 | #include "DVDDemuxPacket.h" | ||
| 32 | #else | ||
| 33 | #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #ifdef _WIN32 | ||
| 37 | #define INPUTSTREAM_HELPER_DLL "\\library.kodi.inputstream\\libKODI_inputstream" ADDON_HELPER_EXT | ||
| 38 | #else | ||
| 39 | #define INPUTSTREAM_HELPER_DLL_NAME "libKODI_inputstream-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 40 | #define INPUTSTREAM_HELPER_DLL "/library.kodi.inputstream/" INPUTSTREAM_HELPER_DLL_NAME | ||
| 41 | #endif | ||
| 42 | |||
| 43 | class CHelper_libKODI_inputstream | ||
| 44 | { | ||
| 45 | public: | ||
| 46 | CHelper_libKODI_inputstream(void) | ||
| 47 | { | ||
| 48 | m_libKODI_inputstream = nullptr; | ||
| 49 | m_Handle = nullptr; | ||
| 50 | } | ||
| 51 | |||
| 52 | ~CHelper_libKODI_inputstream(void) | ||
| 53 | { | ||
| 54 | if (m_libKODI_inputstream) | ||
| 55 | { | ||
| 56 | INPUTSTREAM_unregister_me(m_Handle, m_Callbacks); | ||
| 57 | dlclose(m_libKODI_inputstream); | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | /*! | ||
| 62 | * @brief Resolve all callback methods | ||
| 63 | * @param handle Pointer to the add-on | ||
| 64 | * @return True when all methods were resolved, false otherwise. | ||
| 65 | */ | ||
| 66 | bool RegisterMe(void* handle) | ||
| 67 | { | ||
| 68 | m_Handle = handle; | ||
| 69 | |||
| 70 | std::string libBasePath; | ||
| 71 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 72 | libBasePath += INPUTSTREAM_HELPER_DLL; | ||
| 73 | |||
| 74 | m_libKODI_inputstream = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 75 | if (m_libKODI_inputstream == nullptr) | ||
| 76 | { | ||
| 77 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 78 | return false; | ||
| 79 | } | ||
| 80 | |||
| 81 | INPUTSTREAM_register_me = (void* (*)(void *HANDLE)) | ||
| 82 | dlsym(m_libKODI_inputstream, "INPUTSTREAM_register_me"); | ||
| 83 | if (INPUTSTREAM_register_me == nullptr) | ||
| 84 | { | ||
| 85 | fprintf(stderr, "Unable to assign function %s\n", dlerror()); | ||
| 86 | return false; | ||
| 87 | } | ||
| 88 | |||
| 89 | INPUTSTREAM_unregister_me = (void (*)(void* HANDLE, void* CB)) | ||
| 90 | dlsym(m_libKODI_inputstream, "INPUTSTREAM_unregister_me"); | ||
| 91 | if (INPUTSTREAM_unregister_me == nullptr) | ||
| 92 | { | ||
| 93 | fprintf(stderr, "Unable to assign function %s\n", dlerror()); | ||
| 94 | return false; | ||
| 95 | } | ||
| 96 | |||
| 97 | INPUTSTREAM_free_demux_packet = (void (*)(void* HANDLE, void* CB, DemuxPacket* pPacket)) | ||
| 98 | dlsym(m_libKODI_inputstream, "INPUTSTREAM_free_demux_packet"); | ||
| 99 | if (INPUTSTREAM_free_demux_packet == NULL) | ||
| 100 | { | ||
| 101 | fprintf(stderr, "Unable to assign function %s\n", dlerror()); | ||
| 102 | return false; | ||
| 103 | } | ||
| 104 | |||
| 105 | INPUTSTREAM_allocate_demux_packet = (DemuxPacket* (*)(void* HANDLE, void* CB, int iDataSize)) | ||
| 106 | dlsym(m_libKODI_inputstream, "INPUTSTREAM_allocate_demux_packet"); | ||
| 107 | if (INPUTSTREAM_allocate_demux_packet == NULL) | ||
| 108 | { | ||
| 109 | fprintf(stderr, "Unable to assign function %s\n", dlerror()); | ||
| 110 | return false; | ||
| 111 | } | ||
| 112 | |||
| 113 | m_Callbacks = INPUTSTREAM_register_me(m_Handle); | ||
| 114 | return m_Callbacks != nullptr; | ||
| 115 | } | ||
| 116 | |||
| 117 | /*! | ||
| 118 | * @brief Allocate a demux packet. Free with FreeDemuxPacket | ||
| 119 | * @param iDataSize The size of the data that will go into the packet | ||
| 120 | * @return The allocated packet | ||
| 121 | */ | ||
| 122 | DemuxPacket* AllocateDemuxPacket(int iDataSize) | ||
| 123 | { | ||
| 124 | return INPUTSTREAM_allocate_demux_packet(m_Handle, m_Callbacks, iDataSize); | ||
| 125 | } | ||
| 126 | |||
| 127 | /*! | ||
| 128 | * @brief Free a packet that was allocated with AllocateDemuxPacket | ||
| 129 | * @param pPacket The packet to free | ||
| 130 | */ | ||
| 131 | void FreeDemuxPacket(DemuxPacket* pPacket) | ||
| 132 | { | ||
| 133 | return INPUTSTREAM_free_demux_packet(m_Handle, m_Callbacks, pPacket); | ||
| 134 | } | ||
| 135 | |||
| 136 | protected: | ||
| 137 | void* (*INPUTSTREAM_register_me)(void*); | ||
| 138 | void (*INPUTSTREAM_unregister_me)(void*, void*); | ||
| 139 | void (*INPUTSTREAM_free_demux_packet)(void*, void*, DemuxPacket*); | ||
| 140 | DemuxPacket* (*INPUTSTREAM_allocate_demux_packet)(void*, void*, int); | ||
| 141 | |||
| 142 | private: | ||
| 143 | void* m_libKODI_inputstream; | ||
| 144 | void* m_Handle; | ||
| 145 | void* m_Callbacks; | ||
| 146 | struct cb_array | ||
| 147 | { | ||
| 148 | const char* libPath; | ||
| 149 | }; | ||
| 150 | }; | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h new file mode 100644 index 0000000..e8d5ec7 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h | |||
| @@ -0,0 +1,710 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2013 Team XBMC | ||
| 4 | * http://xbmc.org | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with XBMC; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <string> | ||
| 23 | #include <vector> | ||
| 24 | #include <string.h> | ||
| 25 | #include <stdlib.h> | ||
| 26 | #include <stdio.h> | ||
| 27 | #include <stdint.h> | ||
| 28 | #include <stdarg.h> | ||
| 29 | |||
| 30 | #if defined(BUILD_KODI_ADDON) | ||
| 31 | #include "IFileTypes.h" | ||
| 32 | #else | ||
| 33 | #include "filesystem/IFileTypes.h" | ||
| 34 | #endif | ||
| 35 | |||
| 36 | struct VFSDirEntry; | ||
| 37 | |||
| 38 | #ifdef _WIN32 // windows | ||
| 39 | #ifndef _SSIZE_T_DEFINED | ||
| 40 | typedef intptr_t ssize_t; | ||
| 41 | #define _SSIZE_T_DEFINED | ||
| 42 | #endif // !_SSIZE_T_DEFINED | ||
| 43 | |||
| 44 | #if defined(BUILD_KODI_ADDON) | ||
| 45 | #include "p8-platform/windows/dlfcn-win32.h" | ||
| 46 | #else | ||
| 47 | #include "dlfcn-win32.h" | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #define ADDON_DLL "\\library.xbmc.addon\\libXBMC_addon" ADDON_HELPER_EXT | ||
| 51 | #define ADDON_HELPER_EXT ".dll" | ||
| 52 | #else // windows | ||
| 53 | // the ADDON_HELPER_ARCH is the platform dependend name which is used | ||
| 54 | // as part of the name of dynamic addon libraries. It has to match the | ||
| 55 | // strings which are set in configure.ac for the "ARCH" variable. | ||
| 56 | #if defined(__APPLE__) // osx | ||
| 57 | #if defined(__arm__) || defined(__aarch64__) | ||
| 58 | #define ADDON_HELPER_ARCH "arm-osx" | ||
| 59 | #else | ||
| 60 | #define ADDON_HELPER_ARCH "x86-osx" | ||
| 61 | #endif | ||
| 62 | #define ADDON_HELPER_EXT ".dylib" | ||
| 63 | #else // linux | ||
| 64 | #if defined(__x86_64__) | ||
| 65 | #define ADDON_HELPER_ARCH "x86_64-linux" | ||
| 66 | #elif defined(_POWERPC) | ||
| 67 | #define ADDON_HELPER_ARCH "powerpc-linux" | ||
| 68 | #elif defined(_POWERPC64) | ||
| 69 | #define ADDON_HELPER_ARCH "powerpc64-linux" | ||
| 70 | #elif defined(__ARMEL__) | ||
| 71 | #define ADDON_HELPER_ARCH "arm" | ||
| 72 | #elif defined(__aarch64__) | ||
| 73 | #define ADDON_HELPER_ARCH "aarch64" | ||
| 74 | #elif defined(__mips__) | ||
| 75 | #define ADDON_HELPER_ARCH "mips" | ||
| 76 | #else | ||
| 77 | #define ADDON_HELPER_ARCH "i486-linux" | ||
| 78 | #endif | ||
| 79 | #define ADDON_HELPER_EXT ".so" | ||
| 80 | #endif | ||
| 81 | #include <dlfcn.h> // linux+osx | ||
| 82 | #define ADDON_DLL_NAME "libXBMC_addon-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 83 | #define ADDON_DLL "/library.xbmc.addon/" ADDON_DLL_NAME | ||
| 84 | #endif | ||
| 85 | #if defined(ANDROID) | ||
| 86 | #include <sys/stat.h> | ||
| 87 | #endif | ||
| 88 | |||
| 89 | #ifdef LOG_DEBUG | ||
| 90 | #undef LOG_DEBUG | ||
| 91 | #endif | ||
| 92 | #ifdef LOG_INFO | ||
| 93 | #undef LOG_INFO | ||
| 94 | #endif | ||
| 95 | #ifdef LOG_NOTICE | ||
| 96 | #undef LOG_NOTICE | ||
| 97 | #endif | ||
| 98 | #ifdef LOG_ERROR | ||
| 99 | #undef LOG_ERROR | ||
| 100 | #endif | ||
| 101 | |||
| 102 | namespace ADDON | ||
| 103 | { | ||
| 104 | typedef enum addon_log | ||
| 105 | { | ||
| 106 | LOG_DEBUG, | ||
| 107 | LOG_INFO, | ||
| 108 | LOG_NOTICE, | ||
| 109 | LOG_ERROR | ||
| 110 | } addon_log_t; | ||
| 111 | |||
| 112 | typedef enum queue_msg | ||
| 113 | { | ||
| 114 | QUEUE_INFO, | ||
| 115 | QUEUE_WARNING, | ||
| 116 | QUEUE_ERROR | ||
| 117 | } queue_msg_t; | ||
| 118 | |||
| 119 | class CHelper_libXBMC_addon | ||
| 120 | { | ||
| 121 | public: | ||
| 122 | CHelper_libXBMC_addon() | ||
| 123 | { | ||
| 124 | m_libXBMC_addon = NULL; | ||
| 125 | m_Handle = NULL; | ||
| 126 | } | ||
| 127 | |||
| 128 | ~CHelper_libXBMC_addon() | ||
| 129 | { | ||
| 130 | if (m_libXBMC_addon) | ||
| 131 | { | ||
| 132 | XBMC_unregister_me(m_Handle, m_Callbacks); | ||
| 133 | dlclose(m_libXBMC_addon); | ||
| 134 | } | ||
| 135 | } | ||
| 136 | |||
| 137 | bool RegisterMe(void *Handle) | ||
| 138 | { | ||
| 139 | m_Handle = Handle; | ||
| 140 | |||
| 141 | std::string libBasePath; | ||
| 142 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 143 | libBasePath += ADDON_DLL; | ||
| 144 | |||
| 145 | #if defined(ANDROID) | ||
| 146 | struct stat st; | ||
| 147 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 148 | { | ||
| 149 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 150 | libBasePath = tempbin + "/" + ADDON_DLL_NAME; | ||
| 151 | } | ||
| 152 | #endif | ||
| 153 | |||
| 154 | m_libXBMC_addon = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 155 | if (m_libXBMC_addon == NULL) | ||
| 156 | { | ||
| 157 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 158 | return false; | ||
| 159 | } | ||
| 160 | |||
| 161 | XBMC_register_me = (void* (*)(void *HANDLE)) | ||
| 162 | dlsym(m_libXBMC_addon, "XBMC_register_me"); | ||
| 163 | if (XBMC_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 164 | |||
| 165 | XBMC_unregister_me = (void (*)(void* HANDLE, void* CB)) | ||
| 166 | dlsym(m_libXBMC_addon, "XBMC_unregister_me"); | ||
| 167 | if (XBMC_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 168 | |||
| 169 | XBMC_log = (void (*)(void* HANDLE, void* CB, const addon_log_t loglevel, const char *msg)) | ||
| 170 | dlsym(m_libXBMC_addon, "XBMC_log"); | ||
| 171 | if (XBMC_log == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 172 | |||
| 173 | XBMC_get_setting = (bool (*)(void* HANDLE, void* CB, const char* settingName, void *settingValue)) | ||
| 174 | dlsym(m_libXBMC_addon, "XBMC_get_setting"); | ||
| 175 | if (XBMC_get_setting == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 176 | |||
| 177 | XBMC_queue_notification = (void (*)(void* HANDLE, void* CB, const queue_msg_t loglevel, const char *msg)) | ||
| 178 | dlsym(m_libXBMC_addon, "XBMC_queue_notification"); | ||
| 179 | if (XBMC_queue_notification == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 180 | |||
| 181 | XBMC_wake_on_lan = (bool (*)(void* HANDLE, void *CB, const char *mac)) | ||
| 182 | dlsym(m_libXBMC_addon, "XBMC_wake_on_lan"); | ||
| 183 | if (XBMC_wake_on_lan == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 184 | |||
| 185 | XBMC_unknown_to_utf8 = (char* (*)(void* HANDLE, void* CB, const char* str)) | ||
| 186 | dlsym(m_libXBMC_addon, "XBMC_unknown_to_utf8"); | ||
| 187 | if (XBMC_unknown_to_utf8 == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 188 | |||
| 189 | XBMC_get_localized_string = (char* (*)(void* HANDLE, void* CB, int dwCode)) | ||
| 190 | dlsym(m_libXBMC_addon, "XBMC_get_localized_string"); | ||
| 191 | if (XBMC_get_localized_string == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 192 | |||
| 193 | XBMC_free_string = (void (*)(void* HANDLE, void* CB, char* str)) | ||
| 194 | dlsym(m_libXBMC_addon, "XBMC_free_string"); | ||
| 195 | if (XBMC_free_string == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 196 | |||
| 197 | XBMC_get_dvd_menu_language = (char* (*)(void* HANDLE, void* CB)) | ||
| 198 | dlsym(m_libXBMC_addon, "XBMC_get_dvd_menu_language"); | ||
| 199 | if (XBMC_get_dvd_menu_language == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 200 | |||
| 201 | XBMC_open_file = (void* (*)(void* HANDLE, void* CB, const char* strFileName, unsigned int flags)) | ||
| 202 | dlsym(m_libXBMC_addon, "XBMC_open_file"); | ||
| 203 | if (XBMC_open_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 204 | |||
| 205 | XBMC_open_file_for_write = (void* (*)(void* HANDLE, void* CB, const char* strFileName, bool bOverWrite)) | ||
| 206 | dlsym(m_libXBMC_addon, "XBMC_open_file_for_write"); | ||
| 207 | if (XBMC_open_file_for_write == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 208 | |||
| 209 | XBMC_read_file = (ssize_t (*)(void* HANDLE, void* CB, void* file, void* lpBuf, size_t uiBufSize)) | ||
| 210 | dlsym(m_libXBMC_addon, "XBMC_read_file"); | ||
| 211 | if (XBMC_read_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 212 | |||
| 213 | XBMC_read_file_string = (bool (*)(void* HANDLE, void* CB, void* file, char *szLine, int iLineLength)) | ||
| 214 | dlsym(m_libXBMC_addon, "XBMC_read_file_string"); | ||
| 215 | if (XBMC_read_file_string == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 216 | |||
| 217 | XBMC_write_file = (ssize_t (*)(void* HANDLE, void* CB, void* file, const void* lpBuf, size_t uiBufSize)) | ||
| 218 | dlsym(m_libXBMC_addon, "XBMC_write_file"); | ||
| 219 | if (XBMC_write_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 220 | |||
| 221 | XBMC_flush_file = (void (*)(void* HANDLE, void* CB, void* file)) | ||
| 222 | dlsym(m_libXBMC_addon, "XBMC_flush_file"); | ||
| 223 | if (XBMC_flush_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 224 | |||
| 225 | XBMC_seek_file = (int64_t (*)(void* HANDLE, void* CB, void* file, int64_t iFilePosition, int iWhence)) | ||
| 226 | dlsym(m_libXBMC_addon, "XBMC_seek_file"); | ||
| 227 | if (XBMC_seek_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 228 | |||
| 229 | XBMC_truncate_file = (int (*)(void* HANDLE, void* CB, void* file, int64_t iSize)) | ||
| 230 | dlsym(m_libXBMC_addon, "XBMC_truncate_file"); | ||
| 231 | if (XBMC_truncate_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 232 | |||
| 233 | XBMC_get_file_position = (int64_t (*)(void* HANDLE, void* CB, void* file)) | ||
| 234 | dlsym(m_libXBMC_addon, "XBMC_get_file_position"); | ||
| 235 | if (XBMC_get_file_position == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 236 | |||
| 237 | XBMC_get_file_length = (int64_t (*)(void* HANDLE, void* CB, void* file)) | ||
| 238 | dlsym(m_libXBMC_addon, "XBMC_get_file_length"); | ||
| 239 | if (XBMC_get_file_length == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 240 | |||
| 241 | XBMC_get_file_download_speed = (double(*)(void* HANDLE, void* CB, void* file)) | ||
| 242 | dlsym(m_libXBMC_addon, "XBMC_get_file_download_speed"); | ||
| 243 | if (XBMC_get_file_download_speed == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 244 | |||
| 245 | XBMC_close_file = (void (*)(void* HANDLE, void* CB, void* file)) | ||
| 246 | dlsym(m_libXBMC_addon, "XBMC_close_file"); | ||
| 247 | if (XBMC_close_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 248 | |||
| 249 | XBMC_get_file_chunk_size = (int (*)(void* HANDLE, void* CB, void* file)) | ||
| 250 | dlsym(m_libXBMC_addon, "XBMC_get_file_chunk_size"); | ||
| 251 | if (XBMC_get_file_chunk_size == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 252 | |||
| 253 | XBMC_file_exists = (bool (*)(void* HANDLE, void* CB, const char *strFileName, bool bUseCache)) | ||
| 254 | dlsym(m_libXBMC_addon, "XBMC_file_exists"); | ||
| 255 | if (XBMC_file_exists == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 256 | |||
| 257 | XBMC_stat_file = (int (*)(void* HANDLE, void* CB, const char *strFileName, struct __stat64* buffer)) | ||
| 258 | dlsym(m_libXBMC_addon, "XBMC_stat_file"); | ||
| 259 | if (XBMC_stat_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 260 | |||
| 261 | XBMC_delete_file = (bool (*)(void* HANDLE, void* CB, const char *strFileName)) | ||
| 262 | dlsym(m_libXBMC_addon, "XBMC_delete_file"); | ||
| 263 | if (XBMC_delete_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 264 | |||
| 265 | XBMC_can_open_directory = (bool (*)(void* HANDLE, void* CB, const char* strURL)) | ||
| 266 | dlsym(m_libXBMC_addon, "XBMC_can_open_directory"); | ||
| 267 | if (XBMC_can_open_directory == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 268 | |||
| 269 | XBMC_create_directory = (bool (*)(void* HANDLE, void* CB, const char* strPath)) | ||
| 270 | dlsym(m_libXBMC_addon, "XBMC_create_directory"); | ||
| 271 | if (XBMC_create_directory == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 272 | |||
| 273 | XBMC_directory_exists = (bool (*)(void* HANDLE, void* CB, const char* strPath)) | ||
| 274 | dlsym(m_libXBMC_addon, "XBMC_directory_exists"); | ||
| 275 | if (XBMC_directory_exists == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 276 | |||
| 277 | XBMC_remove_directory = (bool (*)(void* HANDLE, void* CB, const char* strPath)) | ||
| 278 | dlsym(m_libXBMC_addon, "XBMC_remove_directory"); | ||
| 279 | if (XBMC_remove_directory == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 280 | |||
| 281 | XBMC_get_directory = (bool (*)(void* HANDLE, void* CB, const char* strPath, const char* mask, VFSDirEntry** items, unsigned int* num_items)) | ||
| 282 | dlsym(m_libXBMC_addon, "XBMC_get_directory"); | ||
| 283 | if (XBMC_get_directory == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 284 | |||
| 285 | XBMC_free_directory = (void (*)(void* HANDLE, void* CB, VFSDirEntry* items, unsigned int num_items)) | ||
| 286 | dlsym(m_libXBMC_addon, "XBMC_free_directory"); | ||
| 287 | if (XBMC_free_directory == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 288 | |||
| 289 | XBMC_curl_create = (void* (*)(void *HANDLE, void* CB, const char* strURL)) | ||
| 290 | dlsym(m_libXBMC_addon, "XBMC_curl_create"); | ||
| 291 | if (XBMC_curl_create == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 292 | |||
| 293 | XBMC_curl_add_option = (bool (*)(void *HANDLE, void* CB, void *file, XFILE::CURLOPTIONTYPE type, const char* name, const char *value)) | ||
| 294 | dlsym(m_libXBMC_addon, "XBMC_curl_add_option"); | ||
| 295 | if (XBMC_curl_add_option == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 296 | |||
| 297 | XBMC_curl_open = (bool (*)(void *HANDLE, void* CB, void *file, unsigned int flags)) | ||
| 298 | dlsym(m_libXBMC_addon, "XBMC_curl_open"); | ||
| 299 | if (XBMC_curl_open == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 300 | |||
| 301 | m_Callbacks = XBMC_register_me(m_Handle); | ||
| 302 | return m_Callbacks != NULL; | ||
| 303 | } | ||
| 304 | |||
| 305 | /*! | ||
| 306 | * @brief Add a message to XBMC's log. | ||
| 307 | * @param loglevel The log level of the message. | ||
| 308 | * @param format The format of the message to pass to XBMC. | ||
| 309 | */ | ||
| 310 | void Log(const addon_log_t loglevel, const char *format, ... ) | ||
| 311 | { | ||
| 312 | char buffer[16384]; | ||
| 313 | va_list args; | ||
| 314 | va_start (args, format); | ||
| 315 | vsprintf (buffer, format, args); | ||
| 316 | va_end (args); | ||
| 317 | return XBMC_log(m_Handle, m_Callbacks, loglevel, buffer); | ||
| 318 | } | ||
| 319 | |||
| 320 | /*! | ||
| 321 | * @brief Get a settings value for this add-on. | ||
| 322 | * @param settingName The name of the setting to get. | ||
| 323 | * @param settingValue The value. | ||
| 324 | * @return True if the settings was fetched successfully, false otherwise. | ||
| 325 | */ | ||
| 326 | bool GetSetting(const char* settingName, void *settingValue) | ||
| 327 | { | ||
| 328 | return XBMC_get_setting(m_Handle, m_Callbacks, settingName, settingValue); | ||
| 329 | } | ||
| 330 | |||
| 331 | /*! | ||
| 332 | * @brief Queue a notification in the GUI. | ||
| 333 | * @param type The message type. | ||
| 334 | * @param format The format of the message to pass to display in XBMC. | ||
| 335 | */ | ||
| 336 | void QueueNotification(const queue_msg_t type, const char *format, ... ) | ||
| 337 | { | ||
| 338 | char buffer[16384]; | ||
| 339 | va_list args; | ||
| 340 | va_start (args, format); | ||
| 341 | vsprintf (buffer, format, args); | ||
| 342 | va_end (args); | ||
| 343 | return XBMC_queue_notification(m_Handle, m_Callbacks, type, buffer); | ||
| 344 | } | ||
| 345 | |||
| 346 | /*! | ||
| 347 | * @brief Send WakeOnLan magic packet. | ||
| 348 | * @param mac Network address of the host to wake. | ||
| 349 | * @return True if the magic packet was successfully sent, false otherwise. | ||
| 350 | */ | ||
| 351 | bool WakeOnLan(const char* mac) | ||
| 352 | { | ||
| 353 | return XBMC_wake_on_lan(m_Handle, m_Callbacks, mac); | ||
| 354 | } | ||
| 355 | |||
| 356 | /*! | ||
| 357 | * @brief Translate a string with an unknown encoding to UTF8. | ||
| 358 | * @param str The string to translate. | ||
| 359 | * @return The string translated to UTF8. Must be freed by calling FreeString() when done. | ||
| 360 | */ | ||
| 361 | char* UnknownToUTF8(const char* str) | ||
| 362 | { | ||
| 363 | return XBMC_unknown_to_utf8(m_Handle, m_Callbacks, str); | ||
| 364 | } | ||
| 365 | |||
| 366 | /*! | ||
| 367 | * @brief Get a localised message. | ||
| 368 | * @param dwCode The code of the message to get. | ||
| 369 | * @return The message. Must be freed by calling FreeString() when done. | ||
| 370 | */ | ||
| 371 | char* GetLocalizedString(int dwCode) | ||
| 372 | { | ||
| 373 | return XBMC_get_localized_string(m_Handle, m_Callbacks, dwCode); | ||
| 374 | } | ||
| 375 | |||
| 376 | |||
| 377 | /*! | ||
| 378 | * @brief Get the DVD menu language. | ||
| 379 | * @return The language. Must be freed by calling FreeString() when done. | ||
| 380 | */ | ||
| 381 | char* GetDVDMenuLanguage() | ||
| 382 | { | ||
| 383 | return XBMC_get_dvd_menu_language(m_Handle, m_Callbacks); | ||
| 384 | } | ||
| 385 | |||
| 386 | /*! | ||
| 387 | * @brief Free the memory used by str | ||
| 388 | * @param str The string to free | ||
| 389 | */ | ||
| 390 | void FreeString(char* str) | ||
| 391 | { | ||
| 392 | return XBMC_free_string(m_Handle, m_Callbacks, str); | ||
| 393 | } | ||
| 394 | |||
| 395 | /*! | ||
| 396 | * @brief Open the file with filename via XBMC's CFile. Needs to be closed by calling CloseFile() when done. | ||
| 397 | * @param strFileName The filename to open. | ||
| 398 | * @param flags The flags to pass. Documented in XBMC's File.h | ||
| 399 | * @return A handle for the file, or NULL if it couldn't be opened. | ||
| 400 | */ | ||
| 401 | void* OpenFile(const char* strFileName, unsigned int flags) | ||
| 402 | { | ||
| 403 | return XBMC_open_file(m_Handle, m_Callbacks, strFileName, flags); | ||
| 404 | } | ||
| 405 | |||
| 406 | /*! | ||
| 407 | * @brief Open the file with filename via XBMC's CFile in write mode. Needs to be closed by calling CloseFile() when done. | ||
| 408 | * @param strFileName The filename to open. | ||
| 409 | * @param bOverWrite True to overwrite, false otherwise. | ||
| 410 | * @return A handle for the file, or NULL if it couldn't be opened. | ||
| 411 | */ | ||
| 412 | void* OpenFileForWrite(const char* strFileName, bool bOverWrite) | ||
| 413 | { | ||
| 414 | return XBMC_open_file_for_write(m_Handle, m_Callbacks, strFileName, bOverWrite); | ||
| 415 | } | ||
| 416 | |||
| 417 | /*! | ||
| 418 | * @brief Read from an open file. | ||
| 419 | * @param file The file handle to read from. | ||
| 420 | * @param lpBuf The buffer to store the data in. | ||
| 421 | * @param uiBufSize The size of the buffer. | ||
| 422 | * @return number of successfully read bytes if any bytes were read and stored in | ||
| 423 | * buffer, zero if no bytes are available to read (end of file was reached) | ||
| 424 | * or undetectable error occur, -1 in case of any explicit error | ||
| 425 | */ | ||
| 426 | ssize_t ReadFile(void* file, void* lpBuf, size_t uiBufSize) | ||
| 427 | { | ||
| 428 | return XBMC_read_file(m_Handle, m_Callbacks, file, lpBuf, uiBufSize); | ||
| 429 | } | ||
| 430 | |||
| 431 | /*! | ||
| 432 | * @brief Read a string from an open file. | ||
| 433 | * @param file The file handle to read from. | ||
| 434 | * @param szLine The buffer to store the data in. | ||
| 435 | * @param iLineLength The size of the buffer. | ||
| 436 | * @return True when a line was read, false otherwise. | ||
| 437 | */ | ||
| 438 | bool ReadFileString(void* file, char *szLine, int iLineLength) | ||
| 439 | { | ||
| 440 | return XBMC_read_file_string(m_Handle, m_Callbacks, file, szLine, iLineLength); | ||
| 441 | } | ||
| 442 | |||
| 443 | /*! | ||
| 444 | * @brief Write to a file opened in write mode. | ||
| 445 | * @param file The file handle to write to. | ||
| 446 | * @param lpBuf The data to write. | ||
| 447 | * @param uiBufSize Size of the data to write. | ||
| 448 | * @return number of successfully written bytes if any bytes were written, | ||
| 449 | * zero if no bytes were written and no detectable error occur, | ||
| 450 | * -1 in case of any explicit error | ||
| 451 | */ | ||
| 452 | ssize_t WriteFile(void* file, const void* lpBuf, size_t uiBufSize) | ||
| 453 | { | ||
| 454 | return XBMC_write_file(m_Handle, m_Callbacks, file, lpBuf, uiBufSize); | ||
| 455 | } | ||
| 456 | |||
| 457 | /*! | ||
| 458 | * @brief Flush buffered data. | ||
| 459 | * @param file The file handle to flush the data for. | ||
| 460 | */ | ||
| 461 | void FlushFile(void* file) | ||
| 462 | { | ||
| 463 | return XBMC_flush_file(m_Handle, m_Callbacks, file); | ||
| 464 | } | ||
| 465 | |||
| 466 | /*! | ||
| 467 | * @brief Seek in an open file. | ||
| 468 | * @param file The file handle to see in. | ||
| 469 | * @param iFilePosition The new position. | ||
| 470 | * @param iWhence Seek argument. See stdio.h for possible values. | ||
| 471 | * @return The new position. | ||
| 472 | */ | ||
| 473 | int64_t SeekFile(void* file, int64_t iFilePosition, int iWhence) | ||
| 474 | { | ||
| 475 | return XBMC_seek_file(m_Handle, m_Callbacks, file, iFilePosition, iWhence); | ||
| 476 | } | ||
| 477 | |||
| 478 | /*! | ||
| 479 | * @brief Truncate a file to the requested size. | ||
| 480 | * @param file The file handle to truncate. | ||
| 481 | * @param iSize The new max size. | ||
| 482 | * @return New size? | ||
| 483 | */ | ||
| 484 | int TruncateFile(void* file, int64_t iSize) | ||
| 485 | { | ||
| 486 | return XBMC_truncate_file(m_Handle, m_Callbacks, file, iSize); | ||
| 487 | } | ||
| 488 | |||
| 489 | /*! | ||
| 490 | * @brief The current position in an open file. | ||
| 491 | * @param file The file handle to get the position for. | ||
| 492 | * @return The requested position. | ||
| 493 | */ | ||
| 494 | int64_t GetFilePosition(void* file) | ||
| 495 | { | ||
| 496 | return XBMC_get_file_position(m_Handle, m_Callbacks, file); | ||
| 497 | } | ||
| 498 | |||
| 499 | /*! | ||
| 500 | * @brief Get the file size of an open file. | ||
| 501 | * @param file The file to get the size for. | ||
| 502 | * @return The requested size. | ||
| 503 | */ | ||
| 504 | int64_t GetFileLength(void* file) | ||
| 505 | { | ||
| 506 | return XBMC_get_file_length(m_Handle, m_Callbacks, file); | ||
| 507 | } | ||
| 508 | |||
| 509 | /*! | ||
| 510 | * @brief Get the download speed of an open file if available. | ||
| 511 | * @param file The file to get the size for. | ||
| 512 | * @return The download speed in seconds. | ||
| 513 | */ | ||
| 514 | double GetFileDownloadSpeed(void* file) | ||
| 515 | { | ||
| 516 | return XBMC_get_file_download_speed(m_Handle, m_Callbacks, file); | ||
| 517 | } | ||
| 518 | |||
| 519 | /*! | ||
| 520 | * @brief Close an open file. | ||
| 521 | * @param file The file handle to close. | ||
| 522 | */ | ||
| 523 | void CloseFile(void* file) | ||
| 524 | { | ||
| 525 | return XBMC_close_file(m_Handle, m_Callbacks, file); | ||
| 526 | } | ||
| 527 | |||
| 528 | /*! | ||
| 529 | * @brief Get the chunk size for an open file. | ||
| 530 | * @param file the file handle to get the size for. | ||
| 531 | * @return The requested size. | ||
| 532 | */ | ||
| 533 | int GetFileChunkSize(void* file) | ||
| 534 | { | ||
| 535 | return XBMC_get_file_chunk_size(m_Handle, m_Callbacks, file); | ||
| 536 | } | ||
| 537 | |||
| 538 | /*! | ||
| 539 | * @brief Check if a file exists. | ||
| 540 | * @param strFileName The filename to check. | ||
| 541 | * @param bUseCache Check in file cache. | ||
| 542 | * @return true if the file exists false otherwise. | ||
| 543 | */ | ||
| 544 | bool FileExists(const char *strFileName, bool bUseCache) | ||
| 545 | { | ||
| 546 | return XBMC_file_exists(m_Handle, m_Callbacks, strFileName, bUseCache); | ||
| 547 | } | ||
| 548 | |||
| 549 | /*! | ||
| 550 | * @brief Reads file status. | ||
| 551 | * @param strFileName The filename to read the status from. | ||
| 552 | * @param buffer The file status is written into this buffer. | ||
| 553 | * @return The file status was successfully read. | ||
| 554 | */ | ||
| 555 | int StatFile(const char *strFileName, struct __stat64* buffer) | ||
| 556 | { | ||
| 557 | return XBMC_stat_file(m_Handle, m_Callbacks, strFileName, buffer); | ||
| 558 | } | ||
| 559 | |||
| 560 | /*! | ||
| 561 | * @brief Deletes a file. | ||
| 562 | * @param strFileName The filename to delete. | ||
| 563 | * @return The file was successfully deleted. | ||
| 564 | */ | ||
| 565 | bool DeleteFile(const char *strFileName) | ||
| 566 | { | ||
| 567 | return XBMC_delete_file(m_Handle, m_Callbacks, strFileName); | ||
| 568 | } | ||
| 569 | |||
| 570 | /*! | ||
| 571 | * @brief Checks whether a directory can be opened. | ||
| 572 | * @param strUrl The URL of the directory to check. | ||
| 573 | * @return True when it can be opened, false otherwise. | ||
| 574 | */ | ||
| 575 | bool CanOpenDirectory(const char* strUrl) | ||
| 576 | { | ||
| 577 | return XBMC_can_open_directory(m_Handle, m_Callbacks, strUrl); | ||
| 578 | } | ||
| 579 | |||
| 580 | /*! | ||
| 581 | * @brief Creates a directory. | ||
| 582 | * @param strPath Path to the directory. | ||
| 583 | * @return True when it was created, false otherwise. | ||
| 584 | */ | ||
| 585 | bool CreateDirectory(const char *strPath) | ||
| 586 | { | ||
| 587 | return XBMC_create_directory(m_Handle, m_Callbacks, strPath); | ||
| 588 | } | ||
| 589 | |||
| 590 | /*! | ||
| 591 | * @brief Checks if a directory exists. | ||
| 592 | * @param strPath Path to the directory. | ||
| 593 | * @return True when it exists, false otherwise. | ||
| 594 | */ | ||
| 595 | bool DirectoryExists(const char *strPath) | ||
| 596 | { | ||
| 597 | return XBMC_directory_exists(m_Handle, m_Callbacks, strPath); | ||
| 598 | } | ||
| 599 | |||
| 600 | /*! | ||
| 601 | * @brief Removes a directory. | ||
| 602 | * @param strPath Path to the directory. | ||
| 603 | * @return True when it was removed, false otherwise. | ||
| 604 | */ | ||
| 605 | bool RemoveDirectory(const char *strPath) | ||
| 606 | { | ||
| 607 | return XBMC_remove_directory(m_Handle, m_Callbacks, strPath); | ||
| 608 | } | ||
| 609 | |||
| 610 | /*! | ||
| 611 | * @brief Lists a directory. | ||
| 612 | * @param strPath Path to the directory. | ||
| 613 | * @param mask File mask | ||
| 614 | * @param items The directory entries | ||
| 615 | * @param num_items Number of entries in directory | ||
| 616 | * @return True if listing was successful, false otherwise. | ||
| 617 | */ | ||
| 618 | bool GetDirectory(const char *strPath, const char* mask, VFSDirEntry** items, unsigned int* num_items) | ||
| 619 | { | ||
| 620 | return XBMC_get_directory(m_Handle, m_Callbacks, strPath, mask, items, num_items); | ||
| 621 | } | ||
| 622 | |||
| 623 | /*! | ||
| 624 | * @brief Free a directory list | ||
| 625 | * @param items The directory entries | ||
| 626 | * @param num_items Number of entries in directory | ||
| 627 | */ | ||
| 628 | void FreeDirectory(VFSDirEntry* items, unsigned int num_items) | ||
| 629 | { | ||
| 630 | return XBMC_free_directory(m_Handle, m_Callbacks, items, num_items); | ||
| 631 | } | ||
| 632 | |||
| 633 | /*! | ||
| 634 | * @brief Create a Curl representation | ||
| 635 | * @param strURL the URL of the Type. | ||
| 636 | */ | ||
| 637 | void* CURLCreate(const char* strURL) | ||
| 638 | { | ||
| 639 | return XBMC_curl_create(m_Handle, m_Callbacks, strURL); | ||
| 640 | } | ||
| 641 | |||
| 642 | /*! | ||
| 643 | * @brief Adds options to the curl file created with CURLCeate | ||
| 644 | * @param file file pointer to the file returned by CURLCeate | ||
| 645 | * @param type option type to set | ||
| 646 | * @param name name of the option | ||
| 647 | * @param value value of the option | ||
| 648 | */ | ||
| 649 | bool CURLAddOption(void* file, XFILE::CURLOPTIONTYPE type, const char* name, const char * value) | ||
| 650 | { | ||
| 651 | return XBMC_curl_add_option(m_Handle, m_Callbacks, file, type, name, value); | ||
| 652 | } | ||
| 653 | |||
| 654 | /*! | ||
| 655 | * @brief Opens the curl file created with CURLCeate | ||
| 656 | * @param file file pointer to the file returned by CURLCeate | ||
| 657 | * @param flags one or more bitwise or combinded flags form XFILE | ||
| 658 | */ | ||
| 659 | bool CURLOpen(void* file, unsigned int flags) | ||
| 660 | { | ||
| 661 | return XBMC_curl_open(m_Handle, m_Callbacks, file, flags); | ||
| 662 | } | ||
| 663 | |||
| 664 | protected: | ||
| 665 | void* (*XBMC_register_me)(void *HANDLE); | ||
| 666 | void (*XBMC_unregister_me)(void *HANDLE, void* CB); | ||
| 667 | void (*XBMC_log)(void *HANDLE, void* CB, const addon_log_t loglevel, const char *msg); | ||
| 668 | bool (*XBMC_get_setting)(void *HANDLE, void* CB, const char* settingName, void *settingValue); | ||
| 669 | void (*XBMC_queue_notification)(void *HANDLE, void* CB, const queue_msg_t type, const char *msg); | ||
| 670 | bool (*XBMC_wake_on_lan)(void *HANDLE, void* CB, const char* mac); | ||
| 671 | char* (*XBMC_unknown_to_utf8)(void *HANDLE, void* CB, const char* str); | ||
| 672 | char* (*XBMC_get_localized_string)(void *HANDLE, void* CB, int dwCode); | ||
| 673 | char* (*XBMC_get_dvd_menu_language)(void *HANDLE, void* CB); | ||
| 674 | void (*XBMC_free_string)(void *HANDLE, void* CB, char* str); | ||
| 675 | void* (*XBMC_open_file)(void *HANDLE, void* CB, const char* strFileName, unsigned int flags); | ||
| 676 | void* (*XBMC_open_file_for_write)(void *HANDLE, void* CB, const char* strFileName, bool bOverWrite); | ||
| 677 | ssize_t (*XBMC_read_file)(void *HANDLE, void* CB, void* file, void* lpBuf, size_t uiBufSize); | ||
| 678 | bool (*XBMC_read_file_string)(void *HANDLE, void* CB, void* file, char *szLine, int iLineLength); | ||
| 679 | ssize_t(*XBMC_write_file)(void *HANDLE, void* CB, void* file, const void* lpBuf, size_t uiBufSize); | ||
| 680 | void (*XBMC_flush_file)(void *HANDLE, void* CB, void* file); | ||
| 681 | int64_t (*XBMC_seek_file)(void *HANDLE, void* CB, void* file, int64_t iFilePosition, int iWhence); | ||
| 682 | int (*XBMC_truncate_file)(void *HANDLE, void* CB, void* file, int64_t iSize); | ||
| 683 | int64_t (*XBMC_get_file_position)(void *HANDLE, void* CB, void* file); | ||
| 684 | int64_t (*XBMC_get_file_length)(void *HANDLE, void* CB, void* file); | ||
| 685 | double(*XBMC_get_file_download_speed)(void *HANDLE, void* CB, void* file); | ||
| 686 | void (*XBMC_close_file)(void *HANDLE, void* CB, void* file); | ||
| 687 | int (*XBMC_get_file_chunk_size)(void *HANDLE, void* CB, void* file); | ||
| 688 | bool (*XBMC_file_exists)(void *HANDLE, void* CB, const char *strFileName, bool bUseCache); | ||
| 689 | int (*XBMC_stat_file)(void *HANDLE, void* CB, const char *strFileName, struct __stat64* buffer); | ||
| 690 | bool (*XBMC_delete_file)(void *HANDLE, void* CB, const char *strFileName); | ||
| 691 | bool (*XBMC_can_open_directory)(void *HANDLE, void* CB, const char* strURL); | ||
| 692 | bool (*XBMC_create_directory)(void *HANDLE, void* CB, const char* strPath); | ||
| 693 | bool (*XBMC_directory_exists)(void *HANDLE, void* CB, const char* strPath); | ||
| 694 | bool (*XBMC_remove_directory)(void *HANDLE, void* CB, const char* strPath); | ||
| 695 | bool (*XBMC_get_directory)(void *HANDLE, void* CB, const char* strPath, const char* mask, VFSDirEntry** items, unsigned int* num_items); | ||
| 696 | void (*XBMC_free_directory)(void *HANDLE, void* CB, VFSDirEntry* items, unsigned int num_items); | ||
| 697 | void* (*XBMC_curl_create)(void *HANDLE, void* CB, const char* strURL); | ||
| 698 | bool (*XBMC_curl_add_option)(void *HANDLE, void* CB, void *file, XFILE::CURLOPTIONTYPE type, const char* name, const char *value); | ||
| 699 | bool (*XBMC_curl_open)(void *m_Handle, void *m_Callbacks, void *file, unsigned int flags); | ||
| 700 | |||
| 701 | private: | ||
| 702 | void *m_libXBMC_addon; | ||
| 703 | void *m_Handle; | ||
| 704 | void *m_Callbacks; | ||
| 705 | struct cb_array | ||
| 706 | { | ||
| 707 | const char* libPath; | ||
| 708 | }; | ||
| 709 | }; | ||
| 710 | }; | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h new file mode 100644 index 0000000..3853f08 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2013 Team XBMC | ||
| 4 | * http://xbmc.org | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with XBMC; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <string> | ||
| 23 | #include <vector> | ||
| 24 | #include <string.h> | ||
| 25 | #include <stdlib.h> | ||
| 26 | #include <stdio.h> | ||
| 27 | #include "xbmc_codec_types.h" | ||
| 28 | #include "libXBMC_addon.h" | ||
| 29 | |||
| 30 | #ifdef _WIN32 | ||
| 31 | #define CODEC_HELPER_DLL "\\library.xbmc.codec\\libXBMC_codec" ADDON_HELPER_EXT | ||
| 32 | #else | ||
| 33 | #define CODEC_HELPER_DLL_NAME "libXBMC_codec-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 34 | #define CODEC_HELPER_DLL "/library.xbmc.codec/" CODEC_HELPER_DLL_NAME | ||
| 35 | #endif | ||
| 36 | |||
| 37 | class CHelper_libXBMC_codec | ||
| 38 | { | ||
| 39 | public: | ||
| 40 | CHelper_libXBMC_codec(void) | ||
| 41 | { | ||
| 42 | m_libXBMC_codec = NULL; | ||
| 43 | m_Handle = NULL; | ||
| 44 | } | ||
| 45 | |||
| 46 | ~CHelper_libXBMC_codec(void) | ||
| 47 | { | ||
| 48 | if (m_libXBMC_codec) | ||
| 49 | { | ||
| 50 | CODEC_unregister_me(m_Handle, m_Callbacks); | ||
| 51 | dlclose(m_libXBMC_codec); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
| 55 | /*! | ||
| 56 | * @brief Resolve all callback methods | ||
| 57 | * @param handle Pointer to the add-on | ||
| 58 | * @return True when all methods were resolved, false otherwise. | ||
| 59 | */ | ||
| 60 | bool RegisterMe(void* handle) | ||
| 61 | { | ||
| 62 | m_Handle = handle; | ||
| 63 | |||
| 64 | std::string libBasePath; | ||
| 65 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 66 | libBasePath += CODEC_HELPER_DLL; | ||
| 67 | |||
| 68 | #if defined(ANDROID) | ||
| 69 | struct stat st; | ||
| 70 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 71 | { | ||
| 72 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 73 | libBasePath = tempbin + "/" + CODEC_HELPER_DLL_NAME; | ||
| 74 | } | ||
| 75 | #endif | ||
| 76 | |||
| 77 | m_libXBMC_codec = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 78 | if (m_libXBMC_codec == NULL) | ||
| 79 | { | ||
| 80 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 81 | return false; | ||
| 82 | } | ||
| 83 | |||
| 84 | CODEC_register_me = (void* (*)(void *HANDLE)) | ||
| 85 | dlsym(m_libXBMC_codec, "CODEC_register_me"); | ||
| 86 | if (CODEC_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 87 | |||
| 88 | CODEC_unregister_me = (void (*)(void* HANDLE, void* CB)) | ||
| 89 | dlsym(m_libXBMC_codec, "CODEC_unregister_me"); | ||
| 90 | if (CODEC_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 91 | |||
| 92 | CODEC_get_codec_by_name = (xbmc_codec_t (*)(void* HANDLE, void* CB, const char* strCodecName)) | ||
| 93 | dlsym(m_libXBMC_codec, "CODEC_get_codec_by_name"); | ||
| 94 | if (CODEC_get_codec_by_name == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 95 | |||
| 96 | m_Callbacks = CODEC_register_me(m_Handle); | ||
| 97 | return m_Callbacks != NULL; | ||
| 98 | } | ||
| 99 | |||
| 100 | /*! | ||
| 101 | * @brief Get the codec id used by XBMC | ||
| 102 | * @param strCodecName The name of the codec | ||
| 103 | * @return The codec_id, or a codec_id with 0 values when not supported | ||
| 104 | */ | ||
| 105 | xbmc_codec_t GetCodecByName(const char* strCodecName) | ||
| 106 | { | ||
| 107 | return CODEC_get_codec_by_name(m_Handle, m_Callbacks, strCodecName); | ||
| 108 | } | ||
| 109 | |||
| 110 | protected: | ||
| 111 | void* (*CODEC_register_me)(void*); | ||
| 112 | void (*CODEC_unregister_me)(void*, void*); | ||
| 113 | xbmc_codec_t (*CODEC_get_codec_by_name)(void *HANDLE, void* CB, const char* strCodecName); | ||
| 114 | |||
| 115 | private: | ||
| 116 | void* m_libXBMC_codec; | ||
| 117 | void* m_Handle; | ||
| 118 | void* m_Callbacks; | ||
| 119 | struct cb_array | ||
| 120 | { | ||
| 121 | const char* libPath; | ||
| 122 | }; | ||
| 123 | }; | ||
| 124 | |||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h new file mode 100644 index 0000000..3e3d479 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | |||
| @@ -0,0 +1,366 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2013 Team XBMC | ||
| 4 | * http://xbmc.org | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with XBMC; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <string> | ||
| 23 | #include <vector> | ||
| 24 | #include <string.h> | ||
| 25 | #include <stdlib.h> | ||
| 26 | #include <stdio.h> | ||
| 27 | #include "xbmc_pvr_types.h" | ||
| 28 | #include "libXBMC_addon.h" | ||
| 29 | |||
| 30 | #ifdef _WIN32 | ||
| 31 | #define PVR_HELPER_DLL "\\library.xbmc.pvr\\libXBMC_pvr" ADDON_HELPER_EXT | ||
| 32 | #else | ||
| 33 | #define PVR_HELPER_DLL_NAME "libXBMC_pvr-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 34 | #define PVR_HELPER_DLL "/library.xbmc.pvr/" PVR_HELPER_DLL_NAME | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #define DVD_TIME_BASE 1000000 | ||
| 38 | #define DVD_NOPTS_VALUE (-1LL<<52) // should be possible to represent in both double and __int64 | ||
| 39 | |||
| 40 | class CHelper_libXBMC_pvr | ||
| 41 | { | ||
| 42 | public: | ||
| 43 | CHelper_libXBMC_pvr(void) | ||
| 44 | { | ||
| 45 | m_libXBMC_pvr = NULL; | ||
| 46 | m_Handle = NULL; | ||
| 47 | } | ||
| 48 | |||
| 49 | ~CHelper_libXBMC_pvr(void) | ||
| 50 | { | ||
| 51 | if (m_libXBMC_pvr) | ||
| 52 | { | ||
| 53 | PVR_unregister_me(m_Handle, m_Callbacks); | ||
| 54 | dlclose(m_libXBMC_pvr); | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | /*! | ||
| 59 | * @brief Resolve all callback methods | ||
| 60 | * @param handle Pointer to the add-on | ||
| 61 | * @return True when all methods were resolved, false otherwise. | ||
| 62 | */ | ||
| 63 | bool RegisterMe(void* handle) | ||
| 64 | { | ||
| 65 | m_Handle = handle; | ||
| 66 | |||
| 67 | std::string libBasePath; | ||
| 68 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 69 | libBasePath += PVR_HELPER_DLL; | ||
| 70 | |||
| 71 | #if defined(ANDROID) | ||
| 72 | struct stat st; | ||
| 73 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 74 | { | ||
| 75 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 76 | libBasePath = tempbin + "/" + PVR_HELPER_DLL_NAME; | ||
| 77 | } | ||
| 78 | #endif | ||
| 79 | |||
| 80 | m_libXBMC_pvr = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 81 | if (m_libXBMC_pvr == NULL) | ||
| 82 | { | ||
| 83 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 84 | return false; | ||
| 85 | } | ||
| 86 | |||
| 87 | PVR_register_me = (void* (*)(void *HANDLE)) | ||
| 88 | dlsym(m_libXBMC_pvr, "PVR_register_me"); | ||
| 89 | if (PVR_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 90 | |||
| 91 | PVR_unregister_me = (void (*)(void* HANDLE, void* CB)) | ||
| 92 | dlsym(m_libXBMC_pvr, "PVR_unregister_me"); | ||
| 93 | if (PVR_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 94 | |||
| 95 | PVR_transfer_epg_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const EPG_TAG *epgentry)) | ||
| 96 | dlsym(m_libXBMC_pvr, "PVR_transfer_epg_entry"); | ||
| 97 | if (PVR_transfer_epg_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 98 | |||
| 99 | PVR_transfer_channel_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_CHANNEL *chan)) | ||
| 100 | dlsym(m_libXBMC_pvr, "PVR_transfer_channel_entry"); | ||
| 101 | if (PVR_transfer_channel_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 102 | |||
| 103 | PVR_transfer_timer_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_TIMER *timer)) | ||
| 104 | dlsym(m_libXBMC_pvr, "PVR_transfer_timer_entry"); | ||
| 105 | if (PVR_transfer_timer_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 106 | |||
| 107 | PVR_transfer_recording_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_RECORDING *recording)) | ||
| 108 | dlsym(m_libXBMC_pvr, "PVR_transfer_recording_entry"); | ||
| 109 | if (PVR_transfer_recording_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 110 | |||
| 111 | PVR_add_menu_hook = (void (*)(void* HANDLE, void* CB, PVR_MENUHOOK *hook)) | ||
| 112 | dlsym(m_libXBMC_pvr, "PVR_add_menu_hook"); | ||
| 113 | if (PVR_add_menu_hook == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 114 | |||
| 115 | PVR_recording = (void (*)(void* HANDLE, void* CB, const char *Name, const char *FileName, bool On)) | ||
| 116 | dlsym(m_libXBMC_pvr, "PVR_recording"); | ||
| 117 | if (PVR_recording == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 118 | |||
| 119 | PVR_trigger_timer_update = (void (*)(void* HANDLE, void* CB)) | ||
| 120 | dlsym(m_libXBMC_pvr, "PVR_trigger_timer_update"); | ||
| 121 | if (PVR_trigger_timer_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 122 | |||
| 123 | PVR_trigger_recording_update = (void (*)(void* HANDLE, void* CB)) | ||
| 124 | dlsym(m_libXBMC_pvr, "PVR_trigger_recording_update"); | ||
| 125 | if (PVR_trigger_recording_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 126 | |||
| 127 | PVR_trigger_channel_update = (void (*)(void* HANDLE, void* CB)) | ||
| 128 | dlsym(m_libXBMC_pvr, "PVR_trigger_channel_update"); | ||
| 129 | if (PVR_trigger_channel_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 130 | |||
| 131 | PVR_trigger_channel_groups_update = (void (*)(void* HANDLE, void* CB)) | ||
| 132 | dlsym(m_libXBMC_pvr, "PVR_trigger_channel_groups_update"); | ||
| 133 | if (PVR_trigger_channel_groups_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 134 | |||
| 135 | PVR_trigger_epg_update = (void (*)(void* HANDLE, void* CB, unsigned int iChannelUid)) | ||
| 136 | dlsym(m_libXBMC_pvr, "PVR_trigger_epg_update"); | ||
| 137 | if (PVR_trigger_epg_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 138 | |||
| 139 | PVR_transfer_channel_group = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group)) | ||
| 140 | dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group"); | ||
| 141 | if (PVR_transfer_channel_group == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 142 | |||
| 143 | PVR_transfer_channel_group_member = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member)) | ||
| 144 | dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group_member"); | ||
| 145 | if (PVR_transfer_channel_group_member == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 146 | |||
| 147 | #ifdef USE_DEMUX | ||
| 148 | PVR_free_demux_packet = (void (*)(void* HANDLE, void* CB, DemuxPacket* pPacket)) | ||
| 149 | dlsym(m_libXBMC_pvr, "PVR_free_demux_packet"); | ||
| 150 | if (PVR_free_demux_packet == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 151 | |||
| 152 | PVR_allocate_demux_packet = (DemuxPacket* (*)(void* HANDLE, void* CB, int iDataSize)) | ||
| 153 | dlsym(m_libXBMC_pvr, "PVR_allocate_demux_packet"); | ||
| 154 | if (PVR_allocate_demux_packet == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 155 | #endif | ||
| 156 | |||
| 157 | PVR_connection_state_change = (void (*)(void* HANDLE, void* CB, const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage)) | ||
| 158 | dlsym(m_libXBMC_pvr, "PVR_connection_state_change"); | ||
| 159 | if (PVR_connection_state_change == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 160 | |||
| 161 | PVR_epg_event_state_change = (void (*)(void* HANDLE, void* CB, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState)) | ||
| 162 | dlsym(m_libXBMC_pvr, "PVR_epg_event_state_change"); | ||
| 163 | if (PVR_epg_event_state_change == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 164 | |||
| 165 | m_Callbacks = PVR_register_me(m_Handle); | ||
| 166 | return m_Callbacks != NULL; | ||
| 167 | } | ||
| 168 | |||
| 169 | /*! | ||
| 170 | * @brief Transfer an EPG tag from the add-on to XBMC | ||
| 171 | * @param handle The handle parameter that XBMC used when requesting the EPG data | ||
| 172 | * @param entry The entry to transfer to XBMC | ||
| 173 | */ | ||
| 174 | void TransferEpgEntry(const ADDON_HANDLE handle, const EPG_TAG* entry) | ||
| 175 | { | ||
| 176 | return PVR_transfer_epg_entry(m_Handle, m_Callbacks, handle, entry); | ||
| 177 | } | ||
| 178 | |||
| 179 | /*! | ||
| 180 | * @brief Transfer a channel entry from the add-on to XBMC | ||
| 181 | * @param handle The handle parameter that XBMC used when requesting the channel list | ||
| 182 | * @param entry The entry to transfer to XBMC | ||
| 183 | */ | ||
| 184 | void TransferChannelEntry(const ADDON_HANDLE handle, const PVR_CHANNEL* entry) | ||
| 185 | { | ||
| 186 | return PVR_transfer_channel_entry(m_Handle, m_Callbacks, handle, entry); | ||
| 187 | } | ||
| 188 | |||
| 189 | /*! | ||
| 190 | * @brief Transfer a timer entry from the add-on to XBMC | ||
| 191 | * @param handle The handle parameter that XBMC used when requesting the timers list | ||
| 192 | * @param entry The entry to transfer to XBMC | ||
| 193 | */ | ||
| 194 | void TransferTimerEntry(const ADDON_HANDLE handle, const PVR_TIMER* entry) | ||
| 195 | { | ||
| 196 | return PVR_transfer_timer_entry(m_Handle, m_Callbacks, handle, entry); | ||
| 197 | } | ||
| 198 | |||
| 199 | /*! | ||
| 200 | * @brief Transfer a recording entry from the add-on to XBMC | ||
| 201 | * @param handle The handle parameter that XBMC used when requesting the recordings list | ||
| 202 | * @param entry The entry to transfer to XBMC | ||
| 203 | */ | ||
| 204 | void TransferRecordingEntry(const ADDON_HANDLE handle, const PVR_RECORDING* entry) | ||
| 205 | { | ||
| 206 | return PVR_transfer_recording_entry(m_Handle, m_Callbacks, handle, entry); | ||
| 207 | } | ||
| 208 | |||
| 209 | /*! | ||
| 210 | * @brief Transfer a channel group from the add-on to XBMC. The group will be created if it doesn't exist. | ||
| 211 | * @param handle The handle parameter that XBMC used when requesting the channel groups list | ||
| 212 | * @param entry The entry to transfer to XBMC | ||
| 213 | */ | ||
| 214 | void TransferChannelGroup(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP* entry) | ||
| 215 | { | ||
| 216 | return PVR_transfer_channel_group(m_Handle, m_Callbacks, handle, entry); | ||
| 217 | } | ||
| 218 | |||
| 219 | /*! | ||
| 220 | * @brief Transfer a channel group member entry from the add-on to XBMC. The channel will be added to the group if the group can be found. | ||
| 221 | * @param handle The handle parameter that XBMC used when requesting the channel group members list | ||
| 222 | * @param entry The entry to transfer to XBMC | ||
| 223 | */ | ||
| 224 | void TransferChannelGroupMember(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER* entry) | ||
| 225 | { | ||
| 226 | return PVR_transfer_channel_group_member(m_Handle, m_Callbacks, handle, entry); | ||
| 227 | } | ||
| 228 | |||
| 229 | /*! | ||
| 230 | * @brief Add or replace a menu hook for the context menu for this add-on | ||
| 231 | * @param hook The hook to add | ||
| 232 | */ | ||
| 233 | void AddMenuHook(PVR_MENUHOOK* hook) | ||
| 234 | { | ||
| 235 | return PVR_add_menu_hook(m_Handle, m_Callbacks, hook); | ||
| 236 | } | ||
| 237 | |||
| 238 | /*! | ||
| 239 | * @brief Display a notification in XBMC that a recording started or stopped on the server | ||
| 240 | * @param strRecordingName The name of the recording to display | ||
| 241 | * @param strFileName The filename of the recording | ||
| 242 | * @param bOn True when recording started, false when it stopped | ||
| 243 | */ | ||
| 244 | void Recording(const char* strRecordingName, const char* strFileName, bool bOn) | ||
| 245 | { | ||
| 246 | return PVR_recording(m_Handle, m_Callbacks, strRecordingName, strFileName, bOn); | ||
| 247 | } | ||
| 248 | |||
| 249 | /*! | ||
| 250 | * @brief Request XBMC to update it's list of timers | ||
| 251 | */ | ||
| 252 | void TriggerTimerUpdate(void) | ||
| 253 | { | ||
| 254 | return PVR_trigger_timer_update(m_Handle, m_Callbacks); | ||
| 255 | } | ||
| 256 | |||
| 257 | /*! | ||
| 258 | * @brief Request XBMC to update it's list of recordings | ||
| 259 | */ | ||
| 260 | void TriggerRecordingUpdate(void) | ||
| 261 | { | ||
| 262 | return PVR_trigger_recording_update(m_Handle, m_Callbacks); | ||
| 263 | } | ||
| 264 | |||
| 265 | /*! | ||
| 266 | * @brief Request XBMC to update it's list of channels | ||
| 267 | */ | ||
| 268 | void TriggerChannelUpdate(void) | ||
| 269 | { | ||
| 270 | return PVR_trigger_channel_update(m_Handle, m_Callbacks); | ||
| 271 | } | ||
| 272 | |||
| 273 | /*! | ||
| 274 | * @brief Schedule an EPG update for the given channel channel | ||
| 275 | * @param iChannelUid The unique id of the channel for this add-on | ||
| 276 | */ | ||
| 277 | void TriggerEpgUpdate(unsigned int iChannelUid) | ||
| 278 | { | ||
| 279 | return PVR_trigger_epg_update(m_Handle, m_Callbacks, iChannelUid); | ||
| 280 | } | ||
| 281 | |||
| 282 | /*! | ||
| 283 | * @brief Request XBMC to update it's list of channel groups | ||
| 284 | */ | ||
| 285 | void TriggerChannelGroupsUpdate(void) | ||
| 286 | { | ||
| 287 | return PVR_trigger_channel_groups_update(m_Handle, m_Callbacks); | ||
| 288 | } | ||
| 289 | |||
| 290 | #ifdef USE_DEMUX | ||
| 291 | /*! | ||
| 292 | * @brief Free a packet that was allocated with AllocateDemuxPacket | ||
| 293 | * @param pPacket The packet to free | ||
| 294 | */ | ||
| 295 | void FreeDemuxPacket(DemuxPacket* pPacket) | ||
| 296 | { | ||
| 297 | return PVR_free_demux_packet(m_Handle, m_Callbacks, pPacket); | ||
| 298 | } | ||
| 299 | |||
| 300 | /*! | ||
| 301 | * @brief Allocate a demux packet. Free with FreeDemuxPacket | ||
| 302 | * @param iDataSize The size of the data that will go into the packet | ||
| 303 | * @return The allocated packet | ||
| 304 | */ | ||
| 305 | DemuxPacket* AllocateDemuxPacket(int iDataSize) | ||
| 306 | { | ||
| 307 | return PVR_allocate_demux_packet(m_Handle, m_Callbacks, iDataSize); | ||
| 308 | } | ||
| 309 | #endif | ||
| 310 | |||
| 311 | /*! | ||
| 312 | * @brief Notify a state change for a PVR backend connection | ||
| 313 | * @param strConnectionString The connection string reported by the backend that can be displayed in the UI. | ||
| 314 | * @param newState The new state. | ||
| 315 | * @param strMessage A localized addon-defined string representing the new state, that can be displayed | ||
| 316 | * in the UI or NULL if the Kodi-defined default string for the new state shall be displayed. | ||
| 317 | */ | ||
| 318 | void ConnectionStateChange(const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage) | ||
| 319 | { | ||
| 320 | return PVR_connection_state_change(m_Handle, m_Callbacks, strConnectionString, newState, strMessage); | ||
| 321 | } | ||
| 322 | |||
| 323 | /*! | ||
| 324 | * @brief Notify a state change for an EPG event | ||
| 325 | * @param tag The EPG event. | ||
| 326 | * @param iUniqueChannelId The unique id of the channel for the EPG event | ||
| 327 | * @param newState The new state. For EPG_EVENT_CREATED and EPG_EVENT_UPDATED, tag must be filled with all available | ||
| 328 | * event data, not just a delta. For EPG_EVENT_DELETED, it is sufficient to fill EPG_TAG.iUniqueBroadcastId | ||
| 329 | */ | ||
| 330 | void EpgEventStateChange(EPG_TAG *tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState) | ||
| 331 | { | ||
| 332 | return PVR_epg_event_state_change(m_Handle, m_Callbacks, tag, iUniqueChannelId, newState); | ||
| 333 | } | ||
| 334 | |||
| 335 | protected: | ||
| 336 | void* (*PVR_register_me)(void*); | ||
| 337 | void (*PVR_unregister_me)(void*, void*); | ||
| 338 | void (*PVR_transfer_epg_entry)(void*, void*, const ADDON_HANDLE, const EPG_TAG*); | ||
| 339 | void (*PVR_transfer_channel_entry)(void*, void*, const ADDON_HANDLE, const PVR_CHANNEL*); | ||
| 340 | void (*PVR_transfer_timer_entry)(void*, void*, const ADDON_HANDLE, const PVR_TIMER*); | ||
| 341 | void (*PVR_transfer_recording_entry)(void*, void*, const ADDON_HANDLE, const PVR_RECORDING*); | ||
| 342 | void (*PVR_add_menu_hook)(void*, void*, PVR_MENUHOOK*); | ||
| 343 | void (*PVR_recording)(void*, void*, const char*, const char*, bool); | ||
| 344 | void (*PVR_trigger_channel_update)(void*, void*); | ||
| 345 | void (*PVR_trigger_channel_groups_update)(void*, void*); | ||
| 346 | void (*PVR_trigger_timer_update)(void*, void*); | ||
| 347 | void (*PVR_trigger_recording_update)(void* , void*); | ||
| 348 | void (*PVR_trigger_epg_update)(void*, void*, unsigned int); | ||
| 349 | void (*PVR_transfer_channel_group)(void*, void*, const ADDON_HANDLE, const PVR_CHANNEL_GROUP*); | ||
| 350 | void (*PVR_transfer_channel_group_member)(void*, void*, const ADDON_HANDLE, const PVR_CHANNEL_GROUP_MEMBER*); | ||
| 351 | #ifdef USE_DEMUX | ||
| 352 | void (*PVR_free_demux_packet)(void*, void*, DemuxPacket*); | ||
| 353 | DemuxPacket* (*PVR_allocate_demux_packet)(void*, void*, int); | ||
| 354 | #endif | ||
| 355 | void (*PVR_connection_state_change)(void*, void*, const char*, PVR_CONNECTION_STATE, const char*); | ||
| 356 | void (*PVR_epg_event_state_change)(void*, void*, EPG_TAG*, unsigned int, EPG_EVENT_STATE); | ||
| 357 | |||
| 358 | private: | ||
| 359 | void* m_libXBMC_pvr; | ||
| 360 | void* m_Handle; | ||
| 361 | void* m_Callbacks; | ||
| 362 | struct cb_array | ||
| 363 | { | ||
| 364 | const char* libPath; | ||
| 365 | }; | ||
| 366 | }; | ||
diff --git a/xbmc/addons/include/xbmc_addon_cpp_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h index 3944525..2eb972e 100644 --- a/xbmc/addons/include/xbmc_addon_cpp_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | #ifndef __XBMC_ADDON_CPP_H__ | 1 | #pragma once |
| 2 | #define __XBMC_ADDON_CPP_H__ | ||
| 3 | 2 | ||
| 4 | /* | 3 | /* |
| 5 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 6 | * http://xbmc.org | 5 | * http://kodi.tv |
| 7 | * | 6 | * |
| 8 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -16,7 +15,7 @@ | |||
| 16 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 17 | * | 16 | * |
| 18 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 19 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 20 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 21 | * | 20 | * |
| 22 | */ | 21 | */ |
| @@ -105,7 +104,7 @@ public: | |||
| 105 | static unsigned int VecToStruct(std::vector<DllSetting> &vecSet, ADDON_StructSetting*** sSet) | 104 | static unsigned int VecToStruct(std::vector<DllSetting> &vecSet, ADDON_StructSetting*** sSet) |
| 106 | { | 105 | { |
| 107 | *sSet = NULL; | 106 | *sSet = NULL; |
| 108 | if(vecSet.size() == 0) | 107 | if (vecSet.empty()) |
| 109 | return 0; | 108 | return 0; |
| 110 | 109 | ||
| 111 | unsigned int uiElements=0; | 110 | unsigned int uiElements=0; |
| @@ -127,7 +126,7 @@ public: | |||
| 127 | (*sSet)[i]->current = vecSet[i].current; | 126 | (*sSet)[i]->current = vecSet[i].current; |
| 128 | (*sSet)[i]->entry_elements = 0; | 127 | (*sSet)[i]->entry_elements = 0; |
| 129 | (*sSet)[i]->entry = NULL; | 128 | (*sSet)[i]->entry = NULL; |
| 130 | if(vecSet[i].type == DllSetting::SPIN && vecSet[i].entry.size() > 0) | 129 | if(vecSet[i].type == DllSetting::SPIN && !vecSet[i].entry.empty()) |
| 131 | { | 130 | { |
| 132 | (*sSet)[i]->entry = (char**)malloc(vecSet[i].entry.size()*sizeof(char**)); | 131 | (*sSet)[i]->entry = (char**)malloc(vecSet[i].entry.size()*sizeof(char**)); |
| 133 | for(unsigned int j=0;j<vecSet[i].entry.size();j++) | 132 | for(unsigned int j=0;j<vecSet[i].entry.size();j++) |
| @@ -188,4 +187,3 @@ public: | |||
| 188 | } | 187 | } |
| 189 | }; | 188 | }; |
| 190 | 189 | ||
| 191 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_addon_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h index fa6415f..ff7194f 100644 --- a/xbmc/addons/include/xbmc_addon_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | #ifndef __XBMC_ADDON_DLL_H__ | 1 | #pragma once |
| 2 | #define __XBMC_ADDON_DLL_H__ | ||
| 3 | 2 | ||
| 4 | /* | 3 | /* |
| 5 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 6 | * http://xbmc.org | 5 | * http://kodi.tv |
| 7 | * | 6 | * |
| 8 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -16,7 +15,7 @@ | |||
| 16 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 17 | * | 16 | * |
| 18 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 19 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 20 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 21 | * | 20 | * |
| 22 | */ | 21 | */ |
| @@ -51,5 +50,3 @@ extern "C" { | |||
| 51 | #ifdef __cplusplus | 50 | #ifdef __cplusplus |
| 52 | }; | 51 | }; |
| 53 | #endif | 52 | #endif |
| 54 | |||
| 55 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_addon_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h index bd6cbe8..2ceb5c5 100644 --- a/xbmc/addons/include/xbmc_addon_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | #ifndef __XBMC_ADDON_TYPES_H__ | 1 | #pragma once |
| 2 | #define __XBMC_ADDON_TYPES_H__ | ||
| 3 | 2 | ||
| 4 | /* | 3 | /* |
| 5 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 6 | * http://xbmc.org | 5 | * http://kodi.tv |
| 7 | * | 6 | * |
| 8 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -16,7 +15,7 @@ | |||
| 16 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 17 | * | 16 | * |
| 18 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 19 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 20 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 21 | * | 20 | * |
| 22 | */ | 21 | */ |
| @@ -61,4 +60,3 @@ typedef ADDON_HANDLE_STRUCT *ADDON_HANDLE; | |||
| 61 | }; | 60 | }; |
| 62 | #endif | 61 | #endif |
| 63 | 62 | ||
| 64 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_audioenc_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h index 01e8d12..932d34f 100644 --- a/xbmc/addons/include/xbmc_audioenc_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | |||
| 2 | /* | 3 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 4 | * http://xbmc.org | 5 | * http://kodi.tv |
| 5 | * | 6 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -14,14 +15,11 @@ | |||
| 14 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 15 | * | 16 | * |
| 16 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 17 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 18 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 19 | * | 20 | * |
| 20 | */ | 21 | */ |
| 21 | 22 | ||
| 22 | #ifndef __XBMC_AUDIOENC_H__ | ||
| 23 | #define __XBMC_AUDIOENC_H__ | ||
| 24 | |||
| 25 | #include <stdint.h> | 23 | #include <stdint.h> |
| 26 | #include "xbmc_addon_dll.h" | 24 | #include "xbmc_addon_dll.h" |
| 27 | #include "xbmc_audioenc_types.h" | 25 | #include "xbmc_audioenc_types.h" |
| @@ -58,4 +56,3 @@ extern "C" | |||
| 58 | }; | 56 | }; |
| 59 | }; | 57 | }; |
| 60 | 58 | ||
| 61 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_audioenc_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h index aa527db..df5164e 100644 --- a/xbmc/addons/include/xbmc_audioenc_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | |||
| 2 | /* | 3 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 4 | * http://xbmc.org | 5 | * http://kodi.tv |
| 5 | * | 6 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -14,14 +15,11 @@ | |||
| 14 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 15 | * | 16 | * |
| 16 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 17 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 18 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 19 | * | 20 | * |
| 20 | */ | 21 | */ |
| 21 | 22 | ||
| 22 | #ifndef __AUDIOENC_TYPES_H__ | ||
| 23 | #define __AUDIOENC_TYPES_H__ | ||
| 24 | |||
| 25 | #ifdef TARGET_WINDOWS | 23 | #ifdef TARGET_WINDOWS |
| 26 | #include <windows.h> | 24 | #include <windows.h> |
| 27 | #else | 25 | #else |
| @@ -110,4 +108,3 @@ extern "C" | |||
| 110 | }; | 108 | }; |
| 111 | } | 109 | } |
| 112 | 110 | ||
| 113 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_codec_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h index 98003e0..01e7548 100644 --- a/xbmc/addons/include/xbmc_codec_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | #ifndef __XBMC_CODEC_TYPES_H__ | 1 | #pragma once |
| 2 | #define __XBMC_CODEC_TYPES_H__ | ||
| 3 | 2 | ||
| 4 | /* | 3 | /* |
| 5 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 6 | * http://xbmc.org | 5 | * http://kodi.tv |
| 7 | * | 6 | * |
| 8 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -16,7 +15,7 @@ | |||
| 16 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 17 | * | 16 | * |
| 18 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 19 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 20 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 21 | * | 20 | * |
| 22 | */ | 21 | */ |
| @@ -51,5 +50,3 @@ typedef struct | |||
| 51 | }; | 50 | }; |
| 52 | #endif | 51 | #endif |
| 53 | 52 | ||
| 54 | #endif | ||
| 55 | |||
diff --git a/xbmc/addons/include/xbmc_epg_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h index efd7d13..9460952 100644 --- a/xbmc/addons/include/xbmc_epg_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h | |||
| @@ -59,17 +59,38 @@ | |||
| 59 | //@} | 59 | //@} |
| 60 | 60 | ||
| 61 | /* Set EPGTAG.iGenreType to EPG_GENRE_USE_STRING to transfer genre strings to XBMC */ | 61 | /* Set EPGTAG.iGenreType to EPG_GENRE_USE_STRING to transfer genre strings to XBMC */ |
| 62 | #define EPG_GENRE_USE_STRING 0x100 | 62 | #define EPG_GENRE_USE_STRING 0x100 |
| 63 | 63 | ||
| 64 | #ifdef __cplusplus | 64 | #ifdef __cplusplus |
| 65 | extern "C" { | 65 | extern "C" { |
| 66 | #endif | 66 | #endif |
| 67 | 67 | ||
| 68 | /* EPG_TAG.iFlags values */ | ||
| 69 | const unsigned int EPG_TAG_FLAG_UNDEFINED = 0x00000000; /*!< @brief nothing special to say about this entry */ | ||
| 70 | const unsigned int EPG_TAG_FLAG_IS_SERIES = 0x00000001; /*!< @brief this EPG entry is part of a series */ | ||
| 71 | |||
| 72 | /* Special EPG_TAG.iUniqueBroadcastId value */ | ||
| 73 | |||
| 74 | /*! | ||
| 75 | * @brief special EPG_TAG.iUniqueBroadcastId value to indicate that a tag has not a valid EPG event uid. | ||
| 76 | */ | ||
| 77 | const unsigned int EPG_TAG_INVALID_UID = 0; | ||
| 78 | |||
| 79 | /*! | ||
| 80 | * @brief EPG event states. Used with EpgEventStateChange callback. | ||
| 81 | */ | ||
| 82 | typedef enum | ||
| 83 | { | ||
| 84 | EPG_EVENT_CREATED = 0, /*!< @brief event created */ | ||
| 85 | EPG_EVENT_UPDATED = 1, /*!< @brief event updated */ | ||
| 86 | EPG_EVENT_DELETED = 2, /*!< @brief event deleted */ | ||
| 87 | } EPG_EVENT_STATE; | ||
| 88 | |||
| 68 | /*! | 89 | /*! |
| 69 | * @brief Representation of an EPG event. | 90 | * @brief Representation of an EPG event. |
| 70 | */ | 91 | */ |
| 71 | typedef struct EPG_TAG { | 92 | typedef struct EPG_TAG { |
| 72 | unsigned int iUniqueBroadcastId; /*!< @brief (required) identifier for this event */ | 93 | unsigned int iUniqueBroadcastId; /*!< @brief (required) identifier for this event. Valid uids must be greater than EPG_TAG_INVALID_UID. */ |
| 73 | const char * strTitle; /*!< @brief (required) this event's title */ | 94 | const char * strTitle; /*!< @brief (required) this event's title */ |
| 74 | unsigned int iChannelNumber; /*!< @brief (required) the number of the channel this event occurs on */ | 95 | unsigned int iChannelNumber; /*!< @brief (required) the number of the channel this event occurs on */ |
| 75 | time_t startTime; /*!< @brief (required) start time in UTC */ | 96 | time_t startTime; /*!< @brief (required) start time in UTC */ |
| @@ -94,6 +115,7 @@ extern "C" { | |||
| 94 | int iEpisodeNumber; /*!< @brief (optional) episode number */ | 115 | int iEpisodeNumber; /*!< @brief (optional) episode number */ |
| 95 | int iEpisodePartNumber; /*!< @brief (optional) episode part number */ | 116 | int iEpisodePartNumber; /*!< @brief (optional) episode part number */ |
| 96 | const char * strEpisodeName; /*!< @brief (optional) episode name */ | 117 | const char * strEpisodeName; /*!< @brief (optional) episode name */ |
| 118 | unsigned int iFlags; /*!< @brief (optional) bit field of independent flags associated with the EPG entry */ | ||
| 97 | } ATTRIBUTE_PACKED EPG_TAG; | 119 | } ATTRIBUTE_PACKED EPG_TAG; |
| 98 | 120 | ||
| 99 | #ifdef __cplusplus | 121 | #ifdef __cplusplus |
diff --git a/xbmc/addons/include/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h index 5280399..8b54ea6 100644 --- a/xbmc/addons/include/xbmc_pvr_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 1 | /* | 3 | /* |
| 2 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 3 | * http://xbmc.org | 5 | * http://kodi.tv |
| 4 | * | 6 | * |
| 5 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -13,14 +15,11 @@ | |||
| 13 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 14 | * | 16 | * |
| 15 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 16 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 18 | * | 20 | * |
| 19 | */ | 21 | */ |
| 20 | 22 | ||
| 21 | #ifndef __XBMC_PVR_H__ | ||
| 22 | #define __XBMC_PVR_H__ | ||
| 23 | |||
| 24 | #include "xbmc_addon_dll.h" | 23 | #include "xbmc_addon_dll.h" |
| 25 | #include "xbmc_pvr_types.h" | 24 | #include "xbmc_pvr_types.h" |
| 26 | 25 | ||
| @@ -53,16 +52,18 @@ extern "C" | |||
| 53 | /*! | 52 | /*! |
| 54 | * Get the XBMC_GUI_API_VERSION that was used to compile this add-on. | 53 | * Get the XBMC_GUI_API_VERSION that was used to compile this add-on. |
| 55 | * Used to check if this add-on is compatible with XBMC. | 54 | * Used to check if this add-on is compatible with XBMC. |
| 56 | * @return The XBMC_GUI_API_VERSION that was used to compile this add-on. | 55 | * @return The XBMC_GUI_API_VERSION that was used to compile this add-on or empty string if this add-on does not depend on Kodi GUI API. |
| 57 | * @remarks Valid implementation required. | 56 | * @remarks Valid implementation required. |
| 57 | * @note see libKODI_guilib.h about related parts | ||
| 58 | */ | 58 | */ |
| 59 | const char* GetGUIAPIVersion(void); | 59 | const char* GetGUIAPIVersion(void); |
| 60 | 60 | ||
| 61 | /*! | 61 | /*! |
| 62 | * Get the XBMC_GUI_MIN_API_VERSION that was used to compile this add-on. | 62 | * Get the XBMC_GUI_MIN_API_VERSION that was used to compile this add-on. |
| 63 | * Used to check if this add-on is compatible with XBMC. | 63 | * Used to check if this add-on is compatible with XBMC. |
| 64 | * @return The XBMC_GUI_MIN_API_VERSION that was used to compile this add-on. | 64 | * @return The XBMC_GUI_MIN_API_VERSION that was used to compile this add-on or empty string if this add-on does not depend on Kodi GUI API. |
| 65 | * @remarks Valid implementation required. | 65 | * @remarks Valid implementation required. |
| 66 | * @note see libKODI_guilib.h about related parts | ||
| 66 | */ | 67 | */ |
| 67 | const char* GetMininumGUIAPIVersion(void); | 68 | const char* GetMininumGUIAPIVersion(void); |
| 68 | 69 | ||
| @@ -330,6 +331,15 @@ extern "C" | |||
| 330 | */ | 331 | */ |
| 331 | PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY edl[], int *size); | 332 | PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY edl[], int *size); |
| 332 | 333 | ||
| 334 | /*! | ||
| 335 | * Retrieve the timer types supported by the backend. | ||
| 336 | * @param types out: The function has to write the definition of the supported timer types into this array. | ||
| 337 | * @param typesCount in: The maximum size of the list, out: the actual size of the list. default: PVR_ADDON_TIMERTYPE_ARRAY_SIZE | ||
| 338 | * @return PVR_ERROR_NO_ERROR if the types were successfully written to the array. | ||
| 339 | * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 340 | */ | ||
| 341 | PVR_ERROR GetTimerTypes(PVR_TIMER_TYPE types[], int *typesCount); | ||
| 342 | |||
| 333 | //@} | 343 | //@} |
| 334 | /** @name PVR timer methods | 344 | /** @name PVR timer methods |
| 335 | * @remarks Only used by XBMC is bSupportsTimers is set to true. | 345 | * @remarks Only used by XBMC is bSupportsTimers is set to true. |
| @@ -426,12 +436,6 @@ extern "C" | |||
| 426 | long long LengthLiveStream(void); | 436 | long long LengthLiveStream(void); |
| 427 | 437 | ||
| 428 | /*! | 438 | /*! |
| 429 | * @return The channel number on the backend of the live stream that's currently being read. | ||
| 430 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return -1 if this add-on won't provide this function. | ||
| 431 | */ | ||
| 432 | int GetCurrentClientChannel(void); | ||
| 433 | |||
| 434 | /*! | ||
| 435 | * Switch to another channel. Only to be called when a live stream has already been opened. | 439 | * Switch to another channel. Only to be called when a live stream has already been opened. |
| 436 | * @param channel The channel to switch to. | 440 | * @param channel The channel to switch to. |
| 437 | * @return True if the switch was successful, false otherwise. | 441 | * @return True if the switch was successful, false otherwise. |
| @@ -621,6 +625,29 @@ extern "C" | |||
| 621 | const char* GetBackendHostname(); | 625 | const char* GetBackendHostname(); |
| 622 | 626 | ||
| 623 | /*! | 627 | /*! |
| 628 | * Check if timeshift is active | ||
| 629 | * @return true if timeshift is active | ||
| 630 | */ | ||
| 631 | bool IsTimeshifting(); | ||
| 632 | |||
| 633 | /*! | ||
| 634 | * Check for real-time streaming | ||
| 635 | * @return true if current stream is real-time | ||
| 636 | */ | ||
| 637 | bool IsRealTimeStream(); | ||
| 638 | |||
| 639 | /*! | ||
| 640 | * Tell the client the time frame to use when notifying epg events back to Kodi. The client might push epg events asynchronously | ||
| 641 | * to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi, | ||
| 642 | * client needs to know about the epg time frame Kodi uses. Kodi calls this function once after the client add-on has been sucessfully | ||
| 643 | * initialized and then everytime the time frame value changes. | ||
| 644 | * @param iDays number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. | ||
| 645 | * @return PVR_ERROR_NO_ERROR if new value was successfully set. | ||
| 646 | * @remarks Required if bSupportsEPG is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 647 | */ | ||
| 648 | PVR_ERROR SetEPGTimeFrame(int iDays); | ||
| 649 | |||
| 650 | /*! | ||
| 624 | * Called by XBMC to assign the function pointers of this add-on to pClient. | 651 | * Called by XBMC to assign the function pointers of this add-on to pClient. |
| 625 | * @param pClient The struct to assign the function pointers to. | 652 | * @param pClient The struct to assign the function pointers to. |
| 626 | */ | 653 | */ |
| @@ -664,6 +691,7 @@ extern "C" | |||
| 664 | pClient->GetRecordingLastPlayedPosition = GetRecordingLastPlayedPosition; | 691 | pClient->GetRecordingLastPlayedPosition = GetRecordingLastPlayedPosition; |
| 665 | pClient->GetRecordingEdl = GetRecordingEdl; | 692 | pClient->GetRecordingEdl = GetRecordingEdl; |
| 666 | 693 | ||
| 694 | pClient->GetTimerTypes = GetTimerTypes; | ||
| 667 | pClient->GetTimersAmount = GetTimersAmount; | 695 | pClient->GetTimersAmount = GetTimersAmount; |
| 668 | pClient->GetTimers = GetTimers; | 696 | pClient->GetTimers = GetTimers; |
| 669 | pClient->AddTimer = AddTimer; | 697 | pClient->AddTimer = AddTimer; |
| @@ -676,7 +704,6 @@ extern "C" | |||
| 676 | pClient->SeekLiveStream = SeekLiveStream; | 704 | pClient->SeekLiveStream = SeekLiveStream; |
| 677 | pClient->PositionLiveStream = PositionLiveStream; | 705 | pClient->PositionLiveStream = PositionLiveStream; |
| 678 | pClient->LengthLiveStream = LengthLiveStream; | 706 | pClient->LengthLiveStream = LengthLiveStream; |
| 679 | pClient->GetCurrentClientChannel = GetCurrentClientChannel; | ||
| 680 | pClient->SwitchChannel = SwitchChannel; | 707 | pClient->SwitchChannel = SwitchChannel; |
| 681 | pClient->SignalStatus = SignalStatus; | 708 | pClient->SignalStatus = SignalStatus; |
| 682 | pClient->GetLiveStreamURL = GetLiveStreamURL; | 709 | pClient->GetLiveStreamURL = GetLiveStreamURL; |
| @@ -704,7 +731,11 @@ extern "C" | |||
| 704 | pClient->GetBufferTimeEnd = GetBufferTimeEnd; | 731 | pClient->GetBufferTimeEnd = GetBufferTimeEnd; |
| 705 | 732 | ||
| 706 | pClient->GetBackendHostname = GetBackendHostname; | 733 | pClient->GetBackendHostname = GetBackendHostname; |
| 734 | |||
| 735 | pClient->IsTimeshifting = IsTimeshifting; | ||
| 736 | pClient->IsRealTimeStream = IsRealTimeStream; | ||
| 737 | |||
| 738 | pClient->SetEPGTimeFrame = SetEPGTimeFrame; | ||
| 707 | }; | 739 | }; |
| 708 | }; | 740 | }; |
| 709 | 741 | ||
| 710 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h index a2e4882..83bb13a 100644 --- a/xbmc/addons/include/xbmc_pvr_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | |||
| 2 | /* | 3 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 4 | * http://xbmc.org | 5 | * http://kodi.tv |
| 5 | * | 6 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -14,14 +15,11 @@ | |||
| 14 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 15 | * | 16 | * |
| 16 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 17 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 18 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 19 | * | 20 | * |
| 20 | */ | 21 | */ |
| 21 | 22 | ||
| 22 | #ifndef __PVRCLIENT_TYPES_H__ | ||
| 23 | #define __PVRCLIENT_TYPES_H__ | ||
| 24 | |||
| 25 | #ifdef TARGET_WINDOWS | 23 | #ifdef TARGET_WINDOWS |
| 26 | #include <windows.h> | 24 | #include <windows.h> |
| 27 | #else | 25 | #else |
| @@ -65,26 +63,111 @@ struct DemuxPacket; | |||
| 65 | #define PRAGMA_PACK 1 | 63 | #define PRAGMA_PACK 1 |
| 66 | #endif | 64 | #endif |
| 67 | 65 | ||
| 68 | #define PVR_ADDON_NAME_STRING_LENGTH 1024 | 66 | #define PVR_ADDON_NAME_STRING_LENGTH 1024 |
| 69 | #define PVR_ADDON_URL_STRING_LENGTH 1024 | 67 | #define PVR_ADDON_URL_STRING_LENGTH 1024 |
| 70 | #define PVR_ADDON_DESC_STRING_LENGTH 1024 | 68 | #define PVR_ADDON_DESC_STRING_LENGTH 1024 |
| 71 | #define PVR_ADDON_INPUT_FORMAT_STRING_LENGTH 32 | 69 | #define PVR_ADDON_INPUT_FORMAT_STRING_LENGTH 32 |
| 72 | #define PVR_ADDON_EDL_LENGTH 32 | 70 | #define PVR_ADDON_EDL_LENGTH 32 |
| 71 | #define PVR_ADDON_TIMERTYPE_ARRAY_SIZE 32 | ||
| 72 | #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE 512 | ||
| 73 | #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL 128 | ||
| 74 | #define PVR_ADDON_TIMERTYPE_STRING_LENGTH 64 | ||
| 73 | 75 | ||
| 74 | /* using the default avformat's MAX_STREAMS value to be safe */ | 76 | /* using the default avformat's MAX_STREAMS value to be safe */ |
| 75 | #define PVR_STREAM_MAX_STREAMS 20 | 77 | #define PVR_STREAM_MAX_STREAMS 20 |
| 76 | 78 | ||
| 77 | /* current PVR API version */ | 79 | /* current PVR API version */ |
| 78 | #define XBMC_PVR_API_VERSION "1.9.6" | 80 | #define XBMC_PVR_API_VERSION "5.0.0" |
| 79 | 81 | ||
| 80 | /* min. PVR API version */ | 82 | /* min. PVR API version */ |
| 81 | #define XBMC_PVR_MIN_API_VERSION "1.9.6" | 83 | #define XBMC_PVR_MIN_API_VERSION "5.0.0" |
| 82 | 84 | ||
| 83 | #ifdef __cplusplus | 85 | #ifdef __cplusplus |
| 84 | extern "C" { | 86 | extern "C" { |
| 85 | #endif | 87 | #endif |
| 86 | 88 | ||
| 87 | /*! | 89 | /*! |
| 90 | * @brief numeric PVR timer type definitions (PVR_TIMER.iTimerType values) | ||
| 91 | */ | ||
| 92 | const unsigned int PVR_TIMER_TYPE_NONE = 0; /*!< @brief "Null" value for a numeric timer type. */ | ||
| 93 | |||
| 94 | /*! | ||
| 95 | * @brief special PVR_TIMER.iClientIndex value to indicate that a timer has not (yet) a valid client index. | ||
| 96 | */ | ||
| 97 | const unsigned int PVR_TIMER_NO_CLIENT_INDEX = 0; /*!< @brief timer has not (yet) a valid client index. */ | ||
| 98 | |||
| 99 | /*! | ||
| 100 | * @brief special PVR_TIMER.iParentClientIndex value to indicate that a timer has no parent. | ||
| 101 | */ | ||
| 102 | const unsigned int PVR_TIMER_NO_PARENT = PVR_TIMER_NO_CLIENT_INDEX; /*!< @brief timer has no parent; it was not scheduled by a repeating timer. */ | ||
| 103 | |||
| 104 | /*! | ||
| 105 | * @brief special PVR_TIMER.iEpgUid value to indicate that a timer has no EPG event uid. | ||
| 106 | */ | ||
| 107 | const unsigned int PVR_TIMER_NO_EPG_UID = EPG_TAG_INVALID_UID; /*!< @brief timer has no EPG event uid. */ | ||
| 108 | |||
| 109 | /*! | ||
| 110 | * @brief special PVR_TIMER.iClientChannelUid value to indicate "any channel". Useful for some repeating timer types. | ||
| 111 | */ | ||
| 112 | const int PVR_TIMER_ANY_CHANNEL = -1; /*!< @brief denotes "any channel", not a specific one. */ | ||
| 113 | |||
| 114 | /*! | ||
| 115 | * @brief PVR timer type attributes (PVR_TIMER_TYPE.iAttributes values) | ||
| 116 | */ | ||
| 117 | const unsigned int PVR_TIMER_TYPE_ATTRIBUTE_NONE = 0x00000000; | ||
| 118 | |||
| 119 | const unsigned int PVR_TIMER_TYPE_IS_MANUAL = 0x00000001; /*!< @brief defines whether this is a type for manual (time-based) or epg-based timers */ | ||
| 120 | const unsigned int PVR_TIMER_TYPE_IS_REPEATING = 0x00000002; /*!< @brief defines whether this is a type for repeating or one-shot timers */ | ||
| 121 | const unsigned int PVR_TIMER_TYPE_IS_READONLY = 0x00000004; /*!< @brief timers of this type must not be edited by Kodi */ | ||
| 122 | const unsigned int PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES = 0x00000008; /*!< @brief timers of this type must not be created by Kodi. All other operations are allowed, though */ | ||
| 123 | |||
| 124 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE = 0x00000010; /*!< @brief this type supports enabling/disabling of the timer (PVR_TIMER.state SCHEDULED|DISBALED) */ | ||
| 125 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_CHANNELS = 0x00000020; /*!< @brief this type supports channels (PVR_TIMER.iClientChannelUid) */ | ||
| 126 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_START_TIME = 0x00000040; /*!< @brief this type supports a recording start time (PVR_TIMER.startTime) */ | ||
| 127 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH = 0x00000080; /*!< @brief this type supports matching epg episode title using PVR_TIMER.strEpgSearchString */ | ||
| 128 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH = 0x00000100; /*!< @brief this type supports matching "more" epg data (not just episode title) using PVR_TIMER.strEpgSearchString. Setting FULLTEXT_EPG_MATCH implies TITLE_EPG_MATCH */ | ||
| 129 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_FIRST_DAY = 0x00000200; /*!< @brief this type supports a first day the timer gets active (PVR_TIMER.firstday) */ | ||
| 130 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_WEEKDAYS = 0x00000400; /*!< @brief this type supports weekdays for defining the recording schedule (PVR_TIMER.iWeekdays) */ | ||
| 131 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_RECORD_ONLY_NEW_EPISODES = 0x00000800; /*!< @brief this type supports the "record only new episodes" feature (PVR_TIMER.iPreventDuplicateEpisodes) */ | ||
| 132 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN = 0x00001000; /*!< @brief this type supports pre and post record time (PVR_TIMER.iMarginStart, PVR_TIMER.iMarginEnd) */ | ||
| 133 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_PRIORITY = 0x00002000; /*!< @brief this type supports recording priority (PVR_TIMER.iPriority) */ | ||
| 134 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_LIFETIME = 0x00004000; /*!< @brief this type supports recording lifetime (PVR_TIMER.iLifetime) */ | ||
| 135 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS = 0x00008000; /*!< @brief this type supports placing recordings in user defined folders (PVR_TIMER.strDirectory) */ | ||
| 136 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP = 0x00010000; /*!< @brief this type supports a list of recording groups (PVR_TIMER.iRecordingGroup) */ | ||
| 137 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_END_TIME = 0x00020000; /*!< @brief this type supports a recording end time (PVR_TIMER.endTime) */ | ||
| 138 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_START_ANYTIME = 0x00040000; /*!< @brief enables an 'Any Time' over-ride option for startTime (using PVR_TIMER.bStartAnyTime) */ | ||
| 139 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_END_ANYTIME = 0x00080000; /*!< @brief enables a separate 'Any Time' over-ride for endTime (using PVR_TIMER.bEndAnyTime) */ | ||
| 140 | const unsigned int PVR_TIMER_TYPE_SUPPORTS_MAX_RECORDINGS = 0x00100000; /*!< @brief this type supports specifying a maximum recordings setting' (PVR_TIMER.iMaxRecordings) */ | ||
| 141 | const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE = 0x00200000; /*!< @brief this type shold not appear on any create menus which don't provide an associated EPG tag */ | ||
| 142 | const unsigned int PVR_TIMER_TYPE_FORBIDS_EPG_TAG_ON_CREATE = 0x00400000; /*!< @brief this type should not appear on any create menus which provide an associated EPG tag */ | ||
| 143 | const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIES_ON_CREATE = 0x00800000; /*!< @brief this type should not appear on any create menus unless associated with an EPG tag with 'series' attributes (EPG_TAG.iFlags & EPG_TAG_FLAG_IS_SERIES || EPG_TAG.iSeriesNumber > 0 || EPG_TAG.iEpisodeNumber > 0 || EPG_TAG.iEpisodePartNumber > 0). Implies PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE */ | ||
| 144 | |||
| 145 | /*! | ||
| 146 | * @brief PVR timer weekdays (PVR_TIMER.iWeekdays values) | ||
| 147 | */ | ||
| 148 | const unsigned int PVR_WEEKDAY_NONE = 0x00; | ||
| 149 | const unsigned int PVR_WEEKDAY_MONDAY = 0x01; | ||
| 150 | const unsigned int PVR_WEEKDAY_TUESDAY = 0x02; | ||
| 151 | const unsigned int PVR_WEEKDAY_WEDNESDAY = 0x04; | ||
| 152 | const unsigned int PVR_WEEKDAY_THURSDAY = 0x08; | ||
| 153 | const unsigned int PVR_WEEKDAY_FRIDAY = 0x10; | ||
| 154 | const unsigned int PVR_WEEKDAY_SATURDAY = 0x20; | ||
| 155 | const unsigned int PVR_WEEKDAY_SUNDAY = 0x40; | ||
| 156 | const unsigned int PVR_WEEKDAY_ALLDAYS = PVR_WEEKDAY_MONDAY | PVR_WEEKDAY_TUESDAY | PVR_WEEKDAY_WEDNESDAY | | ||
| 157 | PVR_WEEKDAY_THURSDAY | PVR_WEEKDAY_FRIDAY | PVR_WEEKDAY_SATURDAY | | ||
| 158 | PVR_WEEKDAY_SUNDAY; | ||
| 159 | |||
| 160 | /*! | ||
| 161 | * @brief timeframe value for use with SetEPGTimeFrame function to indicate "no timeframe". | ||
| 162 | */ | ||
| 163 | const int EPG_TIMEFRAME_UNLIMITED = -1; | ||
| 164 | |||
| 165 | /*! | ||
| 166 | * @brief special PVR_TIMER.iClientChannelUid and PVR_RECORDING.iChannelUid value to indicate that no channel uid is available. | ||
| 167 | */ | ||
| 168 | const int PVR_CHANNEL_INVALID_UID = -1; /*!< @brief denotes that no channel uid is avaliable. */ | ||
| 169 | |||
| 170 | /*! | ||
| 88 | * @brief PVR add-on error codes | 171 | * @brief PVR add-on error codes |
| 89 | */ | 172 | */ |
| 90 | typedef enum | 173 | typedef enum |
| @@ -106,7 +189,7 @@ extern "C" { | |||
| 106 | */ | 189 | */ |
| 107 | typedef enum | 190 | typedef enum |
| 108 | { | 191 | { |
| 109 | PVR_TIMER_STATE_NEW = 0, /*!< @brief a new, unsaved timer */ | 192 | PVR_TIMER_STATE_NEW = 0, /*!< @brief the timer was just created on the backend and is not yet active. This state must not be used for timers just created on the client side. */ |
| 110 | PVR_TIMER_STATE_SCHEDULED = 1, /*!< @brief the timer is scheduled for recording */ | 193 | PVR_TIMER_STATE_SCHEDULED = 1, /*!< @brief the timer is scheduled for recording */ |
| 111 | PVR_TIMER_STATE_RECORDING = 2, /*!< @brief the timer is currently recordings */ | 194 | PVR_TIMER_STATE_RECORDING = 2, /*!< @brief the timer is currently recordings */ |
| 112 | PVR_TIMER_STATE_COMPLETED = 3, /*!< @brief the recording completed successfully */ | 195 | PVR_TIMER_STATE_COMPLETED = 3, /*!< @brief the recording completed successfully */ |
| @@ -114,7 +197,8 @@ extern "C" { | |||
| 114 | PVR_TIMER_STATE_CANCELLED = 5, /*!< @brief the timer was scheduled, but was canceled */ | 197 | PVR_TIMER_STATE_CANCELLED = 5, /*!< @brief the timer was scheduled, but was canceled */ |
| 115 | PVR_TIMER_STATE_CONFLICT_OK = 6, /*!< @brief the scheduled timer conflicts with another one, but will be recorded */ | 198 | PVR_TIMER_STATE_CONFLICT_OK = 6, /*!< @brief the scheduled timer conflicts with another one, but will be recorded */ |
| 116 | PVR_TIMER_STATE_CONFLICT_NOK = 7, /*!< @brief the scheduled timer conflicts with another one and won't be recorded */ | 199 | PVR_TIMER_STATE_CONFLICT_NOK = 7, /*!< @brief the scheduled timer conflicts with another one and won't be recorded */ |
| 117 | PVR_TIMER_STATE_ERROR = 8 /*!< @brief the timer is scheduled, but can't be recorded for some reason */ | 200 | PVR_TIMER_STATE_ERROR = 8, /*!< @brief the timer is scheduled, but can't be recorded for some reason */ |
| 201 | PVR_TIMER_STATE_DISABLED = 9, /*!< @brief the timer was disabled by the user, can be enabled via setting the state to PVR_TIMER_STATE_SCHEDULED */ | ||
| 118 | } PVR_TIMER_STATE; | 202 | } PVR_TIMER_STATE; |
| 119 | 203 | ||
| 120 | /*! | 204 | /*! |
| @@ -133,6 +217,20 @@ extern "C" { | |||
| 133 | } PVR_MENUHOOK_CAT; | 217 | } PVR_MENUHOOK_CAT; |
| 134 | 218 | ||
| 135 | /*! | 219 | /*! |
| 220 | * @brief PVR backend connection states. Used with ConnectionStateChange callback. | ||
| 221 | */ | ||
| 222 | typedef enum | ||
| 223 | { | ||
| 224 | PVR_CONNECTION_STATE_UNKNOWN = 0, /*!< @brief unknown state (e.g. not yet tried to connect) */ | ||
| 225 | PVR_CONNECTION_STATE_SERVER_UNREACHABLE = 1, /*!< @brief backend server is not reachable (e.g. server not existing or network down)*/ | ||
| 226 | PVR_CONNECTION_STATE_SERVER_MISMATCH = 2, /*!< @brief backend server is reachable, but there is not the expected type of server running (e.g. HTSP required, but FTP running at given server:port) */ | ||
| 227 | PVR_CONNECTION_STATE_VERSION_MISMATCH = 3, /*!< @brief backend server is reachable, but server version does not match client requirements */ | ||
| 228 | PVR_CONNECTION_STATE_ACCESS_DENIED = 4, /*!< @brief backend server is reachable, but denies client access (e.g. due to wrong credentials) */ | ||
| 229 | PVR_CONNECTION_STATE_CONNECTED = 5, /*!< @brief connection to backend server is established */ | ||
| 230 | PVR_CONNECTION_STATE_DISCONNECTED = 6, /*!< @brief no connection to backend server (e.g. due to network errors or client initiated disconnect)*/ | ||
| 231 | } PVR_CONNECTION_STATE; | ||
| 232 | |||
| 233 | /*! | ||
| 136 | * @brief Properties passed to the Create() method of an add-on. | 234 | * @brief Properties passed to the Create() method of an add-on. |
| 137 | */ | 235 | */ |
| 138 | typedef struct PVR_PROPERTIES | 236 | typedef struct PVR_PROPERTIES |
| @@ -158,7 +256,6 @@ extern "C" { | |||
| 158 | bool bSupportsChannelSettings; /*!< @brief true if this add-on supports the following functions: DeleteChannel, RenameChannel, MoveChannel, DialogChannelSettings and DialogAddChannel */ | 256 | bool bSupportsChannelSettings; /*!< @brief true if this add-on supports the following functions: DeleteChannel, RenameChannel, MoveChannel, DialogChannelSettings and DialogAddChannel */ |
| 159 | bool bHandlesInputStream; /*!< @brief true if this add-on provides an input stream. false if XBMC handles the stream. */ | 257 | bool bHandlesInputStream; /*!< @brief true if this add-on provides an input stream. false if XBMC handles the stream. */ |
| 160 | bool bHandlesDemuxing; /*!< @brief true if this add-on demultiplexes packets. */ | 258 | bool bHandlesDemuxing; /*!< @brief true if this add-on demultiplexes packets. */ |
| 161 | bool bSupportsRecordingFolders; /*!< @brief true if the backend supports timers / recordings in folders. */ | ||
| 162 | bool bSupportsRecordingPlayCount; /*!< @brief true if the backend supports play count for recordings. */ | 259 | bool bSupportsRecordingPlayCount; /*!< @brief true if the backend supports play count for recordings. */ |
| 163 | bool bSupportsLastPlayedPosition; /*!< @brief true if the backend supports store/retrieve of last played position for recordings. */ | 260 | bool bSupportsLastPlayedPosition; /*!< @brief true if the backend supports store/retrieve of last played position for recordings. */ |
| 164 | bool bSupportsRecordingEdl; /*!< @brief true if the backend supports retrieving an edit decision list for recordings. */ | 261 | bool bSupportsRecordingEdl; /*!< @brief true if the backend supports retrieving an edit decision list for recordings. */ |
| @@ -204,9 +301,6 @@ extern "C" { | |||
| 204 | int iSignal; /*!< @brief (optional) signal strength */ | 301 | int iSignal; /*!< @brief (optional) signal strength */ |
| 205 | long iBER; /*!< @brief (optional) bit error rate */ | 302 | long iBER; /*!< @brief (optional) bit error rate */ |
| 206 | long iUNC; /*!< @brief (optional) uncorrected blocks */ | 303 | long iUNC; /*!< @brief (optional) uncorrected blocks */ |
| 207 | double dVideoBitrate; /*!< @brief (optional) video bitrate */ | ||
| 208 | double dAudioBitrate; /*!< @brief (optional) audio bitrate */ | ||
| 209 | double dDolbyBitrate; /*!< @brief (optional) dolby bitrate */ | ||
| 210 | } ATTRIBUTE_PACKED PVR_SIGNAL_STATUS; | 304 | } ATTRIBUTE_PACKED PVR_SIGNAL_STATUS; |
| 211 | 305 | ||
| 212 | /*! | 306 | /*! |
| @@ -255,34 +349,117 @@ extern "C" { | |||
| 255 | } ATTRIBUTE_PACKED PVR_CHANNEL_GROUP_MEMBER; | 349 | } ATTRIBUTE_PACKED PVR_CHANNEL_GROUP_MEMBER; |
| 256 | 350 | ||
| 257 | /*! | 351 | /*! |
| 352 | * @brief Representation of a timer's attribute integer value. | ||
| 353 | */ | ||
| 354 | typedef struct PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE | ||
| 355 | { | ||
| 356 | int iValue; /*!< @brief (required) an integer value for a certain timer attribute */ | ||
| 357 | char strDescription[PVR_ADDON_TIMERTYPE_STRING_LENGTH]; /*!< @brief (optional) a localized string describing the value. If left blank, Kodi will | ||
| 358 | generate a suitable representation (like the integer value as string) */ | ||
| 359 | } ATTRIBUTE_PACKED PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE; | ||
| 360 | |||
| 361 | /*! | ||
| 362 | * @brief Representation of a timer type. | ||
| 363 | */ | ||
| 364 | typedef struct PVR_TIMER_TYPE | ||
| 365 | { | ||
| 366 | unsigned int iId; /*!< @brief (required) this type's identifier. Ids must be > PVR_TIMER_TYPE_NONE. */ | ||
| 367 | unsigned int iAttributes; /*!< @brief (required) defines the attributes for this type (PVR_TIMER_TYPE_* constants). */ | ||
| 368 | char strDescription[PVR_ADDON_TIMERTYPE_STRING_LENGTH]; /*!< @brief (optional) a short localized string describing the purpose of the type. (e.g. | ||
| 369 | "Any time at this channel if title matches"). If left blank, Kodi will generate a | ||
| 370 | description based on the attributes REPEATING and MANUAL. (e.g. "Repeating EPG-based." */ | ||
| 371 | /* priority value definitions */ | ||
| 372 | unsigned int iPrioritiesSize; /*!< @brief (required) Count of possible values for PVR_TMER.iPriority. 0 means priority | ||
| 373 | is not supported by this timer type or no own value definition wanted, but to use Kodi defaults | ||
| 374 | of 1..100. */ | ||
| 375 | PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE | ||
| 376 | priorities[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; /*!< @brief (optional) Array containing the possible values for PVR_TMER.iPriority. Must be | ||
| 377 | filled if iPrioritiesSize > 0 */ | ||
| 378 | int iPrioritiesDefault; /*!< @brief (optional) The default value for PVR_TMER.iPriority. Must be filled if iPrioritiesSize > 0 */ | ||
| 379 | |||
| 380 | /* lifetime value definitions */ | ||
| 381 | unsigned int iLifetimesSize; /*!< @brief (required) Count of possible values for PVR_TMER.iLifetime. 0 means lifetime | ||
| 382 | is not supported by this timer type or no own value definition wanted, but to use Kodi defaults | ||
| 383 | of 1..365. */ | ||
| 384 | PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE | ||
| 385 | lifetimes[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; /*!< @brief (optional) Array containing the possible values for PVR_TMER.iLifetime. Must be | ||
| 386 | filled if iLifetimesSize > 0 */ | ||
| 387 | int iLifetimesDefault; /*!< @brief (optional) The default value for PVR_TMER.iLifetime. Must be filled if iLifetimesSize > 0 */ | ||
| 388 | |||
| 389 | /* prevent duplicate episodes value definitions */ | ||
| 390 | unsigned int iPreventDuplicateEpisodesSize; /*!< @brief (required) Count of possible values for PVR_TMER.iPreventDuplicateEpisodes. 0 means duplicate | ||
| 391 | episodes prevention is not supported by this timer type or no own value definition wanted, but to use | ||
| 392 | Kodi defaults. */ | ||
| 393 | PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE | ||
| 394 | preventDuplicateEpisodes[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; | ||
| 395 | /*!< @brief (optional) Array containing the possible values for PVR_TMER.iPreventDuplicateEpisodes.. Must | ||
| 396 | be filled if iPreventDuplicateEpisodesSize > 0 */ | ||
| 397 | unsigned int iPreventDuplicateEpisodesDefault; /*!< @brief (optional) The default value for PVR_TMER.iPreventDuplicateEpisodesSize. Must be filled if iPreventDuplicateEpisodesSize > 0 */ | ||
| 398 | |||
| 399 | /* recording folder list value definitions */ | ||
| 400 | unsigned int iRecordingGroupSize; /*!< @brief (required) Count of possible values of PVR_TIMER.iRecordingGroup. 0 means folder lists are not supported by this timer type */ | ||
| 401 | PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE | ||
| 402 | recordingGroup[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; | ||
| 403 | /*!< @brief (optional) Array containing the possible values of PVR_TMER.iRecordingGroup. Must be filled if iRecordingGroupSize > 0 */ | ||
| 404 | unsigned int iRecordingGroupDefault; /*!< @brief (optional) The default value for PVR_TIMER.iRecordingGroup. Must be filled in if PVR_TIMER.iRecordingGroupSize > 0 */ | ||
| 405 | |||
| 406 | /* max recordings value definitions */ | ||
| 407 | unsigned int iMaxRecordingsSize; /*!< @brief (required) Count of possible values of PVR_TIMER.iMaxRecordings. 0 means max recordings are not supported by this timer type */ | ||
| 408 | PVR_TIMER_TYPE_ATTRIBUTE_INT_VALUE | ||
| 409 | maxRecordings[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL]; | ||
| 410 | /*!< @brief (optional) Array containing the possible values of PVR_TMER.iMaxRecordings. */ | ||
| 411 | int iMaxRecordingsDefault; /*!< @brief (optional) The default value for PVR_TIMER.iMaxRecordings. Must be filled in if PVR_TIMER.iMaxRecordingsSize > 0 */ | ||
| 412 | |||
| 413 | } ATTRIBUTE_PACKED PVR_TIMER_TYPE; | ||
| 414 | |||
| 415 | /*! | ||
| 258 | * @brief Representation of a timer event. | 416 | * @brief Representation of a timer event. |
| 259 | */ | 417 | */ |
| 260 | typedef struct PVR_TIMER { | 418 | typedef struct PVR_TIMER { |
| 261 | unsigned int iClientIndex; /*!< @brief (required) the index of this timer given by the client */ | 419 | unsigned int iClientIndex; /*!< @brief (required) the index of this timer given by the client. PVR_TIMER_NO_CLIENT_INDEX indicates that the index was not yet set by the client, for example for new timers created by |
| 262 | int iClientChannelUid; /*!< @brief (required) unique identifier of the channel to record on */ | 420 | Kodi and passed the first time to the client. A valid index must be greater than PVR_TIMER_NO_CLIENT_INDEX. */ |
| 263 | time_t startTime; /*!< @brief (required) start time of the recording in UTC. instant timers that are sent to the add-on by xbmc will have this value set to 0 */ | 421 | unsigned int iParentClientIndex; /*!< @brief (optional) for timers scheduled by a repeating timer, the index of the repeating timer that scheduled this timer (it's PVR_TIMER.iClientIndex value). Use PVR_TIMER_NO_PARENT |
| 264 | time_t endTime; /*!< @brief (required) end time of the recording in UTC */ | 422 | to indicate that this timer was no scheduled by a repeating timer. */ |
| 423 | int iClientChannelUid; /*!< @brief (optional) unique identifier of the channel to record on. PVR_TIMER_ANY_CHANNEL will denote "any channel", not a specific one. PVR_CHANNEL_INVALID_UID denotes that channel uid is not available.*/ | ||
| 424 | time_t startTime; /*!< @brief (optional) start time of the recording in UTC. Instant timers that are sent to the add-on by Kodi will have this value set to 0.*/ | ||
| 425 | time_t endTime; /*!< @brief (optional) end time of the recording in UTC. */ | ||
| 426 | bool bStartAnyTime; /*!< @brief (optional) for EPG based (not Manual) timers indicates startTime does not apply. Default = false */ | ||
| 427 | bool bEndAnyTime; /*!< @brief (optional) for EPG based (not Manual) timers indicates endTime does not apply. Default = false */ | ||
| 265 | PVR_TIMER_STATE state; /*!< @brief (required) the state of this timer */ | 428 | PVR_TIMER_STATE state; /*!< @brief (required) the state of this timer */ |
| 266 | char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (optional) title of this timer */ | 429 | unsigned int iTimerType; /*!< @brief (required) the type of this timer. It is private to the addon and can be freely defined by the addon. The value must be greater than PVR_TIMER_TYPE_NONE. |
| 267 | char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) the directory where the recording will be stored in */ | 430 | Kodi does not interpret this value (except for checking for PVR_TIMER_TYPE_NONE), but will pass the right id to the addon with every PVR_TIMER instance, thus the addon easily can determine |
| 431 | the timer type. */ | ||
| 432 | char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) a title for this timer */ | ||
| 433 | char strEpgSearchString[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (optional) a string used to search epg data for repeating epg-based timers. Format is backend-dependent, for example regexp */ | ||
| 434 | bool bFullTextEpgSearch; /*!< @brief (optional) indicates, whether strEpgSearchString is to match against the epg episode title only or also against "other" epg data (backend-dependent) */ | ||
| 435 | char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) the (relative) directory where the recording will be stored in */ | ||
| 268 | char strSummary[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) the summary for this timer */ | 436 | char strSummary[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) the summary for this timer */ |
| 269 | int iPriority; /*!< @brief (optional) the priority of this timer */ | 437 | int iPriority; /*!< @brief (optional) the priority of this timer */ |
| 270 | int iLifetime; /*!< @brief (optional) lifetimer of this timer in days */ | 438 | int iLifetime; /*!< @brief (optional) lifetime of recordings created by this timer. > 0 days after which recordings will be deleted by the backend, < 0 addon defined integer list reference, == 0 disabled */ |
| 271 | bool bIsRepeating; /*!< @brief (optional) true if this is a recurring timer */ | 439 | int iMaxRecordings; /*!< @brief (optional) maximum number of recordings this timer shall create. > 0 number of recordings, < 0 addon defined integer list reference, == 0 disabled */ |
| 272 | time_t firstDay; /*!< @brief (optional) the first day this recording is active in case of a repeating event */ | 440 | unsigned int iRecordingGroup; /*!< @brief (optional) integer ref to addon/backend defined list of recording groups*/ |
| 273 | int iWeekdays; /*!< @brief (optional) weekday mask */ | 441 | time_t firstDay; /*!< @brief (optional) the first day this timer is active, for repeating timers */ |
| 274 | int iEpgUid; /*!< @brief (optional) epg event id */ | 442 | unsigned int iWeekdays; /*!< @brief (optional) week days, for repeating timers */ |
| 443 | unsigned int iPreventDuplicateEpisodes; /*!< @brief (optional) 1 if backend should only record new episodes in case of a repeating epg-based timer, 0 if all episodes shall be recorded (no duplicate detection). Actual algorithm for | ||
| 444 | duplicate detection is defined by the backend. Addons may define own values for different duplicate detection algorithms, thus this is not just a bool.*/ | ||
| 445 | unsigned int iEpgUid; /*!< @brief (optional) EPG event id associated with this timer. Valid ids must be greater than EPG_TAG_INVALID_UID. */ | ||
| 275 | unsigned int iMarginStart; /*!< @brief (optional) if set, the backend starts the recording iMarginStart minutes before startTime. */ | 446 | unsigned int iMarginStart; /*!< @brief (optional) if set, the backend starts the recording iMarginStart minutes before startTime. */ |
| 276 | unsigned int iMarginEnd; /*!< @brief (optional) if set, the backend ends the recording iMarginEnd minutes after endTime. */ | 447 | unsigned int iMarginEnd; /*!< @brief (optional) if set, the backend ends the recording iMarginEnd minutes after endTime. */ |
| 277 | int iGenreType; /*!< @brief (optional) genre type */ | 448 | int iGenreType; /*!< @brief (optional) genre type */ |
| 278 | int iGenreSubType; /*!< @brief (optional) genre sub type */ | 449 | int iGenreSubType; /*!< @brief (optional) genre sub type */ |
| 279 | } ATTRIBUTE_PACKED PVR_TIMER; | 450 | } ATTRIBUTE_PACKED PVR_TIMER; |
| 451 | |||
| 280 | /*! | 452 | /*! |
| 281 | * @brief Representation of a recording. | 453 | * @brief Representation of a recording. |
| 282 | */ | 454 | */ |
| 283 | typedef struct PVR_RECORDING { | 455 | typedef struct PVR_RECORDING { |
| 284 | char strRecordingId[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) unique id of the recording on the client. */ | 456 | char strRecordingId[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) unique id of the recording on the client. */ |
| 285 | char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) the title of this recording */ | 457 | char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) the title of this recording */ |
| 458 | char strEpisodeName[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (optional) episode name (also known as subtitle) */ | ||
| 459 | int iSeriesNumber; /*!< @brief (optional) series number (usually called season). Set to "0" for specials/pilot. For 'invalid' see iEpisodeNumber or set to -1 */ | ||
| 460 | int iEpisodeNumber; /*!< @brief (optional) episode number within the "iSeriesNumber" season. For 'invalid' set to -1 or iSeriesNumber=iEpisodeNumber=0 to show both are invalid */ | ||
| 461 | int iYear; /*!< @brief (optional) year of first release (use to identify a specific movie re-make) / first airing for TV shows. Set to '0' for invalid. */ | ||
| 462 | |||
| 286 | char strStreamURL[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (required) stream URL to access this recording */ | 463 | char strStreamURL[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (required) stream URL to access this recording */ |
| 287 | char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) directory of this recording on the client */ | 464 | char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) directory of this recording on the client */ |
| 288 | char strPlotOutline[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) plot outline */ | 465 | char strPlotOutline[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) plot outline */ |
| @@ -300,7 +477,8 @@ extern "C" { | |||
| 300 | int iPlayCount; /*!< @brief (optional) play count of this recording on the client */ | 477 | int iPlayCount; /*!< @brief (optional) play count of this recording on the client */ |
| 301 | int iLastPlayedPosition; /*!< @brief (optional) last played position of this recording on the client */ | 478 | int iLastPlayedPosition; /*!< @brief (optional) last played position of this recording on the client */ |
| 302 | bool bIsDeleted; /*!< @brief (optional) shows this recording is deleted and can be undelete */ | 479 | bool bIsDeleted; /*!< @brief (optional) shows this recording is deleted and can be undelete */ |
| 303 | unsigned int iEpgEventId; /*!< @brief (optional) EPG event id associated with this recording */ | 480 | unsigned int iEpgEventId; /*!< @brief (optional) EPG event id associated with this recording. Valid ids must be greater than EPG_TAG_INVALID_UID. */ |
| 481 | int iChannelUid; /*!< @brief (optional) unique identifier of the channel for this recording. PVR_CHANNEL_INVALID_UID denotes that channel uid is not available. */ | ||
| 304 | } ATTRIBUTE_PACKED PVR_RECORDING; | 482 | } ATTRIBUTE_PACKED PVR_RECORDING; |
| 305 | 483 | ||
| 306 | /*! | 484 | /*! |
| @@ -373,6 +551,7 @@ extern "C" { | |||
| 373 | PVR_ERROR (__cdecl* SetRecordingLastPlayedPosition)(const PVR_RECORDING&, int); | 551 | PVR_ERROR (__cdecl* SetRecordingLastPlayedPosition)(const PVR_RECORDING&, int); |
| 374 | int (__cdecl* GetRecordingLastPlayedPosition)(const PVR_RECORDING&); | 552 | int (__cdecl* GetRecordingLastPlayedPosition)(const PVR_RECORDING&); |
| 375 | PVR_ERROR (__cdecl* GetRecordingEdl)(const PVR_RECORDING&, PVR_EDL_ENTRY[], int*); | 553 | PVR_ERROR (__cdecl* GetRecordingEdl)(const PVR_RECORDING&, PVR_EDL_ENTRY[], int*); |
| 554 | PVR_ERROR (__cdecl* GetTimerTypes)(PVR_TIMER_TYPE[], int*); | ||
| 376 | int (__cdecl* GetTimersAmount)(void); | 555 | int (__cdecl* GetTimersAmount)(void); |
| 377 | PVR_ERROR (__cdecl* GetTimers)(ADDON_HANDLE); | 556 | PVR_ERROR (__cdecl* GetTimers)(ADDON_HANDLE); |
| 378 | PVR_ERROR (__cdecl* AddTimer)(const PVR_TIMER&); | 557 | PVR_ERROR (__cdecl* AddTimer)(const PVR_TIMER&); |
| @@ -384,7 +563,6 @@ extern "C" { | |||
| 384 | long long (__cdecl* SeekLiveStream)(long long, int); | 563 | long long (__cdecl* SeekLiveStream)(long long, int); |
| 385 | long long (__cdecl* PositionLiveStream)(void); | 564 | long long (__cdecl* PositionLiveStream)(void); |
| 386 | long long (__cdecl* LengthLiveStream)(void); | 565 | long long (__cdecl* LengthLiveStream)(void); |
| 387 | int (__cdecl* GetCurrentClientChannel)(void); | ||
| 388 | bool (__cdecl* SwitchChannel)(const PVR_CHANNEL&); | 566 | bool (__cdecl* SwitchChannel)(const PVR_CHANNEL&); |
| 389 | PVR_ERROR (__cdecl* SignalStatus)(PVR_SIGNAL_STATUS&); | 567 | PVR_ERROR (__cdecl* SignalStatus)(PVR_SIGNAL_STATUS&); |
| 390 | const char* (__cdecl* GetLiveStreamURL)(const PVR_CHANNEL&); | 568 | const char* (__cdecl* GetLiveStreamURL)(const PVR_CHANNEL&); |
| @@ -408,10 +586,12 @@ extern "C" { | |||
| 408 | time_t (__cdecl* GetBufferTimeStart)(void); | 586 | time_t (__cdecl* GetBufferTimeStart)(void); |
| 409 | time_t (__cdecl* GetBufferTimeEnd)(void); | 587 | time_t (__cdecl* GetBufferTimeEnd)(void); |
| 410 | const char* (__cdecl* GetBackendHostname)(void); | 588 | const char* (__cdecl* GetBackendHostname)(void); |
| 589 | bool (__cdecl* IsTimeshifting)(void); | ||
| 590 | bool (__cdecl* IsRealTimeStream)(void); | ||
| 591 | PVR_ERROR (__cdecl* SetEPGTimeFrame)(int); | ||
| 411 | } PVRClient; | 592 | } PVRClient; |
| 412 | 593 | ||
| 413 | #ifdef __cplusplus | 594 | #ifdef __cplusplus |
| 414 | } | 595 | } |
| 415 | #endif | 596 | #endif |
| 416 | 597 | ||
| 417 | #endif //__PVRCLIENT_TYPES_H__ | ||
diff --git a/xbmc/addons/include/xbmc_scr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h index c4257b4..8652a0a 100644 --- a/xbmc/addons/include/xbmc_scr_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | |||
| 2 | /* | 3 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 4 | * http://xbmc.org | 5 | * http://kodi.tv |
| 5 | * | 6 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -14,14 +15,11 @@ | |||
| 14 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 15 | * | 16 | * |
| 16 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 17 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 18 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 19 | * | 20 | * |
| 20 | */ | 21 | */ |
| 21 | 22 | ||
| 22 | #ifndef __XBMC_SCR_H__ | ||
| 23 | #define __XBMC_SCR_H__ | ||
| 24 | |||
| 25 | #include "xbmc_addon_dll.h" | 23 | #include "xbmc_addon_dll.h" |
| 26 | #include "xbmc_scr_types.h" | 24 | #include "xbmc_scr_types.h" |
| 27 | 25 | ||
| @@ -42,4 +40,3 @@ extern "C" | |||
| 42 | }; | 40 | }; |
| 43 | }; | 41 | }; |
| 44 | 42 | ||
| 45 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_scr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h index fec3040..5785b25 100644 --- a/xbmc/addons/include/xbmc_scr_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | |||
| 2 | /* | 3 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 4 | * http://xbmc.org | 5 | * http://kodi.tv |
| 5 | * | 6 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -14,14 +15,11 @@ | |||
| 14 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 15 | * | 16 | * |
| 16 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 17 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 18 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 19 | * | 20 | * |
| 20 | */ | 21 | */ |
| 21 | 22 | ||
| 22 | #ifndef __SCREENSAVER_TYPES_H__ | ||
| 23 | #define __SCREENSAVER_TYPES_H__ | ||
| 24 | |||
| 25 | extern "C" | 23 | extern "C" |
| 26 | { | 24 | { |
| 27 | struct SCR_INFO | 25 | struct SCR_INFO |
| @@ -50,4 +48,3 @@ extern "C" | |||
| 50 | }; | 48 | }; |
| 51 | } | 49 | } |
| 52 | 50 | ||
| 53 | #endif // __SCREENSAVER_TYPES_H__ | ||
diff --git a/xbmc/addons/include/xbmc_stream_utils.hpp b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_stream_utils.hpp index 927fe33..099776a 100644 --- a/xbmc/addons/include/xbmc_stream_utils.hpp +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_stream_utils.hpp | |||
| @@ -160,7 +160,7 @@ namespace ADDON | |||
| 160 | { | 160 | { |
| 161 | XbmcPvrStream *foundStream = GetStreamById(iPhysicalId); | 161 | XbmcPvrStream *foundStream = GetStreamById(iPhysicalId); |
| 162 | if (foundStream) | 162 | if (foundStream) |
| 163 | stream = foundStream; | 163 | *stream = *foundStream; |
| 164 | else | 164 | else |
| 165 | { | 165 | { |
| 166 | stream->iIdentifier = -1; | 166 | stream->iIdentifier = -1; |
diff --git a/xbmc/addons/include/xbmc_vis_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h index c65f844..50452c2 100644 --- a/xbmc/addons/include/xbmc_vis_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | #ifndef __XBMC_VIS_H__ | 1 | #pragma once |
| 2 | #define __XBMC_VIS_H__ | ||
| 3 | 2 | ||
| 4 | /* | 3 | /* |
| 5 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 6 | * http://xbmc.org | 5 | * http://kodi.tv |
| 7 | * | 6 | * |
| 8 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -16,7 +15,7 @@ | |||
| 16 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 17 | * | 16 | * |
| 18 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 19 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 20 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 21 | * | 20 | * |
| 22 | */ | 21 | */ |
| @@ -52,4 +51,3 @@ extern "C" | |||
| 52 | }; | 51 | }; |
| 53 | }; | 52 | }; |
| 54 | 53 | ||
| 55 | #endif | ||
diff --git a/xbmc/addons/include/xbmc_vis_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h index e6b0ccd..708ffef 100644 --- a/xbmc/addons/include/xbmc_vis_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 1 | /* | 3 | /* |
| 2 | * Copyright (C) 2005-2013 Team XBMC | 4 | * Copyright (C) 2005-2015 Team Kodi |
| 3 | * http://xbmc.org | 5 | * http://kodi.tv |
| 4 | * | 6 | * |
| 5 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| @@ -13,17 +15,15 @@ | |||
| 13 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 14 | * | 16 | * |
| 15 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
| 16 | * along with XBMC; see the file COPYING. If not, see | 18 | * along with Kodi; see the file COPYING. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. | 19 | * <http://www.gnu.org/licenses/>. |
| 18 | * | 20 | * |
| 19 | */ | 21 | */ |
| 20 | 22 | ||
| 21 | /* | 23 | /* |
| 22 | Common data structures shared between XBMC and XBMC's visualisations | 24 | Common data structures shared between Kodi and Kodi's visualisations |
| 23 | */ | 25 | */ |
| 24 | 26 | ||
| 25 | #ifndef __VISUALISATION_TYPES_H__ | ||
| 26 | #define __VISUALISATION_TYPES_H__ | ||
| 27 | #include <cstddef> | 27 | #include <cstddef> |
| 28 | 28 | ||
| 29 | extern "C" | 29 | extern "C" |
| @@ -108,4 +108,3 @@ extern "C" | |||
| 108 | }; | 108 | }; |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | #endif //__VISUALISATION_TYPES_H__ | ||
diff --git a/xbmc/cores/AudioEngine/Utils/AEChannelData.h b/xbmc/cores/AudioEngine/Utils/AEChannelData.h index 9993c84..c74aabb 100644 --- a/xbmc/cores/AudioEngine/Utils/AEChannelData.h +++ b/xbmc/cores/AudioEngine/Utils/AEChannelData.h | |||
| @@ -105,14 +105,8 @@ enum AEDataFormat | |||
| 105 | AE_FMT_DOUBLE, | 105 | AE_FMT_DOUBLE, |
| 106 | AE_FMT_FLOAT, | 106 | AE_FMT_FLOAT, |
| 107 | 107 | ||
| 108 | /* Bitstream formats */ | 108 | // Bitstream |
| 109 | AE_FMT_AAC, | 109 | AE_FMT_RAW, |
| 110 | AE_FMT_AC3, | ||
| 111 | AE_FMT_DTS, | ||
| 112 | AE_FMT_EAC3, | ||
| 113 | AE_FMT_TRUEHD, | ||
| 114 | AE_FMT_DTSHD, | ||
| 115 | AE_FMT_LPCM, | ||
| 116 | 110 | ||
| 117 | /* planar formats */ | 111 | /* planar formats */ |
| 118 | AE_FMT_U8P, | 112 | AE_FMT_U8P, |
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h new file mode 100644 index 0000000..d64fbb3 --- /dev/null +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2012-2013 Team XBMC | ||
| 5 | * http://xbmc.org | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with XBMC; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #define DMX_SPECIALID_STREAMINFO -10 | ||
| 24 | #define DMX_SPECIALID_STREAMCHANGE -11 | ||
| 25 | |||
| 26 | typedef struct DemuxPacket | ||
| 27 | { | ||
| 28 | unsigned char* pData; // data | ||
| 29 | int iSize; // data size | ||
| 30 | int iStreamId; // integer representing the stream index | ||
| 31 | int iGroupId; // the group this data belongs to, used to group data from different streams together | ||
| 32 | |||
| 33 | double pts; // pts in DVD_TIME_BASE | ||
| 34 | double dts; // dts in DVD_TIME_BASE | ||
| 35 | double duration; // duration in DVD_TIME_BASE if available | ||
| 36 | } DemuxPacket; | ||
diff --git a/xbmc/filesystem/IFileTypes.h b/xbmc/filesystem/IFileTypes.h new file mode 100644 index 0000000..d2d77eb --- /dev/null +++ b/xbmc/filesystem/IFileTypes.h | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2013 Team XBMC | ||
| 3 | * http://xbmc.org | ||
| 4 | * | ||
| 5 | * This Program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 8 | * any later version. | ||
| 9 | * | ||
| 10 | * This Program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with XBMC; see the file COPYING. If not, see | ||
| 17 | * <http://www.gnu.org/licenses/>. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #pragma once | ||
| 22 | |||
| 23 | #include <stdint.h> | ||
| 24 | |||
| 25 | namespace XFILE | ||
| 26 | { | ||
| 27 | |||
| 28 | /* indicate that caller can handle truncated reads, where function returns before entire buffer has been filled */ | ||
| 29 | static const unsigned int READ_TRUNCATED = 0x01; | ||
| 30 | |||
| 31 | /* indicate that that caller support read in the minimum defined chunk size, this disables internal cache then */ | ||
| 32 | static const unsigned int READ_CHUNKED = 0x02; | ||
| 33 | |||
| 34 | /* use cache to access this file */ | ||
| 35 | static const unsigned int READ_CACHED = 0x04; | ||
| 36 | |||
| 37 | /* open without caching. regardless to file type. */ | ||
| 38 | static const unsigned int READ_NO_CACHE = 0x08; | ||
| 39 | |||
| 40 | /* calcuate bitrate for file while reading */ | ||
| 41 | static const unsigned int READ_BITRATE = 0x10; | ||
| 42 | |||
| 43 | /* indicate to the caller we will seek between multiple streams in the file frequently */ | ||
| 44 | static const unsigned int READ_MULTI_STREAM = 0x20; | ||
| 45 | |||
| 46 | /* indicate to the caller file is audio and/or video (and e.g. may grow) */ | ||
| 47 | static const unsigned int READ_AUDIO_VIDEO = 0x40; | ||
| 48 | |||
| 49 | /* indicate that caller will do write operations before reading */ | ||
| 50 | static const unsigned int READ_AFTER_WRITE = 0x80; | ||
| 51 | |||
| 52 | struct SNativeIoControl | ||
| 53 | { | ||
| 54 | unsigned long int request; | ||
| 55 | void* param; | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct SCacheStatus | ||
| 59 | { | ||
| 60 | uint64_t forward; /**< number of bytes cached forward of current position */ | ||
| 61 | unsigned maxrate; /**< maximum number of bytes per second cache is allowed to fill */ | ||
| 62 | unsigned currate; /**< average read rate from source file since last position change */ | ||
| 63 | bool full; /**< is the cache full */ | ||
| 64 | }; | ||
| 65 | |||
| 66 | typedef enum { | ||
| 67 | IOCTRL_NATIVE = 1, /**< SNativeIoControl structure, containing what should be passed to native ioctrl */ | ||
| 68 | IOCTRL_SEEK_POSSIBLE = 2, /**< return 0 if known not to work, 1 if it should work */ | ||
| 69 | IOCTRL_CACHE_STATUS = 3, /**< SCacheStatus structure */ | ||
| 70 | IOCTRL_CACHE_SETRATE = 4, /**< unsigned int with speed limit for caching in bytes per second */ | ||
| 71 | IOCTRL_SET_CACHE = 8, /** <CFileCache */ | ||
| 72 | } EIoControl; | ||
| 73 | |||
| 74 | enum CURLOPTIONTYPE | ||
| 75 | { | ||
| 76 | CURL_OPTION_OPTION, /**< Set a general option */ | ||
| 77 | CURL_OPTION_PROTOCOL, /**< Set a protocol option */ | ||
| 78 | CURL_OPTION_CREDENTIALS,/**< Set User and password */ | ||
| 79 | CURL_OPTION_HEADER /**< Add a Header */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | } | ||
