From 5f8335c1e49ce108ef3481863833c98efa00411b Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 2 Jul 2020 23:09:26 +0200 Subject: sync with upstream --- .../include/kodi/c-api/CMakeLists.txt | 9 + .../kodi/c-api/addon-instance/CMakeLists.txt | 6 + .../kodi/c-api/addon-instance/image_decoder.h | 78 +++ .../include/kodi/c-api/addon-instance/pvr.h | 327 +++++++++++ .../kodi/c-api/addon-instance/pvr/CMakeLists.txt | 14 + .../c-api/addon-instance/pvr/pvr_channel_groups.h | 54 ++ .../kodi/c-api/addon-instance/pvr/pvr_channels.h | 104 ++++ .../kodi/c-api/addon-instance/pvr/pvr_defines.h | 61 ++ .../kodi/c-api/addon-instance/pvr/pvr_edl.h | 62 ++ .../kodi/c-api/addon-instance/pvr/pvr_epg.h | 653 +++++++++++++++++++++ .../kodi/c-api/addon-instance/pvr/pvr_general.h | 288 +++++++++ .../kodi/c-api/addon-instance/pvr/pvr_menu_hook.h | 72 +++ .../kodi/c-api/addon-instance/pvr/pvr_recordings.h | 143 +++++ .../kodi/c-api/addon-instance/pvr/pvr_stream.h | 155 +++++ .../kodi/c-api/addon-instance/pvr/pvr_timers.h | 407 +++++++++++++ .../include/kodi/c-api/addon_base.h | 252 ++++++++ .../include/kodi/c-api/audio_engine.h | 308 ++++++++++ .../include/kodi/c-api/filesystem.h | 299 ++++++++++ .../include/kodi/c-api/general.h | 123 ++++ .../include/kodi/c-api/network.h | 43 ++ 20 files changed, 3458 insertions(+) create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/CMakeLists.txt create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon_base.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/audio_engine.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/filesystem.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/general.h create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/network.h (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api') diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/CMakeLists.txt new file mode 100644 index 0000000..d7b2269 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/CMakeLists.txt @@ -0,0 +1,9 @@ +set(HEADERS addon_base.h + audio_engine.h + filesystem.h + general.h + network.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-addon-dev-kit_include_kodi_c-api) +endif() diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt new file mode 100644 index 0000000..dfcfe66 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt @@ -0,0 +1,6 @@ +set(HEADERS image_decoder.h + pvr.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-addon-dev-kit_include_kodi_c-api_addon-instance) +endif() diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h new file mode 100644 index 0000000..595a5dc --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "../addon_base.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_addon_imagedecoder_Defs + /// @brief **Image format types**\n + /// Used to define wanted target format where image decoder should give to + /// Kodi. + /// + typedef enum ImageFormat + { + /// @brief A 32-bit ARGB pixel format, with alpha, that uses 8 bits per + /// channel, ARGBARGB... + ADDON_IMG_FMT_A8R8G8B8 = 1, + + /// @brief A 8, alpha only, 8bpp, AAA... + ADDON_IMG_FMT_A8 = 2, + + /// @brief RGBA 8:8:8:8, with alpha, 32bpp, RGBARGBA... + ADDON_IMG_FMT_RGBA8 = 3, + + /// @brief RGB 8:8:8, with alpha, 24bpp, RGBRGB... + ADDON_IMG_FMT_RGB8 = 4 + } ImageFormat; + //---------------------------------------------------------------------------- + + typedef struct AddonProps_ImageDecoder + { + const char* mimetype; + } AddonProps_ImageDecoder; + + typedef struct AddonToKodiFuncTable_ImageDecoder + { + KODI_HANDLE kodi_instance; + } AddonToKodiFuncTable_ImageDecoder; + + struct AddonInstance_ImageDecoder; + typedef struct KodiToAddonFuncTable_ImageDecoder + { + KODI_HANDLE addonInstance; + bool(__cdecl* load_image_from_memory)(const struct AddonInstance_ImageDecoder* instance, + unsigned char* buffer, + unsigned int buf_size, + unsigned int* width, + unsigned int* height); + + bool(__cdecl* decode)(const struct AddonInstance_ImageDecoder* instance, + unsigned char* pixels, + unsigned int width, + unsigned int height, + unsigned int pitch, + enum ImageFormat format); + } KodiToAddonFuncTable_ImageDecoder; + + typedef struct AddonInstance_ImageDecoder + { + struct AddonProps_ImageDecoder* props; + struct AddonToKodiFuncTable_ImageDecoder* toKodi; + struct KodiToAddonFuncTable_ImageDecoder* toAddon; + } AddonInstance_ImageDecoder; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr.h new file mode 100644 index 0000000..2d255ad --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr.h @@ -0,0 +1,327 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "../../AddonBase.h" +#include "pvr/pvr_channel_groups.h" +#include "pvr/pvr_channels.h" +#include "pvr/pvr_defines.h" +#include "pvr/pvr_edl.h" +#include "pvr/pvr_epg.h" +#include "pvr/pvr_general.h" +#include "pvr/pvr_menu_hook.h" +#include "pvr/pvr_recordings.h" +#include "pvr/pvr_stream.h" +#include "pvr/pvr_timers.h" + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" main interface function tables between Kodi and addon +// +// Values related to all parts and not used direct on addon, are to define here. +// +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + /*! + * @internal + * @brief PVR "C" basis API interface + * + * This field contains things that are exchanged between Kodi and Addon + * and is the basis of the PVR-side "C" API. + * + * @warning Care should be taken when making changes in this fields!\n + * Changes can destroy API in addons that have already been created. If a + * necessary change or new feature is added, the version of the PVR + * at @ref ADDON_INSTANCE_VERSION_PVR_MIN must be increased too.\n + * \n + * Conditional changes can be made in some places, without min PVR version + * increase. The add-on should then use CreateInstanceEx and add partial tests + * for this in the C++ header. + * + * Have by add of new parts a look about **Doxygen** `\\ingroup`, so that + * added parts included in documentation. + * + * If you add addon side related documentation, where his dev need know, + * use `///`. For parts only for Kodi make it like here. + * + * @endinternal + */ + + struct AddonInstance_PVR; + + /*! + * @brief Structure to define typical standard values + */ + typedef struct AddonProperties_PVR + { + const char* strUserPath; + const char* strClientPath; + int iEpgMaxDays; + } AddonProperties_PVR; + + /*! + * @brief Structure to transfer the methods from Kodi to addon + */ + typedef struct AddonToKodiFuncTable_PVR + { + // Pointer inside Kodi where used from him to find his class + KODI_HANDLE kodiInstance; + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // General callback functions + void (*AddMenuHook)(void* kodiInstance, const struct PVR_MENUHOOK* hook); + void (*RecordingNotification)(void* kodiInstance, + const char* name, + const char* fileName, + bool on); + void (*ConnectionStateChange)(void* kodiInstance, + const char* strConnectionString, + enum PVR_CONNECTION_STATE newState, + const char* strMessage); + void (*EpgEventStateChange)(void* kodiInstance, + struct EPG_TAG* tag, + enum EPG_EVENT_STATE newState); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Transfer functions where give data back to Kodi, e.g. GetChannels calls TransferChannelEntry + void (*TransferChannelEntry)(void* kodiInstance, + const ADDON_HANDLE handle, + const struct PVR_CHANNEL* chan); + void (*TransferChannelGroup)(void* kodiInstance, + const ADDON_HANDLE handle, + const struct PVR_CHANNEL_GROUP* group); + void (*TransferChannelGroupMember)(void* kodiInstance, + const ADDON_HANDLE handle, + const struct PVR_CHANNEL_GROUP_MEMBER* member); + void (*TransferEpgEntry)(void* kodiInstance, + const ADDON_HANDLE handle, + const struct EPG_TAG* epgentry); + void (*TransferRecordingEntry)(void* kodiInstance, + const ADDON_HANDLE handle, + const struct PVR_RECORDING* recording); + void (*TransferTimerEntry)(void* kodiInstance, + const ADDON_HANDLE handle, + const struct PVR_TIMER* timer); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Kodi inform interface functions + void (*TriggerChannelUpdate)(void* kodiInstance); + void (*TriggerChannelGroupsUpdate)(void* kodiInstance); + void (*TriggerEpgUpdate)(void* kodiInstance, unsigned int iChannelUid); + void (*TriggerRecordingUpdate)(void* kodiInstance); + void (*TriggerTimerUpdate)(void* kodiInstance); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Stream demux interface functions + void (*FreeDemuxPacket)(void* kodiInstance, struct DemuxPacket* pPacket); + struct DemuxPacket* (*AllocateDemuxPacket)(void* kodiInstance, int iDataSize); + struct PVR_CODEC (*GetCodecByName)(const void* kodiInstance, const char* strCodecName); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // New functions becomes added below and can be on another API change (where + // breaks min API version) moved up. + } AddonToKodiFuncTable_PVR; + + /*! + * @brief Structure to transfer the methods from addon to Kodi + */ + typedef struct KodiToAddonFuncTable_PVR + { + // Pointer inside addon where used on them to find his instance class (currently unused!) + KODI_HANDLE addonInstance; + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // General interface functions + enum PVR_ERROR(__cdecl* GetCapabilities)(const struct AddonInstance_PVR*, + struct PVR_ADDON_CAPABILITIES*); + enum PVR_ERROR(__cdecl* GetBackendName)(const struct AddonInstance_PVR*, char*, int); + enum PVR_ERROR(__cdecl* GetBackendVersion)(const struct AddonInstance_PVR*, char*, int); + enum PVR_ERROR(__cdecl* GetBackendHostname)(const struct AddonInstance_PVR*, char*, int); + enum PVR_ERROR(__cdecl* GetConnectionString)(const struct AddonInstance_PVR*, char*, int); + enum PVR_ERROR(__cdecl* GetDriveSpace)(const struct AddonInstance_PVR*, uint64_t*, uint64_t*); + enum PVR_ERROR(__cdecl* CallSettingsMenuHook)(const struct AddonInstance_PVR*, + const struct PVR_MENUHOOK*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Channel interface functions + + enum PVR_ERROR(__cdecl* GetChannelsAmount)(const struct AddonInstance_PVR*, int*); + enum PVR_ERROR(__cdecl* GetChannels)(const struct AddonInstance_PVR*, ADDON_HANDLE, bool); + enum PVR_ERROR(__cdecl* GetChannelStreamProperties)(const struct AddonInstance_PVR*, + const struct PVR_CHANNEL*, + struct PVR_NAMED_VALUE*, + unsigned int*); + enum PVR_ERROR(__cdecl* GetSignalStatus)(const struct AddonInstance_PVR*, + int, + struct PVR_SIGNAL_STATUS*); + enum PVR_ERROR(__cdecl* GetDescrambleInfo)(const struct AddonInstance_PVR*, + int, + struct PVR_DESCRAMBLE_INFO*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Channel group interface functions + enum PVR_ERROR(__cdecl* GetChannelGroupsAmount)(const struct AddonInstance_PVR*, int*); + enum PVR_ERROR(__cdecl* GetChannelGroups)(const struct AddonInstance_PVR*, ADDON_HANDLE, bool); + enum PVR_ERROR(__cdecl* GetChannelGroupMembers)(const struct AddonInstance_PVR*, + ADDON_HANDLE, + const struct PVR_CHANNEL_GROUP*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Channel edit interface functions + enum PVR_ERROR(__cdecl* DeleteChannel)(const struct AddonInstance_PVR*, + const struct PVR_CHANNEL*); + enum PVR_ERROR(__cdecl* RenameChannel)(const struct AddonInstance_PVR*, + const struct PVR_CHANNEL*); + enum PVR_ERROR(__cdecl* OpenDialogChannelSettings)(const struct AddonInstance_PVR*, + const struct PVR_CHANNEL*); + enum PVR_ERROR(__cdecl* OpenDialogChannelAdd)(const struct AddonInstance_PVR*, + const struct PVR_CHANNEL*); + enum PVR_ERROR(__cdecl* OpenDialogChannelScan)(const struct AddonInstance_PVR*); + enum PVR_ERROR(__cdecl* CallChannelMenuHook)(const struct AddonInstance_PVR*, + const PVR_MENUHOOK*, + const PVR_CHANNEL*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // EPG interface functions + enum PVR_ERROR(__cdecl* GetEPGForChannel)( + const struct AddonInstance_PVR*, ADDON_HANDLE, int, time_t, time_t); + enum PVR_ERROR(__cdecl* IsEPGTagRecordable)(const struct AddonInstance_PVR*, + const struct EPG_TAG*, + bool*); + enum PVR_ERROR(__cdecl* IsEPGTagPlayable)(const struct AddonInstance_PVR*, + const struct EPG_TAG*, + bool*); + enum PVR_ERROR(__cdecl* GetEPGTagEdl)(const struct AddonInstance_PVR*, + const struct EPG_TAG*, + struct PVR_EDL_ENTRY[], + int*); + enum PVR_ERROR(__cdecl* GetEPGTagStreamProperties)(const struct AddonInstance_PVR*, + const struct EPG_TAG*, + struct PVR_NAMED_VALUE*, + unsigned int*); + enum PVR_ERROR(__cdecl* SetEPGTimeFrame)(const struct AddonInstance_PVR*, int); + enum PVR_ERROR(__cdecl* CallEPGMenuHook)(const struct AddonInstance_PVR*, + const struct PVR_MENUHOOK*, + const struct EPG_TAG*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Recording interface functions + enum PVR_ERROR(__cdecl* GetRecordingsAmount)(const struct AddonInstance_PVR*, bool, int*); + enum PVR_ERROR(__cdecl* GetRecordings)(const struct AddonInstance_PVR*, ADDON_HANDLE, bool); + enum PVR_ERROR(__cdecl* DeleteRecording)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*); + enum PVR_ERROR(__cdecl* UndeleteRecording)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*); + enum PVR_ERROR(__cdecl* DeleteAllRecordingsFromTrash)(const struct AddonInstance_PVR*); + enum PVR_ERROR(__cdecl* RenameRecording)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*); + enum PVR_ERROR(__cdecl* SetRecordingLifetime)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*); + enum PVR_ERROR(__cdecl* SetRecordingPlayCount)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*, + int); + enum PVR_ERROR(__cdecl* SetRecordingLastPlayedPosition)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*, + int); + enum PVR_ERROR(__cdecl* GetRecordingLastPlayedPosition)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*, + int*); + enum PVR_ERROR(__cdecl* GetRecordingEdl)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*, + struct PVR_EDL_ENTRY[], + int*); + enum PVR_ERROR(__cdecl* GetRecordingSize)(const struct AddonInstance_PVR*, + const PVR_RECORDING*, + int64_t*); + enum PVR_ERROR(__cdecl* GetRecordingStreamProperties)(const struct AddonInstance_PVR*, + const struct PVR_RECORDING*, + struct PVR_NAMED_VALUE*, + unsigned int*); + enum PVR_ERROR(__cdecl* CallRecordingMenuHook)(const struct AddonInstance_PVR*, + const struct PVR_MENUHOOK*, + const struct PVR_RECORDING*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Timer interface functions + enum PVR_ERROR(__cdecl* GetTimerTypes)(const struct AddonInstance_PVR*, + struct PVR_TIMER_TYPE[], + int*); + enum PVR_ERROR(__cdecl* GetTimersAmount)(const struct AddonInstance_PVR*, int*); + enum PVR_ERROR(__cdecl* GetTimers)(const struct AddonInstance_PVR*, ADDON_HANDLE); + enum PVR_ERROR(__cdecl* AddTimer)(const struct AddonInstance_PVR*, const struct PVR_TIMER*); + enum PVR_ERROR(__cdecl* DeleteTimer)(const struct AddonInstance_PVR*, + const struct PVR_TIMER*, + bool); + enum PVR_ERROR(__cdecl* UpdateTimer)(const struct AddonInstance_PVR*, const struct PVR_TIMER*); + enum PVR_ERROR(__cdecl* CallTimerMenuHook)(const struct AddonInstance_PVR*, + const struct PVR_MENUHOOK*, + const struct PVR_TIMER*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Powersaving interface functions + enum PVR_ERROR(__cdecl* OnSystemSleep)(const struct AddonInstance_PVR*); + enum PVR_ERROR(__cdecl* OnSystemWake)(const struct AddonInstance_PVR*); + enum PVR_ERROR(__cdecl* OnPowerSavingActivated)(const struct AddonInstance_PVR*); + enum PVR_ERROR(__cdecl* OnPowerSavingDeactivated)(const struct AddonInstance_PVR*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Live stream read interface functions + bool(__cdecl* OpenLiveStream)(const struct AddonInstance_PVR*, const struct PVR_CHANNEL*); + void(__cdecl* CloseLiveStream)(const struct AddonInstance_PVR*); + int(__cdecl* ReadLiveStream)(const struct AddonInstance_PVR*, unsigned char*, unsigned int); + int64_t(__cdecl* SeekLiveStream)(const struct AddonInstance_PVR*, int64_t, int); + int64_t(__cdecl* LengthLiveStream)(const struct AddonInstance_PVR*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Recording stream read interface functions + bool(__cdecl* OpenRecordedStream)(const struct AddonInstance_PVR*, const struct PVR_RECORDING*); + void(__cdecl* CloseRecordedStream)(const struct AddonInstance_PVR*); + int(__cdecl* ReadRecordedStream)(const struct AddonInstance_PVR*, unsigned char*, unsigned int); + int64_t(__cdecl* SeekRecordedStream)(const struct AddonInstance_PVR*, int64_t, int); + int64_t(__cdecl* LengthRecordedStream)(const struct AddonInstance_PVR*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // Stream demux interface functions + enum PVR_ERROR(__cdecl* GetStreamProperties)(const struct AddonInstance_PVR*, + struct PVR_STREAM_PROPERTIES*); + struct DemuxPacket*(__cdecl* DemuxRead)(const struct AddonInstance_PVR*); + void(__cdecl* DemuxReset)(const struct AddonInstance_PVR*); + void(__cdecl* DemuxAbort)(const struct AddonInstance_PVR*); + void(__cdecl* DemuxFlush)(const struct AddonInstance_PVR*); + void(__cdecl* SetSpeed)(const struct AddonInstance_PVR*, int); + void(__cdecl* FillBuffer)(const struct AddonInstance_PVR*, bool); + bool(__cdecl* SeekTime)(const struct AddonInstance_PVR*, double, bool, double*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // General stream interface functions + bool(__cdecl* CanPauseStream)(const struct AddonInstance_PVR*); + void(__cdecl* PauseStream)(const struct AddonInstance_PVR*, bool); + bool(__cdecl* CanSeekStream)(const struct AddonInstance_PVR*); + bool(__cdecl* IsRealTimeStream)(const struct AddonInstance_PVR*); + enum PVR_ERROR(__cdecl* GetStreamTimes)(const struct AddonInstance_PVR*, + struct PVR_STREAM_TIMES*); + enum PVR_ERROR(__cdecl* GetStreamReadChunkSize)(const struct AddonInstance_PVR*, int*); + + //--==----==----==----==----==----==----==----==----==----==----==----==----== + // New functions becomes added below and can be on another API change (where + // breaks min API version) moved up. + } KodiToAddonFuncTable_PVR; + + typedef struct AddonInstance_PVR + { + struct AddonProperties_PVR* props; + struct AddonToKodiFuncTable_PVR* toKodi; + struct KodiToAddonFuncTable_PVR* toAddon; + } AddonInstance_PVR; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt new file mode 100644 index 0000000..6617084 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt @@ -0,0 +1,14 @@ +set(HEADERS pvr_channel_groups.h + pvr_channels.h + pvr_defines.h + pvr_edl.h + pvr_epg.h + pvr_general.h + pvr_menu_hook.h + pvr_recordings.h + pvr_stream.h + pvr_timers.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-addon-dev-kit_include_kodi_c-api_addon-instance_pvr) +endif() diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h new file mode 100644 index 0000000..36f9ed6 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 3 - PVR channel group +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + /*! + * @brief "C" PVR add-on channel group. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRChannelGroup for description of values. + */ + typedef struct PVR_CHANNEL_GROUP + { + char strGroupName[PVR_ADDON_NAME_STRING_LENGTH]; + bool bIsRadio; + unsigned int iPosition; + } PVR_CHANNEL_GROUP; + + /*! + * @brief "C" PVR add-on channel group member. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRChannelGroupMember for description of values. + */ + typedef struct PVR_CHANNEL_GROUP_MEMBER + { + char strGroupName[PVR_ADDON_NAME_STRING_LENGTH]; + unsigned int iChannelUniqueId; + unsigned int iChannelNumber; + unsigned int iSubChannelNumber; + int iOrder; + } PVR_CHANNEL_GROUP_MEMBER; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h new file mode 100644 index 0000000..a2ce591 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 2 - PVR channel +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Channel + /// @brief Denotes that no channel uid is available. + /// + /// Special @ref kodi::addon::PVRTimer::SetClientChannelUid() and + /// @ref kodi::addon::PVRRecording::SetChannelUid() value to indicate that no + /// channel uid is available. + #define PVR_CHANNEL_INVALID_UID -1 + //---------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on channel. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRChannel for description of values. + */ + typedef struct PVR_CHANNEL + { + unsigned int iUniqueId; + bool bIsRadio; + unsigned int iChannelNumber; + unsigned int iSubChannelNumber; + char strChannelName[PVR_ADDON_NAME_STRING_LENGTH]; + char strMimeType[PVR_ADDON_INPUT_FORMAT_STRING_LENGTH]; + unsigned int iEncryptionSystem; + char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; + bool bIsHidden; + bool bHasArchive; + int iOrder; + } PVR_CHANNEL; + + /*! + * @brief "C" PVR add-on signal status information. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRSignalStatus for description of values. + */ + typedef struct PVR_SIGNAL_STATUS + { + char strAdapterName[PVR_ADDON_NAME_STRING_LENGTH]; + char strAdapterStatus[PVR_ADDON_NAME_STRING_LENGTH]; + char strServiceName[PVR_ADDON_NAME_STRING_LENGTH]; + char strProviderName[PVR_ADDON_NAME_STRING_LENGTH]; + char strMuxName[PVR_ADDON_NAME_STRING_LENGTH]; + int iSNR; + int iSignal; + long iBER; + long iUNC; + } PVR_SIGNAL_STATUS; + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo + /// @brief Special @ref cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo + /// value to indicate that a struct member's value is not available + /// + #define PVR_DESCRAMBLE_INFO_NOT_AVAILABLE -1 + //---------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on descramble information. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRDescrambleInfo for description of values. + */ + typedef struct PVR_DESCRAMBLE_INFO + { + int iPid; + int iCaid; + int iProvid; + int iEcmTime; + int iHops; + char strCardSystem[PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH]; + char strReader[PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH]; + char strFrom[PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH]; + char strProtocol[PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH]; + } PVR_DESCRAMBLE_INFO; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h new file mode 100644 index 0000000..af1daae --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Standard PVR definitions +// +// Values related to all parts and not used direct on addon, are to define here. +// +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + /*! + * @brief API array sizes which are used for data exchange between + * Kodi and addon. + */ + ///@{ + #define PVR_ADDON_NAME_STRING_LENGTH 1024 + #define PVR_ADDON_URL_STRING_LENGTH 1024 + #define PVR_ADDON_DESC_STRING_LENGTH 1024 + #define PVR_ADDON_INPUT_FORMAT_STRING_LENGTH 32 + #define PVR_ADDON_EDL_LENGTH 32 + #define PVR_ADDON_TIMERTYPE_ARRAY_SIZE 32 + #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE 512 + #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL 128 + #define PVR_ADDON_TIMERTYPE_STRING_LENGTH 128 + #define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 128 + #define PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE 512 + #define PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH 64 + #define PVR_ADDON_DATE_STRING_LENGTH 32 + ///@} + + /*! + * @brief "C" Representation of a general attribute integer value. + */ + typedef struct PVR_ATTRIBUTE_INT_VALUE + { + int iValue; + char strDescription[PVR_ADDON_ATTRIBUTE_DESC_LENGTH]; + } PVR_ATTRIBUTE_INT_VALUE; + + /*! + * @brief "C" Representation of a named value. + */ + typedef struct PVR_NAMED_VALUE + { + char strName[PVR_ADDON_NAME_STRING_LENGTH]; + char strValue[PVR_ADDON_NAME_STRING_LENGTH]; + } PVR_NAMED_VALUE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h new file mode 100644 index 0000000..8378eaf --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 8 - PVR Edit definition list (EDL) +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_EDLEntry_PVR_EDL_TYPE enum PVR_EDL_TYPE + /// @ingroup cpp_kodi_addon_pvr_Defs_EDLEntry + /// @brief **Edit definition list types**\n + /// Possible type values for @ref cpp_kodi_addon_pvr_Defs_EDLEntry_PVREDLEntry. + /// + ///@{ + typedef enum PVR_EDL_TYPE + { + /// @brief __0__ : cut (completely remove content) + PVR_EDL_TYPE_CUT = 0, + + /// @brief __1__ : mute audio + PVR_EDL_TYPE_MUTE = 1, + + /// @brief __2__ : scene markers (chapter seeking) + PVR_EDL_TYPE_SCENE = 2, + + /// @brief __3__ : commercial breaks + PVR_EDL_TYPE_COMBREAK = 3 + } PVR_EDL_TYPE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief "C" Edit definition list entry. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVREDLEntry for description of values. + */ + typedef struct PVR_EDL_ENTRY + { + int64_t start; + int64_t end; + enum PVR_EDL_TYPE type; + } PVR_EDL_ENTRY; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h new file mode 100644 index 0000000..57c603f --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h @@ -0,0 +1,653 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 4 - PVR EPG +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT enum EPG_EVENT_CONTENTMASK (and sub types) + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief **EPG entry content event types.**\n + /// These ID's come from the DVB-SI EIT table "content descriptor" + /// Also known under the name "E-book genre assignments". + /// + /// See [ETSI EN 300 468 V1.14.1 (2014-05)](https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.14.01_60/en_300468v011401p.pdf) + /// about. + /// + /// Values used by this functions: + /// - @ref kodi::addon::PVREPGTag::SetGenreType() + /// - @ref kodi::addon::PVREPGTag::SetGenreSubType() + /// - @ref kodi::addon::PVRRecording::SetGenreType() + /// - @ref kodi::addon::PVRRecording::SetGenreSubType() + /// + /// Following types are listed here: + /// | emum Type | Description + /// |-----------|-------------------- + /// | @ref EPG_EVENT_CONTENTMASK | EPG entry main content to use. + /// | @ref EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_MOVIEDRAMA event types for sub type of "Movie/Drama". + /// | @ref EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS event types for sub type of "News/Current affairs". + /// | @ref EPG_EVENT_CONTENTSUBMASK_SHOW | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SHOW event types for sub type of "Show/Game show". + /// | @ref EPG_EVENT_CONTENTSUBMASK_SPORTS | @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SPORTS event types for sub type of "Sports". + /// | @ref EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_CHILDRENYOUTH event types for sub type of "Children's/Youth programmes". + /// | @ref EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE event types for sub type of "Music/Ballet/Dance". + /// | @ref EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_ARTSCULTURE event types for sub type of "Arts/Culture (without music)". + /// | @ref EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS event types for sub type of "Social/Political issues/Economics". + /// | @ref EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE event types for sub type of "Education/Science/Factual topics". + /// | @ref EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_LEISUREHOBBIES event types for sub type of "Leisure hobbies". + /// | @ref EPG_EVENT_CONTENTSUBMASK_SPECIAL | EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SPECIAL event types for sub type of "Special characteristics". + ///@{ + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry main content to use. + /// + ///@{ + typedef enum EPG_EVENT_CONTENTMASK + { + /// @brief __0x00__ : Undefined content mask entry. + EPG_EVENT_CONTENTMASK_UNDEFINED = 0x00, + + /// @brief __0x10__ : Movie/Drama.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA about related sub types. + EPG_EVENT_CONTENTMASK_MOVIEDRAMA = 0x10, + + /// @brief __0x20__ : News/Current affairs.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS about related sub types. + EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS = 0x20, + + /// @brief __0x30__ : Show/Game show.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_SHOW about related sub types. + EPG_EVENT_CONTENTMASK_SHOW = 0x30, + + /// @brief __0x40__ : Sports.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_SPORTS about related sub types. + EPG_EVENT_CONTENTMASK_SPORTS = 0x40, + + /// @brief __0x50__ : Children's/Youth programmes.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH about related sub types. + EPG_EVENT_CONTENTMASK_CHILDRENYOUTH = 0x50, + + /// @brief __0x60__ : Music/Ballet/Dance.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE about related sub types. + EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE = 0x60, + + /// @brief __0x70__ : Arts/Culture (without music).\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE about related sub types. + EPG_EVENT_CONTENTMASK_ARTSCULTURE = 0x70, + + /// @brief __0x80__ : Social/Political issues/Economics.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS about related sub types. + EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS = 0x80, + + /// @brief __0x90__ : Education/Science/Factual topics.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE about related sub types. + EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE = 0x90, + + /// @brief __0xA0__ : Leisure hobbies.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES about related sub types. + EPG_EVENT_CONTENTMASK_LEISUREHOBBIES = 0xA0, + + /// @brief __0xB0__ : Special characteristics.\n + /// \n + /// See @ref EPG_EVENT_CONTENTSUBMASK_SPECIAL about related sub types. + EPG_EVENT_CONTENTMASK_SPECIAL = 0xB0, + + /// @brief __0xF0__ User defined. + EPG_EVENT_CONTENTMASK_USERDEFINED = 0xF0, + + /// @brief Used to override standard genre types with a own name about.\n + /// \n + /// Set to this value @ref EPG_GENRE_USE_STRING on following places: + /// - @ref kodi::addon::PVREPGTag::SetGenreType() + /// - @ref kodi::addon::PVREPGTag::SetGenreSubType() + /// - @ref kodi::addon::PVRRecording::SetGenreType() + /// - @ref kodi::addon::PVRRecording::SetGenreSubType() + /// + /// @warning Value here is not a [ETSI EN 300 468 V1.14.1 (2014-05)](https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.14.01_60/en_300468v011401p.pdf) + /// conform. + /// + /// @note This is a own Kodi definition to set that genre is given by own + /// string. Used on @ref kodi::addon::PVREPGTag::SetGenreDescription() and + /// @ref kodi::addon::PVRRecording::SetGenreDescription() + EPG_GENRE_USE_STRING = 0x100 + } EPG_EVENT_CONTENTMASK; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_MOVIEDRAMA event + /// types for sub type of "Movie/Drama". + /// + ///@{ + typedef enum EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA + { + /// @brief __0x0__ : Movie/drama (general). + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_GENERAL = 0x0, + + /// @brief __0x1__ : Detective/thriller. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_DETECTIVE_THRILLER = 0x1, + + /// @brief __0x2__ : Adventure/western/war. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_ADVENTURE_WESTERN_WAR = 0x2, + + /// @brief __0x3__ : Science fiction/fantasy/horror. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_SCIENCEFICTION_FANTASY_HORROR = 0x3, + + /// @brief __0x4__ : Comedy. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_COMEDY = 0x4, + + /// @brief __0x5__ : Soap/melodrama/folkloric. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_SOAP_MELODRAMA_FOLKLORIC = 0x5, + + /// @brief __0x6__ : Romance. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_ROMANCE = 0x6, + + /// @brief __0x7__ : Serious/classical/religious/historical movie/drama. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_SERIOUS_CLASSICAL_RELIGIOUS_HISTORICAL = 0x7, + + /// @brief __0x8__ : Adult movie/drama. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_ADULT = 0x8, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS event + /// types for sub type of "News/Current affairs". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS + { + /// @brief __0x0__ : News/current affairs (general). + EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS_GENERAL = 0x0, + + /// @brief __0x1__ : News/weather report. + EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS_WEATHER = 0x1, + + /// @brief __0x2__ : News magazine. + EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS_MAGAZINE = 0x2, + + /// @brief __0x3__ : Documentary. + EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS_DOCUMENTARY = 0x3, + + /// @brief __0x4__ : Discussion/interview/debate + EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS_DISCUSSION_INTERVIEW_DEBATE = 0x4, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SHOW event + /// types for sub type of "Show/Game show". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_SHOW + { + /// @brief __0x0__ : Show/game show (general). + EPG_EVENT_CONTENTSUBMASK_SHOW_GENERAL = 0x0, + + /// @brief __0x1__ : Game show/quiz/contest. + EPG_EVENT_CONTENTSUBMASK_SHOW_GAMESHOW_QUIZ_CONTEST = 0x1, + + /// @brief __0x2__ : Variety show. + EPG_EVENT_CONTENTSUBMASK_SHOW_VARIETY_SHOW = 0x2, + + /// @brief __0x3__ : Talk show. + EPG_EVENT_CONTENTSUBMASK_SHOW_TALK_SHOW = 0x3, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_SHOW_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_SHOW; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SPORTS event + /// types for sub type of "Sports". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_SPORTS + { + /// @brief __0x0__ : Sports (general). + EPG_EVENT_CONTENTSUBMASK_SPORTS_GENERAL = 0x0, + + /// @brief __0x1__ : Special events (Olympic Games, World Cup, etc.). + EPG_EVENT_CONTENTSUBMASK_SPORTS_OLYMPICGAMES_WORLDCUP = 0x1, + + /// @brief __0x2__ : Sports magazines. + EPG_EVENT_CONTENTSUBMASK_SPORTS_SPORTS_MAGAZINES = 0x2, + + /// @brief __0x3__ : Football/soccer. + EPG_EVENT_CONTENTSUBMASK_SPORTS_FOOTBALL_SOCCER = 0x3, + + /// @brief __0x4__ : Tennis/squash. + EPG_EVENT_CONTENTSUBMASK_SPORTS_TENNIS_SQUASH = 0x4, + + /// @brief __0x5__ : Team sports (excluding football). + EPG_EVENT_CONTENTSUBMASK_SPORTS_TEAMSPORTS = 0x5, + + /// @brief __0x6__ : Athletics. + EPG_EVENT_CONTENTSUBMASK_SPORTS_ATHLETICS = 0x6, + + /// @brief __0x7__ : Motor sport. + EPG_EVENT_CONTENTSUBMASK_SPORTS_MOTORSPORT = 0x7, + + /// @brief __0x8__ : Water sport. + EPG_EVENT_CONTENTSUBMASK_SPORTS_WATERSPORT = 0x8, + + /// @brief __0x9__ : Winter sports. + EPG_EVENT_CONTENTSUBMASK_SPORTS_WINTERSPORTS = 0x9, + + /// @brief __0xA__ : Equestrian. + EPG_EVENT_CONTENTSUBMASK_SPORTS_EQUESTRIAN = 0xA, + + /// @brief __0xB__ : Martial sports. + EPG_EVENT_CONTENTSUBMASK_SPORTS_MARTIALSPORTS = 0xB, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_SPORTS_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_SPORTS; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_CHILDRENYOUTH event + /// types for sub type of "Children's/Youth programmes". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH + { + /// @brief __0x0__ : Children's/youth programmes (general). + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_GENERAL = 0x0, + + /// @brief __0x1__ : Pre-school children's programmes. + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_PRESCHOOL_CHILDREN = 0x1, + + /// @brief __0x2__ : Entertainment programmes for 6 to 14. + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_ENTERTAIN_6TO14 = 0x2, + + /// @brief __0x3__ : Entertainment programmes for 10 to 16. + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_ENTERTAIN_10TO16 = 0x3, + + /// @brief __0x4__ : Informational/educational/school programmes. + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_INFORMATIONAL_EDUCATIONAL_SCHOOL = 0x4, + + /// @brief __0x5__ : Cartoons/puppets. + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_CARTOONS_PUPPETS = 0x5, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE event + /// types for sub type of "Music/Ballet/Dance". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE + { + /// @brief __0x0__ : Music/ballet/dance (general). + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_GENERAL = 0x0, + + /// @brief __0x1__ : Rock/pop. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_ROCKPOP = 0x1, + + /// @brief __0x2__ : Serious music/classical music. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_SERIOUSMUSIC_CLASSICALMUSIC = 0x2, + + /// @brief __0x3__ : Folk/traditional music. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_FOLK_TRADITIONAL_MUSIC = 0x3, + + /// @brief __0x4__ : Jazz. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_JAZZ = 0x4, + + /// @brief __0x5__ : Musical/opera. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_MUSICAL_OPERA = 0x5, + + /// @brief __0x6__ : Ballet. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_BALLET = 0x6, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_ARTSCULTURE event + /// types for sub type of "Arts/Culture (without music)". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE + { + /// @brief __0x0__ : Arts/culture (without music, general). + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_GENERAL = 0x0, + + /// @brief __0x1__ : Performing arts. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_PERFORMINGARTS = 0x1, + + /// @brief __0x2__ : Fine arts. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_FINEARTS = 0x2, + + /// @brief __0x3__ : Religion. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_RELIGION = 0x3, + + /// @brief __0x4__ : Popular culture/traditional arts. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_POPULARCULTURE_TRADITIONALARTS = 0x4, + + /// @brief __0x5__ : Literature. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_LITERATURE = 0x5, + + /// @brief __0x6__ : Film/cinema. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_FILM_CINEMA = 0x6, + + /// @brief __0x7__ : Experimental film/video. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_EXPERIMENTALFILM_VIDEO = 0x7, + + /// @brief __0x8__ : Broadcasting/press. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_BROADCASTING_PRESS = 0x8, + + /// @brief __0x9__ : New media. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_NEWMEDIA = 0x9, + + /// @brief __0xA__ : Arts/culture magazines. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_ARTS_CULTUREMAGAZINES = 0xA, + + /// @brief __0xB__ : Fashion. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_FASHION = 0xB, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS event + /// types for sub type of "Social/Political issues/Economics". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS + { + /// @brief __0x0__ : Social/political issues/economics (general). + EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS_GENERAL = 0x0, + + /// @brief __0x1__ : Magazines/reports/documentary. + EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS_MAGAZINES_REPORTS_DOCUMENTARY = 0x1, + + /// @brief __0x2__ : Economics/social advisory. + EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS_ECONOMICS_SOCIALADVISORY = 0x2, + + /// @brief __0x3__ : Remarkable people. + EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS_REMARKABLEPEOPLE = 0x3, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE event + /// types for sub type of "Education/Science/Factual topics". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE + { + /// @brief __0x0__ : Education/science/factual topics (general). + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_GENERAL = 0x0, + + /// @brief __0x1__ : Nature/animals/environment. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_NATURE_ANIMALS_ENVIRONMENT = 0x1, + + /// @brief __0x2__ : Technology/natural sciences. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_TECHNOLOGY_NATURALSCIENCES = 0x2, + + /// @brief __0x3__ : Medicine/physiology/psychology. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_MEDICINE_PHYSIOLOGY_PSYCHOLOGY = 0x3, + + /// @brief __0x4__ : Foreign countries/expeditions. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_FOREIGNCOUNTRIES_EXPEDITIONS = 0x4, + + /// @brief __0x5__ : Social/spiritual sciences. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_SOCIAL_SPIRITUALSCIENCES = 0x5, + + /// @brief __0x6__ : Further education. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_FURTHEREDUCATION = 0x6, + + /// @brief __0x7__ : Languages. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_LANGUAGES = 0x7, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_LEISUREHOBBIES event + /// types for sub type of "Leisure hobbies". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES + { + /// @brief __0x0__ : Leisure hobbies (general) . + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_GENERAL = 0x0, + + /// @brief __0x1__ : Tourism/travel. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_TOURISM_TRAVEL = 0x1, + + /// @brief __0x2__ : Handicraft. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_HANDICRAFT = 0x2, + + /// @brief __0x3__ : Motoring. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_MOTORING = 0x3, + + /// @brief __0x4__ : Fitness and health. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_FITNESSANDHEALTH = 0x4, + + /// @brief __0x5__ : Cooking. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_COOKING = 0x5, + + /// @brief __0x6__ : Advertisement/shopping. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_ADVERTISEMENT_SHOPPING = 0x6, + + /// @brief __0x7__ : Gardening. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_GARDENING = 0x7, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT + /// @brief EPG entry sub content to @ref EPG_EVENT_CONTENTMASK_SPECIAL event + /// types for sub type of "Special characteristics". + /// + typedef enum EPG_EVENT_CONTENTSUBMASK_SPECIAL + { + /// @brief __0x0__ : Special characteristics / Original language (general). + EPG_EVENT_CONTENTSUBMASK_SPECIAL_GENERAL = 0x0, + + /// @brief __0x1__ : Black and white. + EPG_EVENT_CONTENTSUBMASK_SPECIAL_BLACKANDWHITE = 0x1, + + /// @brief __0x2__ : Unpublished. + EPG_EVENT_CONTENTSUBMASK_SPECIAL_UNPUBLISHED = 0x2, + + /// @brief __0x3__ : Live broadcast. + EPG_EVENT_CONTENTSUBMASK_SPECIAL_LIVEBROADCAST = 0x3, + + /// @brief __0x4__ : Plano-stereoscopic. + EPG_EVENT_CONTENTSUBMASK_SPECIAL_PLANOSTEREOSCOPIC = 0x4, + + /// @brief __0x5__ : Local or regional. + EPG_EVENT_CONTENTSUBMASK_SPECIAL_LOCALORREGIONAL = 0x5, + + /// @brief __0xF__ : User defined. + EPG_EVENT_CONTENTSUBMASK_SPECIAL_USERDEFINED = 0xF + } EPG_EVENT_CONTENTSUBMASK_SPECIAL; + //---------------------------------------------------------------------------- + + ///@} + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief Separator to use in strings containing different tokens, for example + /// writers, directors, actors of an event. + /// + #define EPG_STRING_TOKEN_SEPARATOR "," + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_epg_EPG_TAG_FLAG enum EPG_TAG_FLAG + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief Bit field of independent flags associated with the EPG entry.\n + /// Values used by @ref kodi::addon::PVREPGTag::SetFlags(). + /// + /// Here's example about the use of this: + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::addon::PVREPGTag tag; + /// tag.SetFlags(EPG_TAG_FLAG_IS_SERIES | EPG_TAG_FLAG_IS_NEW); + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum EPG_TAG_FLAG + { + /// @brief __0000 0000__ : Nothing special to say about this entry. + EPG_TAG_FLAG_UNDEFINED = 0, + + /// @brief __0000 0001__ : This EPG entry is part of a series. + EPG_TAG_FLAG_IS_SERIES = (1 << 0), + + /// @brief __0000 0010__ : This EPG entry will be flagged as new. + EPG_TAG_FLAG_IS_NEW = (1 << 1), + + /// @brief __0000 0100__ : This EPG entry will be flagged as a premiere. + EPG_TAG_FLAG_IS_PREMIERE = (1 << 2), + + /// @brief __0000 1000__ : This EPG entry will be flagged as a finale. + EPG_TAG_FLAG_IS_FINALE = (1 << 3), + + /// @brief __0001 0000__ : This EPG entry will be flagged as live. + EPG_TAG_FLAG_IS_LIVE = (1 << 4), + } EPG_TAG_FLAG; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief Special PVREPGTag::SetUniqueBroadcastId value + /// + /// Special @ref kodi::addon::PVREPGTag::SetUniqueBroadcastId() value to + /// indicate that a tag has not a valid EPG event uid. + /// + #define EPG_TAG_INVALID_UID 0 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief Special @ref kodi::addon::PVREPGTag::SetSeriesNumber(), @ref kodi::addon::PVREPGTag::SetEpisodeNumber() + /// and @ref kodi::addon::PVREPGTag::SetEpisodePartNumber() value to indicate + /// it is not to be used. + /// + #define EPG_TAG_INVALID_SERIES_EPISODE -1 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief Timeframe value for use with @ref kodi::addon::CInstancePVRClient::SetEPGTimeFrame() + /// function to indicate "no timeframe". + /// + #define EPG_TIMEFRAME_UNLIMITED -1 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_epg_EPG_EVENT_STATE enum EPG_EVENT_STATE + /// @ingroup cpp_kodi_addon_pvr_Defs_epg + /// @brief **EPG event states.**\n + /// Used with @ref kodi::addon::CInstancePVRClient::EpgEventStateChange() + /// callback. + /// + ///@{ + typedef enum EPG_EVENT_STATE + { + /// @brief __0__ : Event created. + EPG_EVENT_CREATED = 0, + + /// @brief __1__ : Event updated. + EPG_EVENT_UPDATED = 1, + + /// @brief __2__ : Event deleted. + EPG_EVENT_DELETED = 2, + } EPG_EVENT_STATE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on channel group member. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVREPGTag for description of values. + */ + typedef struct EPG_TAG + { + unsigned int iUniqueBroadcastId; + unsigned int iUniqueChannelId; + const char* strTitle; + time_t startTime; + time_t endTime; + const char* strPlotOutline; + const char* strPlot; + const char* strOriginalTitle; + const char* strCast; + const char* strDirector; + const char* strWriter; + int iYear; + const char* strIMDBNumber; + const char* strIconPath; + int iGenreType; + int iGenreSubType; + const char* strGenreDescription; + const char* strFirstAired; + int iParentalRating; + int iStarRating; + int iSeriesNumber; + int iEpisodeNumber; + int iEpisodePartNumber; + const char* strEpisodeName; + unsigned int iFlags; + const char* strSeriesLink; + } EPG_TAG; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h new file mode 100644 index 0000000..52787b0 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h @@ -0,0 +1,288 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#ifdef BUILD_KODI_ADDON +#include "../../../InputStreamConstants.h" +#else +#include "cores/VideoPlayer/Interface/Addon/InputStreamConstants.h" +#endif + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 1 - General PVR +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_General_PVR_ERROR enum PVR_ERROR + /// @ingroup cpp_kodi_addon_pvr_Defs_General + /// @brief **PVR add-on error codes**\n + /// Used as return values on most PVR related functions. + /// + /// In this way, a PVR instance signals errors in its processing and, under + /// certain conditions, allows Kodi to make corrections. + /// + ///@{ + typedef enum PVR_ERROR + { + /// @brief __0__ : No error occurred. + PVR_ERROR_NO_ERROR = 0, + + /// @brief __-1__ : An unknown error occurred. + PVR_ERROR_UNKNOWN = -1, + + /// @brief __-2__ : The method that Kodi called is not implemented by the add-on. + PVR_ERROR_NOT_IMPLEMENTED = -2, + + /// @brief __-3__ : The backend reported an error, or the add-on isn't connected. + PVR_ERROR_SERVER_ERROR = -3, + + /// @brief __-4__ : The command was sent to the backend, but the response timed out. + PVR_ERROR_SERVER_TIMEOUT = -4, + + /// @brief __-5__ : The command was rejected by the backend. + PVR_ERROR_REJECTED = -5, + + /// @brief __-6__ : The requested item can not be added, because it's already present. + PVR_ERROR_ALREADY_PRESENT = -6, + + /// @brief __-7__ : The parameters of the method that was called are invalid for this + /// operation. + PVR_ERROR_INVALID_PARAMETERS = -7, + + /// @brief __-8__ : A recording is running, so the timer can't be deleted without + /// doing a forced delete. + PVR_ERROR_RECORDING_RUNNING = -8, + + /// @brief __-9__ : The command failed. + PVR_ERROR_FAILED = -9, + } PVR_ERROR; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_General_PVR_CONNECTION_STATE enum PVR_CONNECTION_STATE + /// @ingroup cpp_kodi_addon_pvr_Defs_General + /// @brief **PVR backend connection states**\n + /// Used with @ref kodi::addon::CInstancePVRClient::ConnectionStateChange() callback. + /// + /// With this, a PVR instance signals that Kodi should perform special + /// operations. + /// + ///@{ + typedef enum PVR_CONNECTION_STATE + { + /// @brief __0__ : Unknown state (e.g. not yet tried to connect). + PVR_CONNECTION_STATE_UNKNOWN = 0, + + /// @brief __1__ : Backend server is not reachable (e.g. server not existing or + /// network down). + PVR_CONNECTION_STATE_SERVER_UNREACHABLE = 1, + + /// @brief __2__ : 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). + PVR_CONNECTION_STATE_SERVER_MISMATCH = 2, + + /// @brief __3__ : Backend server is reachable, but server version does not match + /// client requirements. + PVR_CONNECTION_STATE_VERSION_MISMATCH = 3, + + /// @brief __4__ : Backend server is reachable, but denies client access (e.g. due + /// to wrong credentials). + PVR_CONNECTION_STATE_ACCESS_DENIED = 4, + + /// @brief __5__ : Connection to backend server is established. + PVR_CONNECTION_STATE_CONNECTED = 5, + + /// @brief __6__ : No connection to backend server (e.g. due to network errors or + /// client initiated disconnect). + PVR_CONNECTION_STATE_DISCONNECTED = 6, + + /// @brief __7__ : Connecting to backend. + PVR_CONNECTION_STATE_CONNECTING = 7, + } PVR_CONNECTION_STATE; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_General_PVR_STREAM_PROPERTY definition PVR_STREAM_PROPERTY + /// @ingroup cpp_kodi_addon_pvr_Defs_General_Inputstream + /// @brief **PVR related stream property values**\n + /// This is used to pass additional data to Kodi on a given PVR stream. + /// + /// Then transferred to livestream, recordings or EPG Tag stream using the + /// properties. + /// + /// This defines are used by: + /// - @ref kodi::addon::CInstancePVRClient::GetChannelStreamProperties() + /// - @ref kodi::addon::CInstancePVRClient::GetEPGTagStreamProperties() + /// - @ref kodi::addon::CInstancePVRClient::GetRecordingStreamProperties() + /// + /// + ///--------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// ... + /// + /// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, + /// std::vector& properties) + /// { + /// ... + /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive"); + /// properties.emplace_back("inputstream.adaptive.manifest_type", "mpd"); + /// properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full"); + /// properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/xml+dash"); + /// return PVR_ERROR_NO_ERROR; + /// } + /// + /// ... + /// ~~~~~~~~~~~~~ + /// + ///@{ + + /// @brief the URL of the stream that should be played. + /// + #define PVR_STREAM_PROPERTY_STREAMURL "streamurl" + + /// @brief To define in stream properties the name of the inputstream add-on + /// that should be used. + /// + /// Leave blank to use Kodi's built-in playing capabilities or to allow ffmpeg + /// to handle directly set to @ref PVR_STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG. + /// + #define PVR_STREAM_PROPERTY_INPUTSTREAM STREAM_PROPERTY_INPUTSTREAM + + /// @brief Identification string for an input stream. + /// + /// This value can be used in addition to @ref PVR_STREAM_PROPERTY_INPUTSTREAM. + /// It is used to provide the respective inpustream addon with additional + /// identification. + /// + /// The difference between this and other stream properties is that it is also + /// passed in the associated @ref kodi::addon::CAddonBase::CreateInstance() + /// call. + /// + /// This makes it possible to select different processing classes within the + /// associated add-on. + /// + /// + ///--------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// ... + /// + /// // On PVR instance of addon + /// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, + /// std::vector& properties) + /// { + /// ... + /// // For here on example the inpustream is also inside the PVR addon + /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "pvr.my_one"); + /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID, "my_special_id_1"); + /// return PVR_ERROR_NO_ERROR; + /// } + /// + /// ... + /// + /// // On CAddonBase part of addon + /// ADDON_STATUS CMyAddon::CreateInstanceEx(int instanceType, + /// std::string instanceID, + /// KODI_HANDLE instance, + /// KODI_HANDLE& addonInstance + /// const std::string& version) + /// { + /// if (instanceType == ADDON_INSTANCE_INPUTSTREAM) + /// { + /// kodi::Log(ADDON_LOG_NOTICE, "Creating my special inputstream"); + /// if (instanceID == "my_special_id_1") + /// addonInstance = new CMyPVRClientInstance_Type1(instance, version); + /// else if (instanceID == "my_special_id_2") + /// addonInstance = new CMyPVRClientInstance_Type2(instance, version); + /// return ADDON_STATUS_OK; + /// } + /// else if (...) + /// { + /// ... + /// } + /// return ADDON_STATUS_UNKNOWN; + /// } + /// + /// ... + /// ~~~~~~~~~~~~~ + /// + #define PVR_STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID + + /// @brief the MIME type of the stream that should be played. + /// + #define PVR_STREAM_PROPERTY_MIMETYPE "mimetype" + + /// @brief "true" to denote that the stream that should be played is a + /// realtime stream. + /// + /// Any other value indicates that this is no realtime stream. + /// + #define PVR_STREAM_PROPERTY_ISREALTIMESTREAM STREAM_PROPERTY_ISREALTIMESTREAM + + /// @brief "true" to denote that if the stream is from an EPG tag. + /// + /// It should be played is a live stream. Otherwise if it's a EPG tag it will + /// play as normal video. + /// + #define PVR_STREAM_PROPERTY_EPGPLAYBACKASLIVE "epgplaybackaslive" + + /// @brief Special value for @ref PVR_STREAM_PROPERTY_INPUTSTREAM to use + /// ffmpeg to directly play a stream URL. + #define PVR_STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG + + ///@} + //----------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on capabilities. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRCapabilities for description of values. + */ + typedef struct PVR_ADDON_CAPABILITIES + { + bool bSupportsEPG; + bool bSupportsEPGEdl; + bool bSupportsTV; + bool bSupportsRadio; + bool bSupportsRecordings; + bool bSupportsRecordingsUndelete; + bool bSupportsTimers; + bool bSupportsChannelGroups; + bool bSupportsChannelScan; + bool bSupportsChannelSettings; + bool bHandlesInputStream; + bool bHandlesDemuxing; + bool bSupportsRecordingPlayCount; + bool bSupportsLastPlayedPosition; + bool bSupportsRecordingEdl; + bool bSupportsRecordingsRename; + bool bSupportsRecordingsLifetimeChange; + bool bSupportsDescrambleInfo; + bool bSupportsAsyncEPGTransfer; + bool bSupportsRecordingSize; + + unsigned int iRecordingsLifetimesSize; + struct PVR_ATTRIBUTE_INT_VALUE recordingsLifetimeValues[PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE]; + } PVR_ADDON_CAPABILITIES; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h new file mode 100644 index 0000000..df2216f --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 7 - Menu hook +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Menuhook_PVR_MENUHOOK_CAT enum PVR_MENUHOOK_CAT + /// @ingroup cpp_kodi_addon_pvr_Defs_Menuhook + /// @brief **PVR context menu hook categories**\n + /// Possible menu types given to Kodi with @ref kodi::addon::CInstancePVRClient::AddMenuHook(). + /// + ///@{ + typedef enum PVR_MENUHOOK_CAT + { + /// @brief __-1__ : Unknown menu hook. + PVR_MENUHOOK_UNKNOWN = -1, + + /// @brief __0__ : All categories. + PVR_MENUHOOK_ALL = 0, + + /// @brief __1__ : For channels. + PVR_MENUHOOK_CHANNEL = 1, + + /// @brief __2__ : For timers. + PVR_MENUHOOK_TIMER = 2, + + /// @brief __3__ : For EPG. + PVR_MENUHOOK_EPG = 3, + + /// @brief __4__ : For recordings. + PVR_MENUHOOK_RECORDING = 4, + + /// @brief __5__ : For deleted recordings. + PVR_MENUHOOK_DELETED_RECORDING = 5, + + /// @brief __6__ : For settings. + PVR_MENUHOOK_SETTING = 6, + } PVR_MENUHOOK_CAT; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on menu hook. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRMenuhook for description of values. + */ + typedef struct PVR_MENUHOOK + { + unsigned int iHookId; + unsigned int iLocalizedStringId; + enum PVR_MENUHOOK_CAT category; + } PVR_MENUHOOK; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h new file mode 100644 index 0000000..1a7fc66 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#include +#include +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 5 - PVR recordings +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Recording_PVR_RECORDING_FLAG enum PVR_RECORDING_FLAG + /// @ingroup cpp_kodi_addon_pvr_Defs_Recording + /// @brief **Bit field of independent flags associated with the EPG entry.**\n + /// Values used by @ref kodi::addon::PVRRecording::SetFlags(). + /// + /// Here's example about the use of this: + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::addon::PVRRecording tag; + /// tag.SetFlags(PVR_RECORDING_FLAG_IS_SERIES | PVR_RECORDING_FLAG_IS_PREMIERE); + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum PVR_RECORDING_FLAG + { + /// @brief __0000 0000__ : Nothing special to say about this recording. + PVR_RECORDING_FLAG_UNDEFINED = 0, + + /// @brief __0000 0001__ : This recording is part of a series. + PVR_RECORDING_FLAG_IS_SERIES = (1 << 0), + + /// @brief __0000 0010__ : This recording will be flagged as new. + PVR_RECORDING_FLAG_IS_NEW = (1 << 1), + + /// @brief __0000 0100__ : This recording will be flagged as a premiere. + PVR_RECORDING_FLAG_IS_PREMIERE = (1 << 2), + + /// @brief __0000 1000__ : This recording will be flagged as a finale. + PVR_RECORDING_FLAG_IS_FINALE = (1 << 3), + + /// @brief __0001 0000__ : This recording will be flagged as live. + PVR_RECORDING_FLAG_IS_LIVE = (1 << 4), + } PVR_RECORDING_FLAG; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Recording_PVRRecording + /// @brief Special @ref kodi::addon::PVRRecording::SetSeriesNumber() and + /// @ref kodi::addon::PVRRecording::SetEpisodeNumber() value to indicate it is + /// not to be used. + /// + /// Used if recording has no valid season and/or episode info. + /// + #define PVR_RECORDING_INVALID_SERIES_EPISODE EPG_TAG_INVALID_SERIES_EPISODE + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Recording_PVRRecording + /// @brief Value where set in background to inform that related part not used. + /// + /// Normally this related parts need not to set by this as it is default. + #define PVR_RECORDING_VALUE_NOT_AVAILABLE -1 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Recording_PVR_RECORDING_CHANNEL_TYPE enum PVR_RECORDING_CHANNEL_TYPE + /// @ingroup cpp_kodi_addon_pvr_Defs_Recording + /// @brief **PVR recording channel types**\n + /// Used on @ref kodi::addon::PVRRecording::SetChannelType() value to set related + /// type. + /// + ///@{ + typedef enum PVR_RECORDING_CHANNEL_TYPE + { + /// @brief __0__ : Unknown type. + PVR_RECORDING_CHANNEL_TYPE_UNKNOWN = 0, + + /// @brief __1__ : TV channel. + PVR_RECORDING_CHANNEL_TYPE_TV = 1, + + /// @brief __2__ : Radio channel. + PVR_RECORDING_CHANNEL_TYPE_RADIO = 2, + } PVR_RECORDING_CHANNEL_TYPE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on recording. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref kodi::addon::PVRRecording for description of values. + */ + typedef struct PVR_RECORDING + { + char strRecordingId[PVR_ADDON_NAME_STRING_LENGTH]; + char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; + char strEpisodeName[PVR_ADDON_NAME_STRING_LENGTH]; + int iSeriesNumber; + int iEpisodeNumber; + int iYear; + char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; + char strPlotOutline[PVR_ADDON_DESC_STRING_LENGTH]; + char strPlot[PVR_ADDON_DESC_STRING_LENGTH]; + char strGenreDescription[PVR_ADDON_DESC_STRING_LENGTH]; + char strChannelName[PVR_ADDON_NAME_STRING_LENGTH]; + char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; + char strThumbnailPath[PVR_ADDON_URL_STRING_LENGTH]; + char strFanartPath[PVR_ADDON_URL_STRING_LENGTH]; + time_t recordingTime; + int iDuration; + int iPriority; + int iLifetime; + int iGenreType; + int iGenreSubType; + int iPlayCount; + int iLastPlayedPosition; + bool bIsDeleted; + unsigned int iEpgEventId; + int iChannelUid; + enum PVR_RECORDING_CHANNEL_TYPE channelType; + char strFirstAired[PVR_ADDON_DATE_STRING_LENGTH]; + unsigned int iFlags; + int64_t sizeInBytes; + } PVR_RECORDING; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h new file mode 100644 index 0000000..04b4059 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#ifdef BUILD_KODI_ADDON +#include "../../../DemuxPacket.h" +#else +#include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" +#endif + +#include +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 9 - PVR stream definitions (NOTE: Becomes replaced +// in future by inputstream addon instance way) +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Stream + /// @brief Maximum of allowed streams + /// + #define PVR_STREAM_MAX_STREAMS 20 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Stream + /// @brief Invalid codec identifier + /// + #define PVR_INVALID_CODEC_ID 0 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_pvr_Defs_Stream + /// @brief Invalid codec + /// + #define PVR_INVALID_CODEC \ + { \ + PVR_CODEC_TYPE_UNKNOWN, PVR_INVALID_CODEC_ID \ + } + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVR_CODEC_TYPE enum PVR_CODEC_TYPE + /// @ingroup cpp_kodi_addon_pvr_Defs_Stream + /// @brief **Inputstream types**\n + /// To identify type on stream. + /// + /// Used on @ref kodi::addon::PVRStreamProperties::SetCodecType and @ref kodi::addon::PVRStreamProperties::SetCodecType. + /// + ///@{ + typedef enum PVR_CODEC_TYPE + { + /// @brief To set nothing defined. + PVR_CODEC_TYPE_UNKNOWN = -1, + + /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Video. + PVR_CODEC_TYPE_VIDEO, + + /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Audio. + PVR_CODEC_TYPE_AUDIO, + + /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Data. + /// + /// With codec id related source identified. + PVR_CODEC_TYPE_DATA, + + /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Subtitle. + PVR_CODEC_TYPE_SUBTITLE, + + /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Radio RDS. + PVR_CODEC_TYPE_RDS, + + PVR_CODEC_TYPE_NB + } PVR_CODEC_TYPE; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVR_CODEC struct PVR_CODEC + /// @ingroup cpp_kodi_addon_pvr_Defs_Stream + /// @brief **Codec identification structure**\n + /// Identifier about stream between Kodi and addon. + /// + ///@{ + typedef struct PVR_CODEC + { + /// @brief Used codec type for stream. + enum PVR_CODEC_TYPE codec_type; + + /// @brief Related codec identifier, normally match the ffmpeg id's. + unsigned int codec_id; + } PVR_CODEC; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief "C" Stream properties + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties for description of values. + */ + typedef struct PVR_STREAM_PROPERTIES + { + unsigned int iStreamCount; + struct PVR_STREAM + { + unsigned int iPID; + enum PVR_CODEC_TYPE iCodecType; + unsigned int iCodecId; + char strLanguage[4]; + int iSubtitleInfo; + int iFPSScale; + int iFPSRate; + int iHeight; + int iWidth; + float fAspect; + int iChannels; + int iSampleRate; + int iBlockAlign; + int iBitRate; + int iBitsPerSample; + } stream[PVR_STREAM_MAX_STREAMS]; + } PVR_STREAM_PROPERTIES; + + /*! + * @brief "C" Times of playing stream (Live TV and recordings) + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes for description of values. + */ + typedef struct PVR_STREAM_TIMES + { + time_t startTime; + int64_t ptsStart; + int64_t ptsBegin; + int64_t ptsEnd; + } PVR_STREAM_TIMES; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h new file mode 100644 index 0000000..bc16adb --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h @@ -0,0 +1,407 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "pvr_defines.h" + +#include +#include +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "C" Definitions group 6 - PVR timers +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_TIMER_ definition PVR_TIMER (various) + /// @ingroup cpp_kodi_addon_pvr_Defs_Timer + /// @brief **PVR timer various different definitions**\n + /// This mostly used on @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer "kodi::addon::PVRTimer" + /// to define default or not available. + /// + ///@{ + + //============================================================================ + /// @brief Numeric PVR timer type definitions (@ref kodi::addon::PVRTimer::SetTimerType() + /// values). + /// + /// "Null" value for a numeric timer type. + #define PVR_TIMER_TYPE_NONE 0 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Special @ref kodi::addon::PVRTimer::SetClientIndex() value to indicate + /// that a timer has not (yet) a valid client index. + /// + /// Timer has not (yet) a valid client index. + #define PVR_TIMER_NO_CLIENT_INDEX 0 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Special @ref kodi::addon::PVRTimer::SetParentClientIndex() value to + /// indicate that a timer has no parent. + /// + /// Timer has no parent; it was not scheduled by a repeating timer. + #define PVR_TIMER_NO_PARENT PVR_TIMER_NO_CLIENT_INDEX + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Special @ref kodi::addon::PVRTimer::SetEPGUid() value to indicate + /// that a timer has no EPG event uid. + /// + /// Timer has no EPG event unique identifier. + #define PVR_TIMER_NO_EPG_UID EPG_TAG_INVALID_UID + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Special @ref kodi::addon::PVRTimer::SetClientChannelUid() value to + /// indicate "any channel". Useful for some repeating timer types. + /// + /// denotes "any channel", not a specific one. + /// + #define PVR_TIMER_ANY_CHANNEL -1 + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Value where set in background to inform that related part not used. + /// + /// Normally this related parts need not to set by this as it is default. + #define PVR_TIMER_VALUE_NOT_AVAILABLE -1 + //---------------------------------------------------------------------------- + + ///@} + //---------------------------------------------------------------------------- + + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_TIMER_TYPES enum PVR_TIMER_TYPES + /// @ingroup cpp_kodi_addon_pvr_Defs_Timer + /// @brief **PVR timer type attributes (@ref kodi::addon::PVRTimerType::SetAttributes() values).**\n + /// To defines the attributes for a type. These values are bit fields that can be + /// used together. + /// + ///-------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::addon::PVRTimerType tag; + /// tag.SetAttributes(PVR_TIMER_TYPE_IS_MANUAL | PVR_TIMER_TYPE_IS_REPEATING); + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum PVR_TIMER_TYPES + { + /// @brief __0000 0000 0000 0000 0000 0000 0000 0000__ :\n Empty attribute value. + PVR_TIMER_TYPE_ATTRIBUTE_NONE = 0, + + /// @brief __0000 0000 0000 0000 0000 0000 0000 0001__ :\n Defines whether this is a type for + /// manual (time-based) or epg-based timers. + PVR_TIMER_TYPE_IS_MANUAL = (1 << 0), + + /// @brief __0000 0000 0000 0000 0000 0000 0000 0010__ :\n Defines whether this is a type for + /// repeating or one-shot timers. + PVR_TIMER_TYPE_IS_REPEATING = (1 << 1), + + /// @brief __0000 0000 0000 0000 0000 0000 0000 0100__ :\n Timers of this type must not be edited + /// by Kodi. + PVR_TIMER_TYPE_IS_READONLY = (1 << 2), + + /// @brief __0000 0000 0000 0000 0000 0000 0000 1000__ :\n Timers of this type must not be created + /// by Kodi. All other operations are allowed, though. + PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES = (1 << 3), + + /// @brief __0000 0000 0000 0000 0000 0000 0001 0000__ :\n This type supports enabling/disabling + /// of the timer (@ref kodi::addon::PVRTimer::SetState() with + /// @ref PVR_TIMER_STATE_SCHEDULED | @ref PVR_TIMER_STATE_DISABLED). + PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE = (1 << 4), + + /// @brief __0000 0000 0000 0000 0000 0000 0010 0000__ :\n This type supports channels + /// (@ref kodi::addon::PVRTimer::SetClientChannelUid()). + PVR_TIMER_TYPE_SUPPORTS_CHANNELS = (1 << 5), + + /// @brief __0000 0000 0000 0000 0000 0000 0100 0000__ :\n This type supports a recording start + /// time (@ref kodi::addon::PVRTimer::SetStartTime()). + PVR_TIMER_TYPE_SUPPORTS_START_TIME = (1 << 6), + + /// @brief __0000 0000 0000 0000 0000 0000 1000 0000__ :\n This type supports matching epg episode + /// title using@ref kodi::addon::PVRTimer::SetEPGSearchString(). + PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH = (1 << 7), + + /// @brief __0000 0000 0000 0000 0000 0001 0000 0000__ :\n This type supports matching "more" epg + /// data (not just episode title) using @ref kodi::addon::PVRTimer::SetEPGSearchString(). + /// Setting @ref PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH implies + /// @ref PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH. + PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH = (1 << 8), + + /// @brief __0000 0000 0000 0000 0000 0010 0000 0000__ :\n This type supports a first day the + /// timer gets active (@ref kodi::addon::PVRTimer::SetFirstDay()). + PVR_TIMER_TYPE_SUPPORTS_FIRST_DAY = (1 << 9), + + /// @brief __0000 0000 0000 0000 0000 0100 0000 0000__ :\n This type supports weekdays for + /// defining the recording schedule (@ref kodi::addon::PVRTimer::SetWeekdays()). + PVR_TIMER_TYPE_SUPPORTS_WEEKDAYS = (1 << 10), + + /// @brief __0000 0000 0000 0000 0000 1000 0000 0000__ :\n This type supports the "record only new episodes" feature + /// (@ref kodi::addon::PVRTimer::SetPreventDuplicateEpisodes()). + PVR_TIMER_TYPE_SUPPORTS_RECORD_ONLY_NEW_EPISODES = (1 << 11), + + /// @brief __0000 0000 0000 0000 0001 0000 0000 0000__ :\n This type supports pre and post record time (@ref kodi::addon::PVRTimer::SetMarginStart(), + /// @ref kodi::addon::PVRTimer::SetMarginEnd()). + PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN = (1 << 12), + + /// @brief __0000 0000 0000 0000 0010 0000 0000 0000__ :\n This type supports recording priority (@ref kodi::addon::PVRTimer::SetPriority()). + PVR_TIMER_TYPE_SUPPORTS_PRIORITY = (1 << 13), + + /// @brief __0000 0000 0000 0000 0100 0000 0000 0000__ :\n This type supports recording lifetime (@ref kodi::addon::PVRTimer::SetLifetime()). + PVR_TIMER_TYPE_SUPPORTS_LIFETIME = (1 << 14), + + /// @brief __0000 0000 0000 0000 1000 0000 0000 0000__ :\n This type supports placing recordings in user defined folders + /// (@ref kodi::addon::PVRTimer::SetDirectory()). + PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS = (1 << 15), + + /// @brief __0000 0000 0000 0001 0000 0000 0000 0000__ :\n This type supports a list of recording groups + /// (@ref kodi::addon::PVRTimer::SetRecordingGroup()). + PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP = (1 << 16), + + /// @brief __0000 0000 0000 0010 0000 0000 0000 0000__ :\n This type supports a recording end time (@ref kodi::addon::PVRTimer::SetEndTime()). + PVR_TIMER_TYPE_SUPPORTS_END_TIME = (1 << 17), + + /// @brief __0000 0000 0000 0100 0000 0000 0000 0000__ :\n Enables an 'Any Time' over-ride option for start time + /// (using @ref kodi::addon::PVRTimer::SetStartAnyTime()). + PVR_TIMER_TYPE_SUPPORTS_START_ANYTIME = (1 << 18), + + /// @brief __0000 0000 0000 1000 0000 0000 0000 0000__ :\n Enables a separate 'Any Time' over-ride for end time + /// (using @ref kodi::addon::PVRTimer::SetEndAnyTime()). + PVR_TIMER_TYPE_SUPPORTS_END_ANYTIME = (1 << 19), + + /// @brief __0000 0000 0001 0000 0000 0000 0000 0000__ :\n This type supports specifying a maximum recordings setting' + /// (@ref kodi::addon::PVRTimer::SetMaxRecordings()). + PVR_TIMER_TYPE_SUPPORTS_MAX_RECORDINGS = (1 << 20), + + /// @brief __0000 0000 0010 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus which don't + /// provide an associated @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag". + PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE = (1 << 21), + + /// @brief __0000 0000 0100 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus which provide an + /// associated @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag". + PVR_TIMER_TYPE_FORBIDS_EPG_TAG_ON_CREATE = (1 << 22), + + /// @brief __0000 0000 1000 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus unless associated + /// with an @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag" with + /// 'series' attributes. + /// + /// Following conditions allow this: + /// - @ref kodi::addon::PVREPGTag::SetFlags() have flag @ref EPG_TAG_FLAG_IS_SERIES + /// - @ref kodi::addon::PVREPGTag::SetSeriesNumber() > 0 + /// - @ref kodi::addon::PVREPGTag::SetEpisodeNumber() > 0 + /// - @ref kodi::addon::PVREPGTag::SetEpisodePartNumber() > 0 + /// + /// Implies @ref PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE. + PVR_TIMER_TYPE_REQUIRES_EPG_SERIES_ON_CREATE = (1 << 23), + + /// @brief __0000 0001 0000 0000 0000 0000 0000 0000__ :\n This type supports 'any channel', for example when defining a timer + /// rule that should match any channel instaed of a particular channel. + PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = (1 << 24), + + /// @brief __0000 0010 0000 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus which don't provide + /// an associated @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag" with + /// a series link. + PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = (1 << 25), + + /// @brief __0000 0100 0000 0000 0000 0000 0000 0000__ :\n This type allows deletion of an otherwise read-only timer. + PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = (1 << 26), + + /// @brief __0000 1000 0000 0000 0000 0000 0000 0000__ :\n Timers of this type do trigger a reminder if time is up. + PVR_TIMER_TYPE_IS_REMINDER = (1 << 27), + + /// @brief __0001 0000 0000 0000 0000 0000 0000 0000__ :\n This type supports pre record time (@ref kodi::addon::PVRTimer::SetMarginStart()). + PVR_TIMER_TYPE_SUPPORTS_START_MARGIN = (1 << 28), + + /// @brief __0010 0000 0000 0000 0000 0000 0000 0000__ :\n This type supports post record time (@ref kodi::addon::PVRTimer::SetMarginEnd()). + PVR_TIMER_TYPE_SUPPORTS_END_MARGIN = (1 << 29), + } PVR_TIMER_TYPES; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_WEEKDAY enum PVR_WEEKDAY + /// @ingroup cpp_kodi_addon_pvr_Defs_Timer + /// @brief **PVR timer weekdays** (@ref kodi::addon::PVRTimer::SetWeekdays() **values**)\n + /// Used to select the days of a week you want. + /// + /// It can be also used to select several days e.g.: + /// ~~~~~~~~~~~~~{.cpp} + /// ... + /// unsigned int day = PVR_WEEKDAY_MONDAY | PVR_WEEKDAY_SATURDAY; + /// ... + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum PVR_WEEKDAYS + { + /// @brief __0000 0000__ : Nothing selected. + PVR_WEEKDAY_NONE = 0, + + /// @brief __0000 0001__ : To select Monday. + PVR_WEEKDAY_MONDAY = (1 << 0), + + /// @brief __0000 0010__ : To select Tuesday. + PVR_WEEKDAY_TUESDAY = (1 << 1), + + /// @brief __0000 0100__ : To select Wednesday. + PVR_WEEKDAY_WEDNESDAY = (1 << 2), + + /// @brief __0000 1000__ : To select Thursday. + PVR_WEEKDAY_THURSDAY = (1 << 3), + + /// @brief __0001 0000__ : To select Friday. + PVR_WEEKDAY_FRIDAY = (1 << 4), + + /// @brief __0010 0000__ : To select Saturday. + PVR_WEEKDAY_SATURDAY = (1 << 5), + + /// @brief __0100 0000__ : To select Sunday. + PVR_WEEKDAY_SUNDAY = (1 << 6), + + /// @brief __0111 1111__ : To select all days of week. + PVR_WEEKDAY_ALLDAYS = PVR_WEEKDAY_MONDAY | PVR_WEEKDAY_TUESDAY | PVR_WEEKDAY_WEDNESDAY | + PVR_WEEKDAY_THURSDAY | PVR_WEEKDAY_FRIDAY | PVR_WEEKDAY_SATURDAY | + PVR_WEEKDAY_SUNDAY + } PVR_WEEKDAY; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_TIMER_STATE enum PVR_TIMER_STATE + /// @ingroup cpp_kodi_addon_pvr_Defs_Timer + /// @brief **PVR timer states**\n + /// To set within @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer "kodi::addon::PVRTimer" + /// the needed state about. + /// + ///@{ + typedef enum PVR_TIMER_STATE + { + /// @brief __0__ : 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. + PVR_TIMER_STATE_NEW = 0, + + /// @brief __1__ : The timer is scheduled for recording. + PVR_TIMER_STATE_SCHEDULED = 1, + + /// @brief __2__ : The timer is currently recordings. + PVR_TIMER_STATE_RECORDING = 2, + + /// @brief __3__ : The recording completed successfully. + PVR_TIMER_STATE_COMPLETED = 3, + + /// @brief __4__ : Recording started, but was aborted. + PVR_TIMER_STATE_ABORTED = 4, + + /// @brief __5__ : The timer was scheduled, but was canceled. + PVR_TIMER_STATE_CANCELLED = 5, + + /// @brief __6__ : The scheduled timer conflicts with another one, but will be + /// recorded. + PVR_TIMER_STATE_CONFLICT_OK = 6, + + /// @brief __7__ : The scheduled timer conflicts with another one and won't be + /// recorded. + PVR_TIMER_STATE_CONFLICT_NOK = 7, + + /// @brief __8__ : The timer is scheduled, but can't be recorded for some reason. + PVR_TIMER_STATE_ERROR = 8, + + /// @brief __9__ : The timer was disabled by the user, can be enabled via setting + /// the state to @ref PVR_TIMER_STATE_SCHEDULED. + PVR_TIMER_STATE_DISABLED = 9, + } PVR_TIMER_STATE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief "C" PVR add-on timer event. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer "kodi::addon::PVRTimer" for + * description of values. + */ + typedef struct PVR_TIMER + { + unsigned int iClientIndex; + unsigned int iParentClientIndex; + int iClientChannelUid; + time_t startTime; + time_t endTime; + bool bStartAnyTime; + bool bEndAnyTime; + enum PVR_TIMER_STATE state; + unsigned int iTimerType; + char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; + char strEpgSearchString[PVR_ADDON_NAME_STRING_LENGTH]; + bool bFullTextEpgSearch; + char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; + char strSummary[PVR_ADDON_DESC_STRING_LENGTH]; + int iPriority; + int iLifetime; + int iMaxRecordings; + unsigned int iRecordingGroup; + time_t firstDay; + unsigned int iWeekdays; + unsigned int iPreventDuplicateEpisodes; + unsigned int iEpgUid; + unsigned int iMarginStart; + unsigned int iMarginEnd; + int iGenreType; + int iGenreSubType; + char strSeriesLink[PVR_ADDON_URL_STRING_LENGTH]; + } PVR_TIMER; + + /*! + * @brief "C" PVR add-on timer event type. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimerType "kodi::addon::PVRTimerType" for + * description of values. + */ + typedef struct PVR_TIMER_TYPE + { + unsigned int iId; + uint64_t iAttributes; + char strDescription[PVR_ADDON_TIMERTYPE_STRING_LENGTH]; + + unsigned int iPrioritiesSize; + struct PVR_ATTRIBUTE_INT_VALUE priorities[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; + int iPrioritiesDefault; + + unsigned int iLifetimesSize; + struct PVR_ATTRIBUTE_INT_VALUE lifetimes[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; + int iLifetimesDefault; + + unsigned int iPreventDuplicateEpisodesSize; + struct PVR_ATTRIBUTE_INT_VALUE preventDuplicateEpisodes[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; + unsigned int iPreventDuplicateEpisodesDefault; + + unsigned int iRecordingGroupSize; + struct PVR_ATTRIBUTE_INT_VALUE recordingGroup[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE]; + unsigned int iRecordingGroupDefault; + + unsigned int iMaxRecordingsSize; + struct PVR_ATTRIBUTE_INT_VALUE maxRecordings[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL]; + int iMaxRecordingsDefault; + } PVR_TIMER_TYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon_base.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon_base.h new file mode 100644 index 0000000..1924d77 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon_base.h @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2005-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "stdbool.h" +#include "stdint.h" + +#ifndef TARGET_WINDOWS +#ifndef __cdecl +#define __cdecl +#endif +#ifndef __declspec +#define __declspec(X) +#endif +#endif + +#undef ATTRIBUTE_PACKED +#undef PRAGMA_PACK_BEGIN +#undef PRAGMA_PACK_END + +#if defined(__GNUC__) +#define ATTRIBUTE_PACKED __attribute__((packed)) +#define PRAGMA_PACK 0 +#define ATTRIBUTE_HIDDEN __attribute__((visibility("hidden"))) +#endif + +#if !defined(ATTRIBUTE_PACKED) +#define ATTRIBUTE_PACKED +#define PRAGMA_PACK 1 +#endif + +#if !defined(ATTRIBUTE_HIDDEN) +#define ATTRIBUTE_HIDDEN +#endif + +#ifdef _MSC_VER +#define ATTRIBUTE_FORCEINLINE __forceinline +#elif defined(__GNUC__) +#define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) +#elif defined(__CLANG__) +#if __has_attribute(__always_inline__) +#define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) +#else +#define ATTRIBUTE_FORCEINLINE inline +#endif +#else +#define ATTRIBUTE_FORCEINLINE inline +#endif + +/* + * To have a on add-on and kodi itself handled string always on known size! + */ +#define ADDON_STANDARD_STRING_LENGTH 1024 +#define ADDON_STANDARD_STRING_LENGTH_SMALL 256 + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_addon_addonbase + /// @brief Return value of functions in @ref cpp_kodi_addon_addonbase "kodi::addon::CAddonBase" + /// and associated classes. + /// + ///@{ + typedef enum ADDON_STATUS + { + /// @brief For everything OK and no error + ADDON_STATUS_OK, + + /// @brief A needed connection was lost + ADDON_STATUS_LOST_CONNECTION, + + /// @brief Addon needs a restart inside Kodi + ADDON_STATUS_NEED_RESTART, + + /// @brief Necessary settings are not yet set + ADDON_STATUS_NEED_SETTINGS, + + /// @brief Unknown and incomprehensible error + ADDON_STATUS_UNKNOWN, + + /// @brief Permanent failure, like failing to resolve methods + ADDON_STATUS_PERMANENT_FAILURE, + + /* internal used return error if function becomes not used from child on + * addon */ + ADDON_STATUS_NOT_IMPLEMENTED + } ADDON_STATUS; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_Defs_AddonLog enum AddonLog + /// @ingroup cpp_kodi_Defs + /// @brief **Log file type definitions**\n + /// These define the types of log entries given with @ref kodi::Log() to Kodi. + /// + /// ------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// #include + /// + /// kodi::Log(ADDON_LOG_ERROR, "%s: There is an error occurred!", __func__); + /// + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum AddonLog + { + /// @brief **0** : To include debug information in the log file. + ADDON_LOG_DEBUG = 0, + + /// @brief **1** : To include information messages in the log file. + ADDON_LOG_INFO = 1, + + /// @brief **2** : To write warnings in the log file. + ADDON_LOG_WARNING = 2, + + /// @brief **3** : To report error messages in the log file. + ADDON_LOG_ERROR = 3, + + /// @brief **4** : To notify fatal unrecoverable errors, which can may also indicate + /// upcoming crashes. + ADDON_LOG_FATAL = 4 + } AddonLog; + ///@} + //---------------------------------------------------------------------------- + + /*! @brief Standard undefined pointer handle */ + typedef void* KODI_HANDLE; + + /*! + * @brief Handle used to return data from the PVR add-on to CPVRClient + */ + struct ADDON_HANDLE_STRUCT + { + void* callerAddress; /*!< address of the caller */ + void* dataAddress; /*!< address to store data in */ + int dataIdentifier; /*!< parameter to pass back when calling the callback */ + }; + typedef struct ADDON_HANDLE_STRUCT* ADDON_HANDLE; + + /*! + * @brief Callback function tables from addon to Kodi + * Set complete from Kodi! + */ + struct AddonToKodiFuncTable_kodi; + struct AddonToKodiFuncTable_kodi_audioengine; + struct AddonToKodiFuncTable_kodi_filesystem; + struct AddonToKodiFuncTable_kodi_network; + struct AddonToKodiFuncTable_kodi_gui; + typedef struct AddonToKodiFuncTable_Addon + { + // Pointer inside Kodi, used on callback functions to give related handle + // class, for this ADDON::CAddonDll inside Kodi. + KODI_HANDLE kodiBase; + + // Function addresses used for callbacks from addon to Kodi + char* (*get_type_version)(void* kodiBase, int type); + + void (*free_string)(void* kodiBase, char* str); + void (*free_string_array)(void* kodiBase, char** arr, int numElements); + char* (*get_addon_path)(void* kodiBase); + char* (*get_base_user_path)(void* kodiBase); + void (*addon_log_msg)(void* kodiBase, const int loglevel, const char* msg); + + bool (*get_setting_bool)(void* kodiBase, const char* id, bool* value); + bool (*get_setting_int)(void* kodiBase, const char* id, int* value); + bool (*get_setting_float)(void* kodiBase, const char* id, float* value); + bool (*get_setting_string)(void* kodiBase, const char* id, char** value); + + bool (*set_setting_bool)(void* kodiBase, const char* id, bool value); + bool (*set_setting_int)(void* kodiBase, const char* id, int value); + bool (*set_setting_float)(void* kodiBase, const char* id, float value); + bool (*set_setting_string)(void* kodiBase, const char* id, const char* value); + + void* (*get_interface)(void* kodiBase, const char* name, const char* version); + + struct AddonToKodiFuncTable_kodi* kodi; + struct AddonToKodiFuncTable_kodi_audioengine* kodi_audioengine; + struct AddonToKodiFuncTable_kodi_filesystem* kodi_filesystem; + struct AddonToKodiFuncTable_kodi_gui* kodi_gui; + struct AddonToKodiFuncTable_kodi_network* kodi_network; + + // Move up by min version change about + bool (*is_setting_using_default)(void* kodiBase, const char* id); + } AddonToKodiFuncTable_Addon; + + /*! + * @brief Function tables from Kodi to addon + */ + typedef struct KodiToAddonFuncTable_Addon + { + void (*destroy)(); + ADDON_STATUS (*get_status)(); + ADDON_STATUS(*create_instance) + (int instanceType, + const char* instanceID, + KODI_HANDLE instance, + const char* version, + KODI_HANDLE* addonInstance, + KODI_HANDLE parent); + void (*destroy_instance)(int instanceType, KODI_HANDLE instance); + ADDON_STATUS (*set_setting)(const char* settingName, const void* settingValue); + } KodiToAddonFuncTable_Addon; + + /*! + * @brief Main structure passed from kodi to addon with basic information needed to + * create add-on. + */ + typedef struct AddonGlobalInterface + { + // String with full path where add-on is installed (without his name on end) + // Set from Kodi! + const char* libBasePath; + + // Master API version of Kodi itself (ADDON_GLOBAL_VERSION_MAIN) + const char* kodi_base_api_version; + + // Pointer of first created instance, used in case this add-on goes with single way + // Set from Kodi! + KODI_HANDLE firstKodiInstance; + + // Pointer to master base class inside add-on + // Set from addon header (kodi::addon::CAddonBase)! + KODI_HANDLE addonBase; + + // Pointer to a instance used on single way (together with this class) + // Set from addon header (kodi::addon::IAddonInstance)! + KODI_HANDLE globalSingleInstance; + + // Callback function tables from addon to Kodi + // Set from Kodi! + AddonToKodiFuncTable_Addon* toKodi; + + // Function tables from Kodi to addon + // Set from addon header! + KodiToAddonFuncTable_Addon* toAddon; + } AddonGlobalInterface; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/audio_engine.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/audio_engine.h new file mode 100644 index 0000000..02e96ac --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/audio_engine.h @@ -0,0 +1,308 @@ +/* + * Copyright (C) 2005-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "stdint.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Definitions, structures and enumerators of audio engine + //{{{ + + //============================================================================ + /// @defgroup cpp_kodi_audioengine_Defs_AudioEngineStreamOptions enum AudioEngineStreamOptions + /// @ingroup cpp_kodi_audioengine_Defs + /// @brief **Bit options to pass to CAEStream**\n + /// A bit field of stream options. + /// + /// + /// ------------------------------------------------------------------------ + /// + /// **Usage example:** + /// ~~~~~~~~~~~~~{.cpp} + /// // Here only as minimal, "format" must be set to wanted types + /// kodi::audioengine::AudioEngineFormat format; + /// m_audioengine = new kodi::audioengine::CAEStream(format, AUDIO_STREAM_FORCE_RESAMPLE | AUDIO_STREAM_AUTOSTART); + /// ~~~~~~~~~~~~~ + /// + //@{ + typedef enum AudioEngineStreamOptions + { + /// force resample even if rates match + AUDIO_STREAM_FORCE_RESAMPLE = 1 << 0, + /// create the stream paused + AUDIO_STREAM_PAUSED = 1 << 1, + /// autostart the stream when enough data is buffered + AUDIO_STREAM_AUTOSTART = 1 << 2, + } AudioEngineStreamOptions; + //@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_audioengine_Defs_AudioEngineChannel enum AudioEngineChannel + /// @ingroup cpp_kodi_audioengine_Defs + /// @brief **The possible channels**\n + /// Used to set available or used channels on stream. + /// + /// + /// ------------------------------------------------------------------------ + /// + /// **Usage example:** + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::audioengine::AudioEngineFormat format; + /// format.SetChannelLayout(std::vector(AUDIOENGINE_CH_FL, AUDIOENGINE_CH_FR)); + /// ~~~~~~~~~~~~~ + /// + //@{ + enum AudioEngineChannel + { + /// Used inside to indicate the end of a list and not for addon use directly. + AUDIOENGINE_CH_NULL = -1, + /// RAW Audio format + AUDIOENGINE_CH_RAW, + /// Front left + AUDIOENGINE_CH_FL, + /// Front right + AUDIOENGINE_CH_FR, + /// Front center + AUDIOENGINE_CH_FC, + /// LFE / Subwoofer + AUDIOENGINE_CH_LFE, + /// Back left + AUDIOENGINE_CH_BL, + /// Back right + AUDIOENGINE_CH_BR, + /// Front left over center + AUDIOENGINE_CH_FLOC, + /// Front right over center + AUDIOENGINE_CH_FROC, + /// Back center + AUDIOENGINE_CH_BC, + /// Side left + AUDIOENGINE_CH_SL, + /// Side right + AUDIOENGINE_CH_SR, + /// Top front left + AUDIOENGINE_CH_TFL, + /// Top front right + AUDIOENGINE_CH_TFR, + /// Top front center + AUDIOENGINE_CH_TFC, + /// Top center + AUDIOENGINE_CH_TC, + /// Top back left + AUDIOENGINE_CH_TBL, + /// Top back right + AUDIOENGINE_CH_TBR, + /// Top back center + AUDIOENGINE_CH_TBC, + /// Back left over center + AUDIOENGINE_CH_BLOC, + /// Back right over center + AUDIOENGINE_CH_BROC, + /// Maximum possible value, to use e.g. as size inside list + AUDIOENGINE_CH_MAX + }; + //@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_audioengine_Defs_AudioEngineDataFormat enum AudioEngineDataFormat + /// @ingroup cpp_kodi_audioengine_Defs + /// @brief **Audio sample formats**\n + /// The bit layout of the audio data. + /// + /// LE = Little Endian, BE = Big Endian, NE = Native Endian + /// + /// For planar sample formats, each audio channel is in a separate data plane, + /// and linesize is the buffer size, in bytes, for a single plane. All data + /// planes must be the same size. For packed sample formats, only the first + /// data plane is used, and samples for each channel are interleaved. In this + /// case, linesize is the buffer size, in bytes, for the 1 plane. + /// + /// @note This is ordered from the worst to best preferred formats + /// + /// + /// ------------------------------------------------------------------------ + /// + /// **Usage example:** + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::audioengine::AudioEngineFormat format; + /// format.SetDataFormat(AUDIOENGINE_FMT_FLOATP); + /// ~~~~~~~~~~~~~ + /// + //@{ + enum AudioEngineDataFormat + { + /// To define format as invalid + AUDIOENGINE_FMT_INVALID = -1, + + /// Unsigned integer 8 bit + AUDIOENGINE_FMT_U8, + + /// Big Endian signed integer 16 bit + AUDIOENGINE_FMT_S16BE, + /// Little Endian signed integer 16 bit + AUDIOENGINE_FMT_S16LE, + /// Native Endian signed integer 16 bit + AUDIOENGINE_FMT_S16NE, + + /// Big Endian signed integer 32 bit + AUDIOENGINE_FMT_S32BE, + /// Little Endian signed integer 32 bit + AUDIOENGINE_FMT_S32LE, + /// Native Endian signed integer 32 bit + AUDIOENGINE_FMT_S32NE, + + /// Big Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24BE4, + /// Little Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24LE4, + /// Native Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24NE4, + /// S32 with bits_per_sample < 32 + AUDIOENGINE_FMT_S24NE4MSB, + + /// Big Endian signed integer 24 bit (3 bytes) + AUDIOENGINE_FMT_S24BE3, + /// Little Endian signed integer 24 bit (3 bytes) + AUDIOENGINE_FMT_S24LE3, + /// Native Endian signed integer 24 bit (3 bytes) + AUDIOENGINE_FMT_S24NE3, + + /// Double floating point + AUDIOENGINE_FMT_DOUBLE, + /// Floating point + AUDIOENGINE_FMT_FLOAT, + + /// **Bitstream**\n + /// RAW Audio format + AUDIOENGINE_FMT_RAW, + + /// **Planar format**\n + /// Unsigned byte + AUDIOENGINE_FMT_U8P, + /// **Planar format**\n + /// Native Endian signed 16 bit + AUDIOENGINE_FMT_S16NEP, + /// **Planar format**\n + /// Native Endian signed 32 bit + AUDIOENGINE_FMT_S32NEP, + /// **Planar format**\n + /// Native Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24NE4P, + /// **Planar format**\n + /// S32 with bits_per_sample < 32 + AUDIOENGINE_FMT_S24NE4MSBP, + /// **Planar format**\n + /// Native Endian signed integer 24 bit (in 3 bytes) + AUDIOENGINE_FMT_S24NE3P, + /// **Planar format**\n + /// Double floating point + AUDIOENGINE_FMT_DOUBLEP, + /// **Planar format**\n + /// Floating point + AUDIOENGINE_FMT_FLOATP, + + /// Amount of sample formats. + AUDIOENGINE_FMT_MAX + }; + //@} + //---------------------------------------------------------------------------- + + /*! + * @brief Internal API structure which are used for data exchange between + * Kodi and addon. + */ + struct AUDIO_ENGINE_FORMAT + { + /*! The stream's data format (eg, AUDIOENGINE_FMT_S16LE) */ + enum AudioEngineDataFormat m_dataFormat; + + /*! The stream's sample rate (eg, 48000) */ + unsigned int m_sampleRate; + + /*! The encoded streams sample rate if a bitstream, otherwise undefined */ + unsigned int m_encodedRate; + + /*! The amount of used speaker channels */ + unsigned int m_channelCount; + + /*! The stream's channel layout */ + enum AudioEngineChannel m_channels[AUDIOENGINE_CH_MAX]; + + /*! The number of frames per period */ + unsigned int m_frames; + + /*! The size of one frame in bytes */ + unsigned int m_frameSize; + }; + + /* A stream handle pointer, which is only used internally by the addon stream handle */ + typedef void AEStreamHandle; + + //}}} + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Internal interface tables for intercommunications between addon and kodi + //{{{ + + /* + * Function address structure, not need to visible on dev kit doxygen + * documentation + */ + typedef struct AddonToKodiFuncTable_kodi_audioengine + { + AEStreamHandle* (*make_stream)(void* kodiBase, + struct AUDIO_ENGINE_FORMAT* format, + unsigned int options); + void (*free_stream)(void* kodiBase, AEStreamHandle* stream); + bool (*get_current_sink_format)(void* kodiBase, struct AUDIO_ENGINE_FORMAT* sink_format); + + // Audio Engine Stream definitions + unsigned int (*aestream_get_space)(void* kodiBase, AEStreamHandle* handle); + unsigned int (*aestream_add_data)(void* kodiBase, + AEStreamHandle* handle, + uint8_t* const* data, + unsigned int offset, + unsigned int frames, + double pts, + bool hasDownmix, + double centerMixLevel); + double (*aestream_get_delay)(void* kodiBase, AEStreamHandle* handle); + bool (*aestream_is_buffering)(void* kodiBase, AEStreamHandle* handle); + double (*aestream_get_cache_time)(void* kodiBase, AEStreamHandle* handle); + double (*aestream_get_cache_total)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_pause)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_resume)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_drain)(void* kodiBase, AEStreamHandle* handle, bool wait); + bool (*aestream_is_draining)(void* kodiBase, AEStreamHandle* handle); + bool (*aestream_is_drained)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_flush)(void* kodiBase, AEStreamHandle* handle); + float (*aestream_get_volume)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_set_volume)(void* kodiBase, AEStreamHandle* handle, float volume); + float (*aestream_get_amplification)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_set_amplification)(void* kodiBase, AEStreamHandle* handle, float amplify); + unsigned int (*aestream_get_frame_size)(void* kodiBase, AEStreamHandle* handle); + unsigned int (*aestream_get_channel_count)(void* kodiBase, AEStreamHandle* handle); + unsigned int (*aestream_get_sample_rate)(void* kodiBase, AEStreamHandle* handle); + enum AudioEngineDataFormat (*aestream_get_data_format)(void* kodiBase, AEStreamHandle* handle); + double (*aestream_get_resample_ratio)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_set_resample_ratio)(void* kodiBase, AEStreamHandle* handle, double ratio); + } AddonToKodiFuncTable_kodi_audioengine; + + //}}} + +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/filesystem.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/filesystem.h new file mode 100644 index 0000000..b68a24c --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/filesystem.h @@ -0,0 +1,299 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include +#include +#include + +#ifdef _WIN32 // windows +#ifndef _SSIZE_T_DEFINED +typedef intptr_t ssize_t; +#define _SSIZE_T_DEFINED +#endif // !_SSIZE_T_DEFINED + +// Prevent conflicts with Windows macros where have this names. +#ifdef CreateDirectory +#undef CreateDirectory +#endif // CreateDirectory +#ifdef DeleteFile +#undef DeleteFile +#endif // DeleteFile +#endif // _WIN32 + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Definitions, structures and enumerators of filesystem + //{{{ + + //============================================================================ + /// @defgroup cpp_kodi_vfs_Defs_OpenFileFlags enum OpenFileFlags + /// @ingroup cpp_kodi_vfs_Defs + /// @brief **Flags to define way how file becomes opened**\n + /// The values can be used together, e.g. `file.Open("myfile", ADDON_READ_TRUNCATED | ADDON_READ_CHUNKED);` + /// + /// Used on @ref kodi::vfs::CFile::OpenFile(). + /// + ///@{ + typedef enum OpenFileFlags + { + /// @brief **0000 0000 0001** :\n + /// Indicate that caller can handle truncated reads, where function + /// returns before entire buffer has been filled. + ADDON_READ_TRUNCATED = 0x01, + + /// @brief **0000 0000 0010** :\n + /// Indicate that that caller support read in the minimum defined + /// chunk size, this disables internal cache then. + ADDON_READ_CHUNKED = 0x02, + + /// @brief **0000 0000 0100** :\n + /// Use cache to access this file. + ADDON_READ_CACHED = 0x04, + + /// @brief **0000 0000 1000** :\n + /// Open without caching. regardless to file type. + ADDON_READ_NO_CACHE = 0x08, + + /// @brief **0000 0001 0000** :\n + /// Calcuate bitrate for file while reading. + ADDON_READ_BITRATE = 0x10, + + /// @brief **0000 0010 0000** :\n + /// Indicate to the caller we will seek between multiple streams in + /// the file frequently. + ADDON_READ_MULTI_STREAM = 0x20, + + /// @brief **0000 0100 0000** :\n + /// indicate to the caller file is audio and/or video (and e.g. may + /// grow). + ADDON_READ_AUDIO_VIDEO = 0x40, + + /// @brief **0000 1000 0000** :\n + /// Indicate that caller will do write operations before reading. + ADDON_READ_AFTER_WRITE = 0x80, + + /// @brief **0001 0000 0000** :\n + /// Indicate that caller want to reopen a file if its already open. + ADDON_READ_REOPEN = 0x100 + } OpenFileFlags; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_vfs_Defs_CURLOptiontype enum CURLOptiontype + /// @ingroup cpp_kodi_vfs_Defs + /// @brief **CURL message types**\n + /// Used on kodi::vfs::CFile::CURLAddOption(). + /// + //@{ + typedef enum CURLOptiontype + { + /// @brief Set a general option. + ADDON_CURL_OPTION_OPTION, + + /// @brief Set a protocol option. + /// + /// The following names for *ADDON_CURL_OPTION_PROTOCOL* are possible: + /// + /// | Option name | Description + /// |------------------------------------:|:-------------------------------- + /// | `accept-charset` | Set the "accept-charset" header + /// | `acceptencoding or encoding` | Set the "accept-encoding" header + /// | `active-remote` | Set the "active-remote" header + /// | `auth` | Set the authentication method. Possible values: any, anysafe, digest, ntlm + /// | `connection-timeout` | Set the connection timeout in seconds + /// | `cookie` | Set the "cookie" header + /// | `customrequest` | Set a custom HTTP request like DELETE + /// | `noshout` | Set to true if kodi detects a stream as shoutcast by mistake. + /// | `postdata` | Set the post body (value needs to be base64 encoded). (Implicitly sets the request to POST) + /// | `referer` | Set the "referer" header + /// | `user-agent` | Set the "user-agent" header + /// | `seekable` | Set the stream seekable. 1: enable, 0: disable + /// | `sslcipherlist` | Set list of accepted SSL ciphers. + /// + ADDON_CURL_OPTION_PROTOCOL, + + /// @brief Set User and password + ADDON_CURL_OPTION_CREDENTIALS, + + /// @brief Add a Header + ADDON_CURL_OPTION_HEADER + } CURLOptiontype; + //@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_vfs_Defs_FilePropertyTypes enum FilePropertyTypes + /// @ingroup cpp_kodi_vfs_Defs + /// @brief **File property types**\n + /// Mostly to read internet sources. + /// + /// Used on kodi::vfs::CFile::GetPropertyValue() and kodi::vfs::CFile::GetPropertyValues(). + /// + //@{ + typedef enum FilePropertyTypes + { + /// @brief Get protocol response line. + ADDON_FILE_PROPERTY_RESPONSE_PROTOCOL, + /// @brief Get a response header. + ADDON_FILE_PROPERTY_RESPONSE_HEADER, + /// @brief Get file content type. + ADDON_FILE_PROPERTY_CONTENT_TYPE, + /// @brief Get file content charset. + ADDON_FILE_PROPERTY_CONTENT_CHARSET, + /// @brief Get file mime type. + ADDON_FILE_PROPERTY_MIME_TYPE, + /// @brief Get file effective URL (last one if redirected). + ADDON_FILE_PROPERTY_EFFECTIVE_URL + } FilePropertyTypes; + //@} + //---------------------------------------------------------------------------- + + //}}} + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Internal interface tables for intercommunications between addon and kodi + //{{{ + + struct KODI_HTTP_HEADER + { + void* handle; + + char* (*get_value)(void* kodiBase, void* handle, const char* param); + char** (*get_values)(void* kodiBase, void* handle, const char* param, int* length); + char* (*get_header)(void* kodiBase, void* handle); + char* (*get_mime_type)(void* kodiBase, void* handle); + char* (*get_charset)(void* kodiBase, void* handle); + char* (*get_proto_line)(void* kodiBase, void* handle); + }; + + struct STAT_STRUCTURE + { + /// ID of device containing file + uint32_t deviceId; + /// Total size, in bytes + uint64_t size; + /// Time of last access + time_t accessTime; + /// Time of last modification + time_t modificationTime; + /// Time of last status change + time_t statusTime; + /// The stat url is a directory + bool isDirectory; + /// The stat url is a symbolic link + bool isSymLink; + }; + + struct VFS_CACHE_STATUS_DATA + { + uint64_t forward; + unsigned int maxrate; + unsigned int currate; + bool lowspeed; + }; + + struct VFSProperty + { + char* name; + char* val; + }; + + struct VFSDirEntry + { + char* label; //!< item label + char* title; //!< item title + char* path; //!< item path + unsigned int num_props; //!< Number of properties attached to item + struct VFSProperty* properties; //!< Properties + time_t date_time; //!< file creation date & time + bool folder; //!< Item is a folder + uint64_t size; //!< Size of file represented by item + }; + + typedef struct AddonToKodiFuncTable_kodi_filesystem + { + bool (*can_open_directory)(void* kodiBase, const char* url); + bool (*create_directory)(void* kodiBase, const char* path); + bool (*remove_directory)(void* kodiBase, const char* path); + bool (*directory_exists)(void* kodiBase, const char* path); + bool (*get_directory)(void* kodiBase, + const char* path, + const char* mask, + struct VFSDirEntry** items, + unsigned int* num_items); + void (*free_directory)(void* kodiBase, struct VFSDirEntry* items, unsigned int num_items); + + bool (*file_exists)(void* kodiBase, const char* filename, bool useCache); + bool (*stat_file)(void* kodiBase, const char* filename, struct STAT_STRUCTURE* buffer); + bool (*delete_file)(void* kodiBase, const char* filename); + bool (*rename_file)(void* kodiBase, const char* filename, const char* newFileName); + bool (*copy_file)(void* kodiBase, const char* filename, const char* dest); + + char* (*get_file_md5)(void* kodiBase, const char* filename); + char* (*get_cache_thumb_name)(void* kodiBase, const char* filename); + char* (*make_legal_filename)(void* kodiBase, const char* filename); + char* (*make_legal_path)(void* kodiBase, const char* path); + char* (*translate_special_protocol)(void* kodiBase, const char* strSource); + bool (*is_internet_stream)(void* kodiBase, const char* path, bool strictCheck); + bool (*is_on_lan)(void* kodiBase, const char* path); + bool (*is_remote)(void* kodiBase, const char* path); + bool (*is_local)(void* kodiBase, const char* path); + bool (*is_url)(void* kodiBase, const char* path); + bool (*get_http_header)(void* kodiBase, const char* url, struct KODI_HTTP_HEADER* headers); + bool (*get_mime_type)(void* kodiBase, const char* url, char** content, const char* useragent); + bool (*get_content_type)(void* kodiBase, + const char* url, + char** content, + const char* useragent); + bool (*get_cookies)(void* kodiBase, const char* url, char** cookies); + bool (*http_header_create)(void* kodiBase, struct KODI_HTTP_HEADER* headers); + void (*http_header_free)(void* kodiBase, struct KODI_HTTP_HEADER* headers); + + void* (*open_file)(void* kodiBase, const char* filename, unsigned int flags); + void* (*open_file_for_write)(void* kodiBase, const char* filename, bool overwrite); + ssize_t (*read_file)(void* kodiBase, void* file, void* ptr, size_t size); + bool (*read_file_string)(void* kodiBase, void* file, char* szLine, int iLineLength); + ssize_t (*write_file)(void* kodiBase, void* file, const void* ptr, size_t size); + void (*flush_file)(void* kodiBase, void* file); + int64_t (*seek_file)(void* kodiBase, void* file, int64_t position, int whence); + int (*truncate_file)(void* kodiBase, void* file, int64_t size); + int64_t (*get_file_position)(void* kodiBase, void* file); + int64_t (*get_file_length)(void* kodiBase, void* file); + double (*get_file_download_speed)(void* kodiBase, void* file); + void (*close_file)(void* kodiBase, void* file); + int (*get_file_chunk_size)(void* kodiBase, void* file); + bool (*io_control_get_seek_possible)(void* kodiBase, void* file); + bool (*io_control_get_cache_status)(void* kodiBase, + void* file, + struct VFS_CACHE_STATUS_DATA* status); + bool (*io_control_set_cache_rate)(void* kodiBase, void* file, unsigned int rate); + bool (*io_control_set_retry)(void* kodiBase, void* file, bool retry); + char** (*get_property_values)( + void* kodiBase, void* file, int type, const char* name, int* numValues); + + void* (*curl_create)(void* kodiBase, const char* url); + bool (*curl_add_option)( + void* kodiBase, void* file, int type, const char* name, const char* value); + bool (*curl_open)(void* kodiBase, void* file, unsigned int flags); + + bool (*get_disk_space)( + void* kodiBase, const char* path, uint64_t* capacity, uint64_t* free, uint64_t* available); + } AddonToKodiFuncTable_kodi_filesystem; + + //}}} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/general.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/general.h new file mode 100644 index 0000000..ede8e94 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/general.h @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// \ingroup cpp_kodi_Defs + /// @brief For kodi::CurrentKeyboardLayout used defines + /// + typedef enum StdKbButtons + { + /// The quantity of buttons per row on Kodi's standard keyboard + STD_KB_BUTTONS_PER_ROW = 20, + /// The quantity of rows on Kodi's standard keyboard + STD_KB_BUTTONS_MAX_ROWS = 4, + /// Keyboard layout type, this for initial standard + STD_KB_MODIFIER_KEY_NONE = 0x00, + /// Keyboard layout type, this for shift controled layout (uppercase) + STD_KB_MODIFIER_KEY_SHIFT = 0x01, + /// Keyboard layout type, this to show symbols + STD_KB_MODIFIER_KEY_SYMBOL = 0x02 + } StdKbButtons; + //---------------------------------------------------------------------------- + + //============================================================================ + /// \ingroup cpp_kodi_Defs + /// @brief For kodi::QueueNotification() used message types + /// + typedef enum QueueMsg + { + /// Show info notification message + QUEUE_INFO, + /// Show warning notification message + QUEUE_WARNING, + /// Show error notification message + QUEUE_ERROR, + /// Show with own given image and parts if set on values + QUEUE_OWN_STYLE + } QueueMsg; + //---------------------------------------------------------------------------- + + //============================================================================ + /// \ingroup cpp_kodi_Defs + /// @brief Format codes to get string from them. + /// + /// Used on kodi::GetLanguage(). + /// + typedef enum LangFormats + { + /// two letter code as defined in ISO 639-1 + LANG_FMT_ISO_639_1, + /// three letter code as defined in ISO 639-2/T or ISO 639-2/B + LANG_FMT_ISO_639_2, + /// full language name in English + LANG_FMT_ENGLISH_NAME + } LangFormats; + //---------------------------------------------------------------------------- + + /* + * For interface between add-on and kodi. + * + * This structure defines the addresses of functions stored inside Kodi which + * are then available for the add-on to call + * + * All function pointers there are used by the C++ interface functions below. + * You find the set of them on xbmc/addons/interfaces/General.cpp + * + * Note: For add-on development itself this is not needed + */ + typedef struct AddonKeyboardKeyTable + { + char* keys[STD_KB_BUTTONS_MAX_ROWS][STD_KB_BUTTONS_PER_ROW]; + } AddonKeyboardKeyTable; + typedef struct AddonToKodiFuncTable_kodi + { + char* (*get_addon_info)(void* kodiBase, const char* id); + bool (*open_settings_dialog)(void* kodiBase); + char* (*unknown_to_utf8)(void* kodiBase, const char* source, bool* ret, bool failOnBadChar); + char* (*get_localized_string)(void* kodiBase, long label_id); + char* (*get_language)(void* kodiBase, int format, bool region); + bool (*queue_notification)(void* kodiBase, + int type, + const char* header, + const char* message, + const char* imageFile, + unsigned int displayTime, + bool withSound, + unsigned int messageTime); + void (*get_md5)(void* kodiBase, const char* text, char* md5); + char* (*get_temp_path)(void* kodiBase); + char* (*get_region)(void* kodiBase, const char* id); + void (*get_free_mem)(void* kodiBase, long* free, long* total, bool as_bytes); + int (*get_global_idle_time)(void* kodiBase); + bool (*is_addon_avilable)(void* kodiBase, const char* id, char** version, bool* enabled); + void (*kodi_version)(void* kodiBase, + char** compile_name, + int* major, + int* minor, + char** revision, + char** tag, + char** tagversion); + char* (*get_current_skin_id)(void* kodiBase); + bool (*get_keyboard_layout)(void* kodiBase, + char** layout_name, + int modifier_key, + struct AddonKeyboardKeyTable* layout); + bool (*change_keyboard_layout)(void* kodiBase, char** layout_name); + } AddonToKodiFuncTable_kodi; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/network.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/network.h new file mode 100644 index 0000000..6c0441f --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/network.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + /* + * For interface between add-on and kodi. + * + * This structure defines the addresses of functions stored inside Kodi which + * are then available for the add-on to call + * + * All function pointers there are used by the C++ interface functions below. + * You find the set of them on xbmc/addons/interfaces/General.cpp + * + * Note: For add-on development itself this is not needed + */ + typedef struct AddonToKodiFuncTable_kodi_network + { + bool (*wake_on_lan)(void* kodiBase, const char* mac); + char* (*get_ip_address)(void* kodiBase); + char* (*dns_lookup)(void* kodiBase, const char* url, bool* ret); + char* (*url_encode)(void* kodiBase, const char* url); + char* (*get_hostname)(void* kodiBase); + bool (*is_local_host)(void* kodiBase, const char* hostname); + bool (*is_host_on_lan)(void* kodiBase, const char* hostname, bool offLineCheck); + char* (*get_user_agent)(void* kodiBase); + } AddonToKodiFuncTable_kodi_network; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ -- cgit v1.2.3