diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | 741 |
1 files changed, 741 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h new file mode 100644 index 0000000..8b54ea6 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | |||
| @@ -0,0 +1,741 @@ | |||
| 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 | #include "xbmc_addon_dll.h" | ||
| 24 | #include "xbmc_pvr_types.h" | ||
| 25 | |||
| 26 | /*! | ||
| 27 | * Functions that the PVR 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 | /*! @name PVR add-on methods */ | ||
| 35 | //@{ | ||
| 36 | /*! | ||
| 37 | * Get the XBMC_PVR_API_VERSION that was used to compile this add-on. | ||
| 38 | * Used to check if this add-on is compatible with XBMC. | ||
| 39 | * @return The XBMC_PVR_API_VERSION that was used to compile this add-on. | ||
| 40 | * @remarks Valid implementation required. | ||
| 41 | */ | ||
| 42 | const char* GetPVRAPIVersion(void); | ||
| 43 | |||
| 44 | /*! | ||
| 45 | * Get the XBMC_PVR_MIN_API_VERSION that was used to compile this add-on. | ||
| 46 | * Used to check if this add-on is compatible with XBMC. | ||
| 47 | * @return The XBMC_PVR_MIN_API_VERSION that was used to compile this add-on. | ||
| 48 | * @remarks Valid implementation required. | ||
| 49 | */ | ||
| 50 | const char* GetMininumPVRAPIVersion(void); | ||
| 51 | |||
| 52 | /*! | ||
| 53 | * Get the XBMC_GUI_API_VERSION that was used to compile this add-on. | ||
| 54 | * Used to check if this add-on is compatible with XBMC. | ||
| 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. | ||
| 56 | * @remarks Valid implementation required. | ||
| 57 | * @note see libKODI_guilib.h about related parts | ||
| 58 | */ | ||
| 59 | const char* GetGUIAPIVersion(void); | ||
| 60 | |||
| 61 | /*! | ||
| 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. | ||
| 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. | ||
| 66 | * @note see libKODI_guilib.h about related parts | ||
| 67 | */ | ||
| 68 | const char* GetMininumGUIAPIVersion(void); | ||
| 69 | |||
| 70 | /*! | ||
| 71 | * Get the list of features that this add-on provides. | ||
| 72 | * Called by XBMC to query the add-on's capabilities. | ||
| 73 | * Used to check which options should be presented in the UI, which methods to call, etc. | ||
| 74 | * All capabilities that the add-on supports should be set to true. | ||
| 75 | * @param pCapabilities The add-on's capabilities. | ||
| 76 | * @return PVR_ERROR_NO_ERROR if the properties were fetched successfully. | ||
| 77 | * @remarks Valid implementation required. | ||
| 78 | */ | ||
| 79 | PVR_ERROR GetAddonCapabilities(PVR_ADDON_CAPABILITIES *pCapabilities); | ||
| 80 | |||
| 81 | /*! | ||
| 82 | * @return The name reported by the backend that will be displayed in the UI. | ||
| 83 | * @remarks Valid implementation required. | ||
| 84 | */ | ||
| 85 | const char* GetBackendName(void); | ||
| 86 | |||
| 87 | /*! | ||
| 88 | * @return The version string reported by the backend that will be displayed in the UI. | ||
| 89 | * @remarks Valid implementation required. | ||
| 90 | */ | ||
| 91 | const char* GetBackendVersion(void); | ||
| 92 | |||
| 93 | /*! | ||
| 94 | * @return The connection string reported by the backend that will be displayed in the UI. | ||
| 95 | * @remarks Valid implementation required. | ||
| 96 | */ | ||
| 97 | const char* GetConnectionString(void); | ||
| 98 | |||
| 99 | /*! | ||
| 100 | * Get the disk space reported by the backend (if supported). | ||
| 101 | * @param iTotal The total disk space in bytes. | ||
| 102 | * @param iUsed The used disk space in bytes. | ||
| 103 | * @return PVR_ERROR_NO_ERROR if the drive space has been fetched successfully. | ||
| 104 | * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 105 | */ | ||
| 106 | PVR_ERROR GetDriveSpace(long long* iTotal, long long* iUsed); | ||
| 107 | |||
| 108 | /*! | ||
| 109 | * Call one of the menu hooks (if supported). | ||
| 110 | * Supported PVR_MENUHOOK instances have to be added in ADDON_Create(), by calling AddMenuHook() on the callback. | ||
| 111 | * @param menuhook The hook to call. | ||
| 112 | * @param item The selected item for which the hook was called. | ||
| 113 | * @return PVR_ERROR_NO_ERROR if the hook was called successfully. | ||
| 114 | * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 115 | */ | ||
| 116 | PVR_ERROR CallMenuHook(const PVR_MENUHOOK& menuhook, const PVR_MENUHOOK_DATA &item); | ||
| 117 | //@} | ||
| 118 | |||
| 119 | /*! @name PVR EPG methods | ||
| 120 | * @remarks Only used by XBMC if bSupportsEPG is set to true. | ||
| 121 | */ | ||
| 122 | //@{ | ||
| 123 | /*! | ||
| 124 | * Request the EPG for a channel from the backend. | ||
| 125 | * EPG entries are added to XBMC by calling TransferEpgEntry() on the callback. | ||
| 126 | * @param handle Handle to pass to the callback method. | ||
| 127 | * @param channel The channel to get the EPG table for. | ||
| 128 | * @param iStart Get events after this time (UTC). | ||
| 129 | * @param iEnd Get events before this time (UTC). | ||
| 130 | * @return PVR_ERROR_NO_ERROR if the table has been fetched successfully. | ||
| 131 | * @remarks Required if bSupportsEPG is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 132 | */ | ||
| 133 | PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channel, time_t iStart, time_t iEnd); | ||
| 134 | //@} | ||
| 135 | |||
| 136 | /*! @name PVR channel group methods | ||
| 137 | * @remarks Only used by XBMC is bSupportsChannelGroups is set to true. | ||
| 138 | * If a group or one of the group members changes after the initial import, or if a new one was added, then the add-on | ||
| 139 | * should call TriggerChannelGroupsUpdate() | ||
| 140 | */ | ||
| 141 | //@{ | ||
| 142 | /*! | ||
| 143 | * Get the total amount of channel groups on the backend if it supports channel groups. | ||
| 144 | * @return The amount of channels, or -1 on error. | ||
| 145 | * @remarks Required if bSupportsChannelGroups is set to true. Return -1 if this add-on won't provide this function. | ||
| 146 | */ | ||
| 147 | int GetChannelGroupsAmount(void); | ||
| 148 | |||
| 149 | /*! | ||
| 150 | * Request the list of all channel groups from the backend if it supports channel groups. | ||
| 151 | * Channel group entries are added to XBMC by calling TransferChannelGroup() on the callback. | ||
| 152 | * @param handle Handle to pass to the callback method. | ||
| 153 | * @param bRadio True to get the radio channel groups, false to get the TV channel groups. | ||
| 154 | * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully. | ||
| 155 | * @remarks Required if bSupportsChannelGroups is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 156 | */ | ||
| 157 | PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio); | ||
| 158 | |||
| 159 | /*! | ||
| 160 | * Request the list of all group members of a group from the backend if it supports channel groups. | ||
| 161 | * Member entries are added to XBMC by calling TransferChannelGroupMember() on the callback. | ||
| 162 | * @param handle Handle to pass to the callback method. | ||
| 163 | * @param group The group to get the members for. | ||
| 164 | * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully. | ||
| 165 | * @remarks Required if bSupportsChannelGroups is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 166 | */ | ||
| 167 | PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP& group); | ||
| 168 | //@} | ||
| 169 | |||
| 170 | /** @name PVR channel methods | ||
| 171 | * @remarks Either bSupportsTV or bSupportsRadio is required to be set to true. | ||
| 172 | * If a channel changes after the initial import, or if a new one was added, then the add-on | ||
| 173 | * should call TriggerChannelUpdate() | ||
| 174 | */ | ||
| 175 | //@{ | ||
| 176 | /*! | ||
| 177 | * Show the channel scan dialog if this backend supports it. | ||
| 178 | * @return PVR_ERROR_NO_ERROR if the dialog was displayed successfully. | ||
| 179 | * @remarks Required if bSupportsChannelScan is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 180 | * @note see libKODI_guilib.h about related parts | ||
| 181 | */ | ||
| 182 | PVR_ERROR OpenDialogChannelScan(void); | ||
| 183 | |||
| 184 | /*! | ||
| 185 | * @return The total amount of channels on the backend, or -1 on error. | ||
| 186 | * @remarks Valid implementation required. | ||
| 187 | */ | ||
| 188 | int GetChannelsAmount(void); | ||
| 189 | |||
| 190 | /*! | ||
| 191 | * Request the list of all channels from the backend. | ||
| 192 | * Channel entries are added to XBMC by calling TransferChannelEntry() on the callback. | ||
| 193 | * @param handle Handle to pass to the callback method. | ||
| 194 | * @param bRadio True to get the radio channels, false to get the TV channels. | ||
| 195 | * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully. | ||
| 196 | * @remarks If bSupportsTV is set to true, a valid result set needs to be provided for bRadio = false. | ||
| 197 | * If bSupportsRadio is set to true, a valid result set needs to be provided for bRadio = true. | ||
| 198 | * At least one of these two must provide a valid result set. | ||
| 199 | */ | ||
| 200 | PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio); | ||
| 201 | |||
| 202 | /*! | ||
| 203 | * Delete a channel from the backend. | ||
| 204 | * @param channel The channel to delete. | ||
| 205 | * @return PVR_ERROR_NO_ERROR if the channel has been deleted successfully. | ||
| 206 | * @remarks Required if bSupportsChannelSettings is set to true. | ||
| 207 | */ | ||
| 208 | PVR_ERROR DeleteChannel(const PVR_CHANNEL& channel); | ||
| 209 | |||
| 210 | /*! | ||
| 211 | * Rename a channel on the backend. | ||
| 212 | * @param channel The channel to rename, containing the new channel name. | ||
| 213 | * @return PVR_ERROR_NO_ERROR if the channel has been renamed successfully. | ||
| 214 | * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 215 | */ | ||
| 216 | PVR_ERROR RenameChannel(const PVR_CHANNEL& channel); | ||
| 217 | |||
| 218 | /*! | ||
| 219 | * Move a channel to another channel number on the backend. | ||
| 220 | * @param channel The channel to move, containing the new channel number. | ||
| 221 | * @return PVR_ERROR_NO_ERROR if the channel has been moved successfully. | ||
| 222 | * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 223 | */ | ||
| 224 | PVR_ERROR MoveChannel(const PVR_CHANNEL& channel); | ||
| 225 | |||
| 226 | /*! | ||
| 227 | * Show the channel settings dialog, if supported by the backend. | ||
| 228 | * @param channel The channel to show the dialog for. | ||
| 229 | * @return PVR_ERROR_NO_ERROR if the dialog has been displayed successfully. | ||
| 230 | * @remarks Required if bSupportsChannelSettings is set to true. | ||
| 231 | * @note see libKODI_guilib.h about related parts | ||
| 232 | */ | ||
| 233 | PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL& channel); | ||
| 234 | |||
| 235 | /*! | ||
| 236 | * Show the dialog to add a channel on the backend, if supported by the backend. | ||
| 237 | * @param channel The channel to add. | ||
| 238 | * @return PVR_ERROR_NO_ERROR if the channel has been added successfully. | ||
| 239 | * @remarks Required if bSupportsChannelSettings is set to true. | ||
| 240 | * @note see libKODI_guilib.h about related parts | ||
| 241 | */ | ||
| 242 | PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL& channel); | ||
| 243 | //@} | ||
| 244 | |||
| 245 | /** @name PVR recording methods | ||
| 246 | * @remarks Only used by XBMC is bSupportsRecordings is set to true. | ||
| 247 | * If a recording changes after the initial import, or if a new one was added, | ||
| 248 | * then the add-on should call TriggerRecordingUpdate() | ||
| 249 | */ | ||
| 250 | //@{ | ||
| 251 | /*! | ||
| 252 | * @return The total amount of recordings on the backend or -1 on error. | ||
| 253 | * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true) | ||
| 254 | * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 255 | */ | ||
| 256 | int GetRecordingsAmount(bool deleted); | ||
| 257 | |||
| 258 | /*! | ||
| 259 | * Request the list of all recordings from the backend, if supported. | ||
| 260 | * Recording entries are added to XBMC by calling TransferRecordingEntry() on the callback. | ||
| 261 | * @param handle Handle to pass to the callback method. | ||
| 262 | * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true) | ||
| 263 | * @return PVR_ERROR_NO_ERROR if the recordings have been fetched successfully. | ||
| 264 | * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 265 | */ | ||
| 266 | PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted); | ||
| 267 | |||
| 268 | /*! | ||
| 269 | * Delete a recording on the backend. | ||
| 270 | * @param recording The recording to delete. | ||
| 271 | * @return PVR_ERROR_NO_ERROR if the recording has been deleted successfully. | ||
| 272 | * @remarks Optional, and only used if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 273 | */ | ||
| 274 | PVR_ERROR DeleteRecording(const PVR_RECORDING& recording); | ||
| 275 | |||
| 276 | /*! | ||
| 277 | * Undelete a recording on the backend. | ||
| 278 | * @param recording The recording to undelete. | ||
| 279 | * @return PVR_ERROR_NO_ERROR if the recording has been undeleted successfully. | ||
| 280 | * @remarks Optional, and only used if bSupportsRecordingsUndelete is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 281 | */ | ||
| 282 | PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording); | ||
| 283 | |||
| 284 | /*! | ||
| 285 | * @brief Delete all recordings permanent which in the deleted folder on the backend. | ||
| 286 | * @return PVR_ERROR_NO_ERROR if the recordings has been deleted successfully. | ||
| 287 | */ | ||
| 288 | PVR_ERROR DeleteAllRecordingsFromTrash(); | ||
| 289 | |||
| 290 | /*! | ||
| 291 | * Rename a recording on the backend. | ||
| 292 | * @param recording The recording to rename, containing the new name. | ||
| 293 | * @return PVR_ERROR_NO_ERROR if the recording has been renamed successfully. | ||
| 294 | * @remarks Optional, and only used if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 295 | */ | ||
| 296 | PVR_ERROR RenameRecording(const PVR_RECORDING& recording); | ||
| 297 | |||
| 298 | /*! | ||
| 299 | * Set the play count of a recording on the backend. | ||
| 300 | * @param recording The recording to change the play count. | ||
| 301 | * @param count Play count. | ||
| 302 | * @return PVR_ERROR_NO_ERROR if the recording's play count has been set successfully. | ||
| 303 | * @remarks Required if bSupportsRecordingPlayCount is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 304 | */ | ||
| 305 | PVR_ERROR SetRecordingPlayCount(const PVR_RECORDING& recording, int count); | ||
| 306 | |||
| 307 | /*! | ||
| 308 | * Set the last watched position of a recording on the backend. | ||
| 309 | * @param recording The recording. | ||
| 310 | * @param position The last watched position in seconds | ||
| 311 | * @return PVR_ERROR_NO_ERROR if the position has been stored successfully. | ||
| 312 | * @remarks Required if bSupportsLastPlayedPosition is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 313 | */ | ||
| 314 | PVR_ERROR SetRecordingLastPlayedPosition(const PVR_RECORDING& recording, int lastplayedposition); | ||
| 315 | |||
| 316 | /*! | ||
| 317 | * Retrieve the last watched position of a recording on the backend. | ||
| 318 | * @param recording The recording. | ||
| 319 | * @return The last watched position in seconds or -1 on error | ||
| 320 | * @remarks Required if bSupportsRecordingPlayCount is set to true. Return -1 if this add-on won't provide this function. | ||
| 321 | */ | ||
| 322 | int GetRecordingLastPlayedPosition(const PVR_RECORDING& recording); | ||
| 323 | |||
| 324 | /*! | ||
| 325 | * Retrieve the edit decision list (EDL) of a recording on the backend. | ||
| 326 | * @param recording The recording. | ||
| 327 | * @param edl out: The function has to write the EDL list into this array. | ||
| 328 | * @param size in: The maximum size of the EDL, out: the actual size of the EDL. | ||
| 329 | * @return PVR_ERROR_NO_ERROR if the EDL was successfully read. | ||
| 330 | * @remarks Required if bSupportsRecordingEdl is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 331 | */ | ||
| 332 | PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY edl[], int *size); | ||
| 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 | |||
| 343 | //@} | ||
| 344 | /** @name PVR timer methods | ||
| 345 | * @remarks Only used by XBMC is bSupportsTimers is set to true. | ||
| 346 | * If a timer changes after the initial import, or if a new one was added, | ||
| 347 | * then the add-on should call TriggerTimerUpdate() | ||
| 348 | */ | ||
| 349 | //@{ | ||
| 350 | /*! | ||
| 351 | * @return The total amount of timers on the backend or -1 on error. | ||
| 352 | * @remarks Required if bSupportsTimers is set to true. Return -1 if this add-on won't provide this function. | ||
| 353 | */ | ||
| 354 | int GetTimersAmount(void); | ||
| 355 | |||
| 356 | /*! | ||
| 357 | * Request the list of all timers from the backend if supported. | ||
| 358 | * Timer entries are added to XBMC by calling TransferTimerEntry() on the callback. | ||
| 359 | * @param handle Handle to pass to the callback method. | ||
| 360 | * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully. | ||
| 361 | * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 362 | */ | ||
| 363 | PVR_ERROR GetTimers(ADDON_HANDLE handle); | ||
| 364 | |||
| 365 | /*! | ||
| 366 | * Add a timer on the backend. | ||
| 367 | * @param timer The timer to add. | ||
| 368 | * @return PVR_ERROR_NO_ERROR if the timer has been added successfully. | ||
| 369 | * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 370 | */ | ||
| 371 | PVR_ERROR AddTimer(const PVR_TIMER& timer); | ||
| 372 | |||
| 373 | /*! | ||
| 374 | * Delete a timer on the backend. | ||
| 375 | * @param timer The timer to delete. | ||
| 376 | * @param bForceDelete Set to true to delete a timer that is currently recording a program. | ||
| 377 | * @return PVR_ERROR_NO_ERROR if the timer has been deleted successfully. | ||
| 378 | * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 379 | */ | ||
| 380 | PVR_ERROR DeleteTimer(const PVR_TIMER& timer, bool bForceDelete); | ||
| 381 | |||
| 382 | /*! | ||
| 383 | * Update the timer information on the backend. | ||
| 384 | * @param timer The timer to update. | ||
| 385 | * @return PVR_ERROR_NO_ERROR if the timer has been updated successfully. | ||
| 386 | * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 387 | */ | ||
| 388 | PVR_ERROR UpdateTimer(const PVR_TIMER& timer); | ||
| 389 | |||
| 390 | //@} | ||
| 391 | |||
| 392 | /** @name PVR live stream methods, used to open and close a stream to a channel, and optionally perform read operations on the stream */ | ||
| 393 | //@{ | ||
| 394 | /*! | ||
| 395 | * Open a live stream on the backend. | ||
| 396 | * @param channel The channel to stream. | ||
| 397 | * @return True if the stream has been opened successfully, false otherwise. | ||
| 398 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return false if this add-on won't provide this function. | ||
| 399 | */ | ||
| 400 | bool OpenLiveStream(const PVR_CHANNEL& channel); | ||
| 401 | |||
| 402 | /*! | ||
| 403 | * Close an open live stream. | ||
| 404 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. | ||
| 405 | */ | ||
| 406 | void CloseLiveStream(void); | ||
| 407 | |||
| 408 | /*! | ||
| 409 | * Read from an open live stream. | ||
| 410 | * @param pBuffer The buffer to store the data in. | ||
| 411 | * @param iBufferSize The amount of bytes to read. | ||
| 412 | * @return The amount of bytes that were actually read from the stream. | ||
| 413 | * @remarks Required if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function. | ||
| 414 | */ | ||
| 415 | int ReadLiveStream(unsigned char* pBuffer, unsigned int iBufferSize); | ||
| 416 | |||
| 417 | /*! | ||
| 418 | * Seek in a live stream on a backend that supports timeshifting. | ||
| 419 | * @param iPosition The position to seek to. | ||
| 420 | * @param iWhence ? | ||
| 421 | * @return The new position. | ||
| 422 | * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function. | ||
| 423 | */ | ||
| 424 | long long SeekLiveStream(long long iPosition, int iWhence = SEEK_SET); | ||
| 425 | |||
| 426 | /*! | ||
| 427 | * @return The position in the stream that's currently being read. | ||
| 428 | * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function. | ||
| 429 | */ | ||
| 430 | long long PositionLiveStream(void); | ||
| 431 | |||
| 432 | /*! | ||
| 433 | * @return The total length of the stream that's currently being read. | ||
| 434 | * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function. | ||
| 435 | */ | ||
| 436 | long long LengthLiveStream(void); | ||
| 437 | |||
| 438 | /*! | ||
| 439 | * Switch to another channel. Only to be called when a live stream has already been opened. | ||
| 440 | * @param channel The channel to switch to. | ||
| 441 | * @return True if the switch was successful, false otherwise. | ||
| 442 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return false if this add-on won't provide this function. | ||
| 443 | */ | ||
| 444 | bool SwitchChannel(const PVR_CHANNEL& channel); | ||
| 445 | |||
| 446 | /*! | ||
| 447 | * Get the signal status of the stream that's currently open. | ||
| 448 | * @param signalStatus The signal status. | ||
| 449 | * @return True if the signal status has been read successfully, false otherwise. | ||
| 450 | * @remarks Optional, and only used if bHandlesInputStream or bHandlesDemuxing is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 451 | */ | ||
| 452 | PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS& signalStatus); | ||
| 453 | |||
| 454 | /*! | ||
| 455 | * Get the stream URL for a channel from the backend. Used by the MediaPortal add-on. | ||
| 456 | * @param channel The channel to get the stream URL for. | ||
| 457 | * @return The requested URL. | ||
| 458 | * @remarks Optional, and only used if bHandlesInputStream is set to true. Return NULL if this add-on won't provide this function. | ||
| 459 | */ | ||
| 460 | const char* GetLiveStreamURL(const PVR_CHANNEL& channel); | ||
| 461 | |||
| 462 | /*! | ||
| 463 | * Get the stream properties of the stream that's currently being read. | ||
| 464 | * @param pProperties The properties of the currently playing stream. | ||
| 465 | * @return PVR_ERROR_NO_ERROR if the properties have been fetched successfully. | ||
| 466 | * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 467 | */ | ||
| 468 | PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties); | ||
| 469 | //@} | ||
| 470 | |||
| 471 | /** @name PVR recording stream methods, used to open and close a stream to a recording, and perform read operations on the stream. | ||
| 472 | * @remarks This will only be used if the backend doesn't provide a direct URL in the recording tag. | ||
| 473 | */ | ||
| 474 | //@{ | ||
| 475 | /*! | ||
| 476 | * Open a stream to a recording on the backend. | ||
| 477 | * @param recording The recording to open. | ||
| 478 | * @return True if the stream has been opened successfully, false otherwise. | ||
| 479 | * @remarks Optional, and only used if bSupportsRecordings is set to true. Return false if this add-on won't provide this function. | ||
| 480 | */ | ||
| 481 | bool OpenRecordedStream(const PVR_RECORDING& recording); | ||
| 482 | |||
| 483 | /*! | ||
| 484 | * Close an open stream from a recording. | ||
| 485 | * @remarks Optional, and only used if bSupportsRecordings is set to true. | ||
| 486 | */ | ||
| 487 | void CloseRecordedStream(void); | ||
| 488 | |||
| 489 | /*! | ||
| 490 | * Read from a recording. | ||
| 491 | * @param pBuffer The buffer to store the data in. | ||
| 492 | * @param iBufferSize The amount of bytes to read. | ||
| 493 | * @return The amount of bytes that were actually read from the stream. | ||
| 494 | * @remarks Optional, and only used if bSupportsRecordings is set to true, but required if OpenRecordedStream() is implemented. Return -1 if this add-on won't provide this function. | ||
| 495 | */ | ||
| 496 | int ReadRecordedStream(unsigned char* pBuffer, unsigned int iBufferSize); | ||
| 497 | |||
| 498 | /*! | ||
| 499 | * Seek in a recorded stream. | ||
| 500 | * @param iPosition The position to seek to. | ||
| 501 | * @param iWhence ? | ||
| 502 | * @return The new position. | ||
| 503 | * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function. | ||
| 504 | */ | ||
| 505 | long long SeekRecordedStream(long long iPosition, int iWhence = SEEK_SET); | ||
| 506 | |||
| 507 | /*! | ||
| 508 | * @return The position in the stream that's currently being read. | ||
| 509 | * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function. | ||
| 510 | */ | ||
| 511 | long long PositionRecordedStream(void); | ||
| 512 | |||
| 513 | /*! | ||
| 514 | * @return The total length of the stream that's currently being read. | ||
| 515 | * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function. | ||
| 516 | */ | ||
| 517 | long long LengthRecordedStream(void); | ||
| 518 | //@} | ||
| 519 | |||
| 520 | /** @name PVR demultiplexer methods | ||
| 521 | * @remarks Only used by XBMC is bHandlesDemuxing is set to true. | ||
| 522 | */ | ||
| 523 | //@{ | ||
| 524 | /*! | ||
| 525 | * Reset the demultiplexer in the add-on. | ||
| 526 | * @remarks Required if bHandlesDemuxing is set to true. | ||
| 527 | */ | ||
| 528 | void DemuxReset(void); | ||
| 529 | |||
| 530 | /*! | ||
| 531 | * Abort the demultiplexer thread in the add-on. | ||
| 532 | * @remarks Required if bHandlesDemuxing is set to true. | ||
| 533 | */ | ||
| 534 | void DemuxAbort(void); | ||
| 535 | |||
| 536 | /*! | ||
| 537 | * Flush all data that's currently in the demultiplexer buffer in the add-on. | ||
| 538 | * @remarks Required if bHandlesDemuxing is set to true. | ||
| 539 | */ | ||
| 540 | void DemuxFlush(void); | ||
| 541 | |||
| 542 | /*! | ||
| 543 | * Read the next packet from the demultiplexer, if there is one. | ||
| 544 | * @return The next packet. | ||
| 545 | * If there is no next packet, then the add-on should return the | ||
| 546 | * packet created by calling AllocateDemuxPacket(0) on the callback. | ||
| 547 | * If the stream changed and XBMC's player needs to be reinitialised, | ||
| 548 | * then, the add-on should call AllocateDemuxPacket(0) on the | ||
| 549 | * callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and | ||
| 550 | * return the value. | ||
| 551 | * The add-on should return NULL if an error occured. | ||
| 552 | * @remarks Required if bHandlesDemuxing is set to true. Return NULL if this add-on won't provide this function. | ||
| 553 | */ | ||
| 554 | DemuxPacket* DemuxRead(void); | ||
| 555 | //@} | ||
| 556 | |||
| 557 | /*! | ||
| 558 | * Delay to use when using switching channels for add-ons not providing an input stream. | ||
| 559 | * If the add-on does provide an input stream, then this method will not be called. | ||
| 560 | * Those add-ons can do that in OpenLiveStream() if needed. | ||
| 561 | * @return The delay in milliseconds. | ||
| 562 | */ | ||
| 563 | unsigned int GetChannelSwitchDelay(void); | ||
| 564 | |||
| 565 | /*! | ||
| 566 | * Check if the backend support pausing the currently playing stream | ||
| 567 | * This will enable/disable the pause button in XBMC based on the return value | ||
| 568 | * @return false if the PVR addon/backend does not support pausing, true if possible | ||
| 569 | */ | ||
| 570 | bool CanPauseStream(); | ||
| 571 | |||
| 572 | /*! | ||
| 573 | * Check if the backend supports seeking for the currently playing stream | ||
| 574 | * This will enable/disable the rewind/forward buttons in XBMC based on the return value | ||
| 575 | * @return false if the PVR addon/backend does not support seeking, true if possible | ||
| 576 | */ | ||
| 577 | bool CanSeekStream(); | ||
| 578 | |||
| 579 | /*! | ||
| 580 | * @brief Notify the pvr addon that XBMC (un)paused the currently playing stream | ||
| 581 | */ | ||
| 582 | void PauseStream(bool bPaused); | ||
| 583 | |||
| 584 | /*! | ||
| 585 | * Notify the pvr addon/demuxer that XBMC wishes to seek the stream by time | ||
| 586 | * @param time The absolute time since stream start | ||
| 587 | * @param backwards True to seek to keyframe BEFORE time, else AFTER | ||
| 588 | * @param startpts can be updated to point to where display should start | ||
| 589 | * @return True if the seek operation was possible | ||
| 590 | * @remarks Optional, and only used if addon has its own demuxer. Return False if this add-on won't provide this function. | ||
| 591 | */ | ||
| 592 | bool SeekTime(int time, bool backwards, double *startpts); | ||
| 593 | |||
| 594 | /*! | ||
| 595 | * Notify the pvr addon/demuxer that XBMC wishes to change playback speed | ||
| 596 | * @param speed The requested playback speed | ||
| 597 | * @remarks Optional, and only used if addon has its own demuxer. | ||
| 598 | */ | ||
| 599 | void SetSpeed(int speed); | ||
| 600 | |||
| 601 | /*! | ||
| 602 | * Get actual playing time from addon. With timeshift enabled this is | ||
| 603 | * different to live. | ||
| 604 | * @return time as UTC | ||
| 605 | */ | ||
| 606 | time_t GetPlayingTime(); | ||
| 607 | |||
| 608 | /*! | ||
| 609 | * Get time of oldest packet in timeshift buffer | ||
| 610 | * @return time as UTC | ||
| 611 | */ | ||
| 612 | time_t GetBufferTimeStart(); | ||
| 613 | |||
| 614 | /*! | ||
| 615 | * Get time of latest packet in timeshift buffer | ||
| 616 | * @return time as UTC | ||
| 617 | */ | ||
| 618 | time_t GetBufferTimeEnd(); | ||
| 619 | |||
| 620 | /*! | ||
| 621 | * Get the hostname of the pvr backend server | ||
| 622 | * @return hostname as ip address or alias. If backend does not | ||
| 623 | * utilize a server, return empty string. | ||
| 624 | */ | ||
| 625 | const char* GetBackendHostname(); | ||
| 626 | |||
| 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 | /*! | ||
| 651 | * Called by XBMC to assign the function pointers of this add-on to pClient. | ||
| 652 | * @param pClient The struct to assign the function pointers to. | ||
| 653 | */ | ||
| 654 | void __declspec(dllexport) get_addon(struct PVRClient* pClient) | ||
| 655 | { | ||
| 656 | pClient->GetPVRAPIVersion = GetPVRAPIVersion; | ||
| 657 | pClient->GetMininumPVRAPIVersion = GetMininumPVRAPIVersion; | ||
| 658 | pClient->GetGUIAPIVersion = GetGUIAPIVersion; | ||
| 659 | pClient->GetMininumGUIAPIVersion = GetMininumGUIAPIVersion; | ||
| 660 | pClient->GetAddonCapabilities = GetAddonCapabilities; | ||
| 661 | pClient->GetStreamProperties = GetStreamProperties; | ||
| 662 | pClient->GetConnectionString = GetConnectionString; | ||
| 663 | pClient->GetBackendName = GetBackendName; | ||
| 664 | pClient->GetBackendVersion = GetBackendVersion; | ||
| 665 | pClient->GetDriveSpace = GetDriveSpace; | ||
| 666 | pClient->OpenDialogChannelScan = OpenDialogChannelScan; | ||
| 667 | pClient->MenuHook = CallMenuHook; | ||
| 668 | |||
| 669 | pClient->GetEpg = GetEPGForChannel; | ||
| 670 | |||
| 671 | pClient->GetChannelGroupsAmount = GetChannelGroupsAmount; | ||
| 672 | pClient->GetChannelGroups = GetChannelGroups; | ||
| 673 | pClient->GetChannelGroupMembers = GetChannelGroupMembers; | ||
| 674 | |||
| 675 | pClient->GetChannelsAmount = GetChannelsAmount; | ||
| 676 | pClient->GetChannels = GetChannels; | ||
| 677 | pClient->DeleteChannel = DeleteChannel; | ||
| 678 | pClient->RenameChannel = RenameChannel; | ||
| 679 | pClient->MoveChannel = MoveChannel; | ||
| 680 | pClient->OpenDialogChannelSettings = OpenDialogChannelSettings; | ||
| 681 | pClient->OpenDialogChannelAdd = OpenDialogChannelAdd; | ||
| 682 | |||
| 683 | pClient->GetRecordingsAmount = GetRecordingsAmount; | ||
| 684 | pClient->GetRecordings = GetRecordings; | ||
| 685 | pClient->DeleteRecording = DeleteRecording; | ||
| 686 | pClient->UndeleteRecording = UndeleteRecording; | ||
| 687 | pClient->DeleteAllRecordingsFromTrash = DeleteAllRecordingsFromTrash; | ||
| 688 | pClient->RenameRecording = RenameRecording; | ||
| 689 | pClient->SetRecordingPlayCount = SetRecordingPlayCount; | ||
| 690 | pClient->SetRecordingLastPlayedPosition = SetRecordingLastPlayedPosition; | ||
| 691 | pClient->GetRecordingLastPlayedPosition = GetRecordingLastPlayedPosition; | ||
| 692 | pClient->GetRecordingEdl = GetRecordingEdl; | ||
| 693 | |||
| 694 | pClient->GetTimerTypes = GetTimerTypes; | ||
| 695 | pClient->GetTimersAmount = GetTimersAmount; | ||
| 696 | pClient->GetTimers = GetTimers; | ||
| 697 | pClient->AddTimer = AddTimer; | ||
| 698 | pClient->DeleteTimer = DeleteTimer; | ||
| 699 | pClient->UpdateTimer = UpdateTimer; | ||
| 700 | |||
| 701 | pClient->OpenLiveStream = OpenLiveStream; | ||
| 702 | pClient->CloseLiveStream = CloseLiveStream; | ||
| 703 | pClient->ReadLiveStream = ReadLiveStream; | ||
| 704 | pClient->SeekLiveStream = SeekLiveStream; | ||
| 705 | pClient->PositionLiveStream = PositionLiveStream; | ||
| 706 | pClient->LengthLiveStream = LengthLiveStream; | ||
| 707 | pClient->SwitchChannel = SwitchChannel; | ||
| 708 | pClient->SignalStatus = SignalStatus; | ||
| 709 | pClient->GetLiveStreamURL = GetLiveStreamURL; | ||
| 710 | pClient->GetChannelSwitchDelay = GetChannelSwitchDelay; | ||
| 711 | pClient->CanPauseStream = CanPauseStream; | ||
| 712 | pClient->PauseStream = PauseStream; | ||
| 713 | pClient->CanSeekStream = CanSeekStream; | ||
| 714 | pClient->SeekTime = SeekTime; | ||
| 715 | pClient->SetSpeed = SetSpeed; | ||
| 716 | |||
| 717 | pClient->OpenRecordedStream = OpenRecordedStream; | ||
| 718 | pClient->CloseRecordedStream = CloseRecordedStream; | ||
| 719 | pClient->ReadRecordedStream = ReadRecordedStream; | ||
| 720 | pClient->SeekRecordedStream = SeekRecordedStream; | ||
| 721 | pClient->PositionRecordedStream = PositionRecordedStream; | ||
| 722 | pClient->LengthRecordedStream = LengthRecordedStream; | ||
| 723 | |||
| 724 | pClient->DemuxReset = DemuxReset; | ||
| 725 | pClient->DemuxAbort = DemuxAbort; | ||
| 726 | pClient->DemuxFlush = DemuxFlush; | ||
| 727 | pClient->DemuxRead = DemuxRead; | ||
| 728 | |||
| 729 | pClient->GetPlayingTime = GetPlayingTime; | ||
| 730 | pClient->GetBufferTimeStart = GetBufferTimeStart; | ||
| 731 | pClient->GetBufferTimeEnd = GetBufferTimeEnd; | ||
| 732 | |||
| 733 | pClient->GetBackendHostname = GetBackendHostname; | ||
| 734 | |||
| 735 | pClient->IsTimeshifting = IsTimeshifting; | ||
| 736 | pClient->IsRealTimeStream = IsRealTimeStream; | ||
| 737 | |||
| 738 | pClient->SetEPGTimeFrame = SetEPGTimeFrame; | ||
| 739 | }; | ||
| 740 | }; | ||
| 741 | |||
