From be933ef2241d79558f91796cc5b3a161f72ebf9c Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 19 Oct 2020 00:52:24 +0200 Subject: sync with upstream --- .../kodi/c-api/addon-instance/CMakeLists.txt | 13 + .../kodi/c-api/addon-instance/audio_decoder.h | 92 ++ .../kodi/c-api/addon-instance/audio_encoder.h | 67 ++ .../include/kodi/c-api/addon-instance/game.h | 1212 ++++++++++++++++++++ .../kodi/c-api/addon-instance/image_decoder.h | 83 ++ .../include/kodi/c-api/addon-instance/peripheral.h | 709 ++++++++++++ .../include/kodi/c-api/addon-instance/pvr.h | 332 ++++++ .../kodi/c-api/addon-instance/pvr/CMakeLists.txt | 14 + .../c-api/addon-instance/pvr/pvr_channel_groups.h | 59 + .../kodi/c-api/addon-instance/pvr/pvr_channels.h | 109 ++ .../kodi/c-api/addon-instance/pvr/pvr_defines.h | 66 ++ .../kodi/c-api/addon-instance/pvr/pvr_edl.h | 67 ++ .../kodi/c-api/addon-instance/pvr/pvr_epg.h | 658 +++++++++++ .../kodi/c-api/addon-instance/pvr/pvr_general.h | 295 +++++ .../kodi/c-api/addon-instance/pvr/pvr_menu_hook.h | 77 ++ .../kodi/c-api/addon-instance/pvr/pvr_recordings.h | 148 +++ .../kodi/c-api/addon-instance/pvr/pvr_stream.h | 160 +++ .../kodi/c-api/addon-instance/pvr/pvr_timers.h | 412 +++++++ .../kodi/c-api/addon-instance/screensaver.h | 75 ++ .../include/kodi/c-api/addon-instance/vfs.h | 149 +++ .../kodi/c-api/addon-instance/visualization.h | 117 ++ 21 files changed, 4914 insertions(+) create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance') diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt new file mode 100644 index 0000000..4edd034 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt @@ -0,0 +1,13 @@ +set(HEADERS audio_decoder.h + audio_encoder.h + game.h + image_decoder.h + peripheral.h + pvr.h + screensaver.h + vfs.h + visualization.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-dev-kit_include_kodi_c-api_addon-instance) +endif() diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h new file mode 100644 index 0000000..8b75ddb --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2005-2020 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 + +#ifndef C_API_ADDONINSTANCE_AUDIO_DECODER_H +#define C_API_ADDONINSTANCE_AUDIO_DECODER_H + +#include "../addon_base.h" +#include "../audio_engine.h" + +#define AUDIO_DECODER_LYRICS_SIZE 65535 + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + // WARNING About size use malloc/new! + struct AUDIO_DECODER_INFO_TAG + { + char title[ADDON_STANDARD_STRING_LENGTH_SMALL]; + char artist[ADDON_STANDARD_STRING_LENGTH_SMALL]; + char album[ADDON_STANDARD_STRING_LENGTH_SMALL]; + char album_artist[ADDON_STANDARD_STRING_LENGTH_SMALL]; + char media_type[ADDON_STANDARD_STRING_LENGTH_SMALL]; + char genre[ADDON_STANDARD_STRING_LENGTH_SMALL]; + int duration; + int track; + int disc; + char disc_subtitle[ADDON_STANDARD_STRING_LENGTH_SMALL]; + int disc_total; + char release_date[ADDON_STANDARD_STRING_LENGTH_SMALL]; + char lyrics[AUDIO_DECODER_LYRICS_SIZE]; + int samplerate; + int channels; + int bitrate; + char comment[ADDON_STANDARD_STRING_LENGTH]; + }; + + typedef struct AddonProps_AudioDecoder + { + int dummy; + } AddonProps_AudioDecoder; + + typedef struct AddonToKodiFuncTable_AudioDecoder + { + KODI_HANDLE kodiInstance; + } AddonToKodiFuncTable_AudioDecoder; + + struct AddonInstance_AudioDecoder; + typedef struct KodiToAddonFuncTable_AudioDecoder + { + KODI_HANDLE addonInstance; + bool(__cdecl* init)(const struct AddonInstance_AudioDecoder* instance, + const char* file, + unsigned int filecache, + int* channels, + int* samplerate, + int* bitspersample, + int64_t* totaltime, + int* bitrate, + enum AudioEngineDataFormat* format, + const enum AudioEngineChannel** info); + int(__cdecl* read_pcm)(const struct AddonInstance_AudioDecoder* instance, + uint8_t* buffer, + int size, + int* actualsize); + int64_t(__cdecl* seek)(const struct AddonInstance_AudioDecoder* instance, int64_t time); + bool(__cdecl* read_tag)(const struct AddonInstance_AudioDecoder* instance, + const char* file, + struct AUDIO_DECODER_INFO_TAG* tag); + int(__cdecl* track_count)(const struct AddonInstance_AudioDecoder* instance, const char* file); + } KodiToAddonFuncTable_AudioDecoder; + + typedef struct AddonInstance_AudioDecoder + { + struct AddonProps_AudioDecoder* props; + struct AddonToKodiFuncTable_AudioDecoder* toKodi; + struct KodiToAddonFuncTable_AudioDecoder* toAddon; + } AddonInstance_AudioDecoder; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_ADDONINSTANCE_AUDIO_DECODER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h new file mode 100644 index 0000000..6f24d1c --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h @@ -0,0 +1,67 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_AUDIO_ENCODER_H +#define C_API_ADDONINSTANCE_AUDIO_ENCODER_H + +#include "../addon_base.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonProps_AudioEncoder + { + int dummy; + } AddonProps_AudioEncoder; + + typedef struct AddonToKodiFuncTable_AudioEncoder + { + KODI_HANDLE kodiInstance; + int (*write)(KODI_HANDLE kodiInstance, const uint8_t* data, int len); + int64_t (*seek)(KODI_HANDLE kodiInstance, int64_t pos, int whence); + } AddonToKodiFuncTable_AudioEncoder; + + struct AddonInstance_AudioEncoder; + typedef struct KodiToAddonFuncTable_AudioEncoder + { + KODI_HANDLE addonInstance; + bool(__cdecl* start)(const struct AddonInstance_AudioEncoder* instance, + int in_channels, + int in_rate, + int in_bits, + const char* title, + const char* artist, + const char* albumartist, + const char* album, + const char* year, + const char* track, + const char* genre, + const char* comment, + int track_length); + int(__cdecl* encode)(const struct AddonInstance_AudioEncoder* instance, + int num_bytes_read, + const uint8_t* pbt_stream); + bool(__cdecl* finish)(const struct AddonInstance_AudioEncoder* instance); + } KodiToAddonFuncTable_AudioEncoder; + + typedef struct AddonInstance_AudioEncoder + { + struct AddonProps_AudioEncoder* props; + struct AddonToKodiFuncTable_AudioEncoder* toKodi; + struct KodiToAddonFuncTable_AudioEncoder* toAddon; + } AddonInstance_AudioEncoder; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_ADDONINSTANCE_AUDIO_ENCODER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h new file mode 100644 index 0000000..c97fa5d --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h @@ -0,0 +1,1212 @@ +/* + * Copyright (C) 2014-2020 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 + +#ifndef C_API_ADDONINSTANCE_GAME_H +#define C_API_ADDONINSTANCE_GAME_H + +#include "../addon_base.h" + +#include /* size_t */ + +//============================================================================== +/// @ingroup cpp_kodi_addon_game_Defs +/// @brief **Port ID used when topology is unknown** +#define DEFAULT_PORT_ID "1" +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Game add-on error codes** + /// + /// Used as return values on most Game related functions. + /// + typedef enum GAME_ERROR + { + /// @brief no error occurred + GAME_ERROR_NO_ERROR, + + /// @brief an unknown error occurred + GAME_ERROR_UNKNOWN, + + /// @brief the method that the frontend called is not implemented + GAME_ERROR_NOT_IMPLEMENTED, + + /// @brief the command was rejected by the game client + GAME_ERROR_REJECTED, + + /// @brief the parameters of the method that was called are invalid for this operation + GAME_ERROR_INVALID_PARAMETERS, + + /// @brief the command failed + GAME_ERROR_FAILED, + + /// @brief no game is loaded + GAME_ERROR_NOT_LOADED, + + /// @brief game requires restricted resources + GAME_ERROR_RESTRICTED, + } GAME_ERROR; + //---------------------------------------------------------------------------- + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_AudioStream 1. Audio stream + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **The for Audio stream used data system** + /// + /// Used to give Addon currently used audio stream configuration on Kodi and + /// arrays to give related data to Kodi on callbacks. + /// + ///@{ + + //============================================================================ + /// @brief **Stream Format** + /// + /// From Kodi requested specified audio sample format. + /// + typedef enum GAME_PCM_FORMAT + { + GAME_PCM_FORMAT_UNKNOWN, + + /// @brief S16NE sample format + GAME_PCM_FORMAT_S16NE, + } GAME_PCM_FORMAT; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Audio channel** + /// + /// Channel identification flags. + /// + typedef enum GAME_AUDIO_CHANNEL + { + /// @brief Channel list terminator + GAME_CH_NULL, + + /// @brief Channel front left + GAME_CH_FL, + + /// @brief Channel front right + GAME_CH_FR, + + /// @brief Channel front center + GAME_CH_FC, + + /// @brief Channel Low Frequency Effects / Subwoofer + GAME_CH_LFE, + + /// @brief Channel back left + GAME_CH_BL, + + /// @brief Channel back right + GAME_CH_BR, + + /// @brief Channel front left over center + GAME_CH_FLOC, + + /// @brief Channel front right over center + GAME_CH_FROC, + + /// @brief Channel back center + GAME_CH_BC, + + /// @brief Channel surround/side left + GAME_CH_SL, + + /// @brief Channel surround/side right + GAME_CH_SR, + + /// @brief Channel top front left + GAME_CH_TFL, + + /// @brief Channel top front right + GAME_CH_TFR, + + /// @brief Channel top front center + GAME_CH_TFC, + + /// @brief Channel top center + GAME_CH_TC, + + /// @brief Channel top back left + GAME_CH_TBL, + + /// @brief Channel top back right + GAME_CH_TBR, + + /// @brief Channel top back center + GAME_CH_TBC, + + /// @brief Channel bacl left over center + GAME_CH_BLOC, + + /// @brief Channel back right over center + GAME_CH_BROC, + } GAME_AUDIO_CHANNEL; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Game audio stream properties** + /// + /// Used by Kodi to pass the currently required audio stream settings to the addon + /// + typedef struct game_stream_audio_properties + { + GAME_PCM_FORMAT format; + const GAME_AUDIO_CHANNEL* channel_map; + } ATTRIBUTE_PACKED game_stream_audio_properties; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Audio stream packet** + /// + /// This packet contains audio stream data passed to Kodi. + /// + typedef struct game_stream_audio_packet + { + /// @brief Pointer for audio stream data given to Kodi + const uint8_t* data; + + /// @brief Size of data array + size_t size; + } ATTRIBUTE_PACKED game_stream_audio_packet; + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_VideoStream 2. Video stream + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **The for Video stream used data system** + /// + /// Used to give Addon currently used video stream configuration on Kodi and + /// arrays to give related data to Kodi on callbacks. + /// + ///@{ + + //============================================================================ + /// @brief **Pixel format** + /// + /// From Kodi requested specified video RGB color model format. + /// + typedef enum GAME_PIXEL_FORMAT + { + GAME_PIXEL_FORMAT_UNKNOWN, + + /// @brief 0RGB8888 Format + GAME_PIXEL_FORMAT_0RGB8888, + + /// @brief RGB565 Format + GAME_PIXEL_FORMAT_RGB565, + + /// @brief 0RGB1555 Format + GAME_PIXEL_FORMAT_0RGB1555, + } GAME_PIXEL_FORMAT; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Video rotation position** + /// + /// To define position how video becomes shown. + /// + typedef enum GAME_VIDEO_ROTATION + { + /// @brief 0° and Without rotation + GAME_VIDEO_ROTATION_0, + + /// @brief rotate 90° counterclockwise + GAME_VIDEO_ROTATION_90_CCW, + + /// @brief rotate 180° counterclockwise + GAME_VIDEO_ROTATION_180_CCW, + + /// @brief rotate 270° counterclockwise + GAME_VIDEO_ROTATION_270_CCW, + } GAME_VIDEO_ROTATION; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Game video stream properties** + /// + /// Used by Kodi to pass the currently required video stream settings to the addon + /// + typedef struct game_stream_video_properties + { + /// @brief The to used pixel format + GAME_PIXEL_FORMAT format; + + /// @brief The nominal used width + unsigned int nominal_width; + + /// @brief The nominal used height + unsigned int nominal_height; + + /// @brief The maximal used width + unsigned int max_width; + + /// @brief The maximal used height + unsigned int max_height; + + /// @brief On video stream used aspect ration + /// + /// @note If aspect_ratio is <= 0.0, an aspect ratio of nominal_width / nominal_height is assumed + float aspect_ratio; + } ATTRIBUTE_PACKED game_stream_video_properties; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Video stream packet** + /// + /// This packet contains video stream data passed to Kodi. + /// + typedef struct game_stream_video_packet + { + /// @brief Video height + unsigned int width; + + /// @brief Video width + unsigned int height; + + /// @brief Width @ref GAME_VIDEO_ROTATION defined rotation angle. + GAME_VIDEO_ROTATION rotation; + + /// @brief Pointer for video stream data given to Kodi + const uint8_t* data; + + /// @brief Size of data array + size_t size; + } ATTRIBUTE_PACKED game_stream_video_packet; + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_HardwareFramebuffer 3. Hardware framebuffer stream + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Hardware framebuffer stream data** + /// + ///@{ + + //============================================================================ + /// @brief **Hardware framebuffer type** + /// + typedef enum GAME_HW_CONTEXT_TYPE + { + /// @brief None context + GAME_HW_CONTEXT_NONE, + + /// @brief OpenGL 2.x. Driver can choose to use latest compatibility context + GAME_HW_CONTEXT_OPENGL, + + /// @brief OpenGL ES 2.0 + GAME_HW_CONTEXT_OPENGLES2, + + /// @brief Modern desktop core GL context. Use major/minor fields to set GL version + GAME_HW_CONTEXT_OPENGL_CORE, + + /// @brief OpenGL ES 3.0 + GAME_HW_CONTEXT_OPENGLES3, + + /// @brief OpenGL ES 3.1+. Set major/minor fields. + GAME_HW_CONTEXT_OPENGLES_VERSION, + + /// @brief Vulkan + GAME_HW_CONTEXT_VULKAN + } GAME_HW_CONTEXT_TYPE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Hardware framebuffer properties** + /// + typedef struct game_stream_hw_framebuffer_properties + { + /// @brief The API to use. + /// + GAME_HW_CONTEXT_TYPE context_type; + + /// @brief Set if render buffers should have depth component attached. + /// + /// @todo: Obsolete + /// + bool depth; + + /// @brief Set if stencil buffers should be attached. + /// + /// If depth and stencil are true, a packed 24/8 buffer will be added. + /// Only attaching stencil is invalid and will be ignored. + /// + /// @todo: Obsolete. + /// + bool stencil; + + /// @brief Use conventional bottom-left origin convention. + /// + /// If false, standard top-left origin semantics are used. + /// + /// @todo: Move to GL specific interface + /// + bool bottom_left_origin; + + /// @brief Major version number for core GL context or GLES 3.1+. + unsigned int version_major; + + /// @brief Minor version number for core GL context or GLES 3.1+. + unsigned int version_minor; + + /// @brief If this is true, the frontend will go very far to avoid resetting context + /// in scenarios like toggling fullscreen, etc. + /// + /// @todo: Obsolete? Maybe frontend should just always assume this... + /// + /// The reset callback might still be called in extreme situations such as if + /// the context is lost beyond recovery. + /// + /// For optimal stability, set this to false, and allow context to be reset at + /// any time. + /// + bool cache_context; + + /// @brief Creates a debug context. + bool debug_context; + } ATTRIBUTE_PACKED game_stream_hw_framebuffer_properties; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Hardware framebuffer buffer** + /// + typedef struct game_stream_hw_framebuffer_buffer + { + /// @brief + uintptr_t framebuffer; + } ATTRIBUTE_PACKED game_stream_hw_framebuffer_buffer; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Hardware framebuffer packet** + /// + typedef struct game_stream_hw_framebuffer_packet + { + /// @brief + uintptr_t framebuffer; + } ATTRIBUTE_PACKED game_stream_hw_framebuffer_packet; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Hardware framebuffer process function address** + /// + typedef void (*game_proc_address_t)(void); + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_SoftwareFramebuffer 4. Software framebuffer stream + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Software framebuffer stream data** + /// + ///@{ + + //============================================================================ + /// @brief **Game video stream properties** + /// + /// Used by Kodi to pass the currently required video stream settings to the addon + /// + typedef game_stream_video_properties game_stream_sw_framebuffer_properties; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Hardware framebuffer type** + /// + typedef struct game_stream_sw_framebuffer_buffer + { + GAME_PIXEL_FORMAT format; + uint8_t* data; + size_t size; + } ATTRIBUTE_PACKED game_stream_sw_framebuffer_buffer; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Video stream packet** + /// + /// This packet contains video stream data passed to Kodi. + /// + typedef game_stream_video_packet game_stream_sw_framebuffer_packet; + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_StreamTypes 5. Stream types + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Stream types data** + /// + ///@{ + + //============================================================================ + /// @brief **Game stream types** + /// + typedef enum GAME_STREAM_TYPE + { + /// @brief Unknown + GAME_STREAM_UNKNOWN, + + /// @brief Audio stream + GAME_STREAM_AUDIO, + + /// @brief Video stream + GAME_STREAM_VIDEO, + + /// @brief Hardware framebuffer + GAME_STREAM_HW_FRAMEBUFFER, + + /// @brief Software framebuffer + GAME_STREAM_SW_FRAMEBUFFER, + } GAME_STREAM_TYPE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Immutable stream metadata** + /// + /// This metadata is provided when the stream is opened. If any stream + /// properties change, a new stream must be opened. + /// + typedef struct game_stream_properties + { + /// @brief + GAME_STREAM_TYPE type; + union + { + /// @brief + game_stream_audio_properties audio; + + /// @brief + game_stream_video_properties video; + + /// @brief + game_stream_hw_framebuffer_properties hw_framebuffer; + + /// @brief + game_stream_sw_framebuffer_properties sw_framebuffer; + }; + } ATTRIBUTE_PACKED game_stream_properties; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Stream buffers for hardware rendering and zero-copy support** + /// + typedef struct game_stream_buffer + { + /// @brief + GAME_STREAM_TYPE type; + union + { + /// @brief + game_stream_hw_framebuffer_buffer hw_framebuffer; + + /// @brief + game_stream_sw_framebuffer_buffer sw_framebuffer; + }; + } ATTRIBUTE_PACKED game_stream_buffer; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Stream packet and ephemeral metadata** + /// + /// This packet contains stream data and accompanying metadata. The metadata + /// is ephemeral, meaning it only applies to the current packet and can change + /// from packet to packet in the same stream. + /// + typedef struct game_stream_packet + { + /// @brief + GAME_STREAM_TYPE type; + union + { + /// @brief + game_stream_audio_packet audio; + + /// @brief + game_stream_video_packet video; + + /// @brief + game_stream_hw_framebuffer_packet hw_framebuffer; + + /// @brief + game_stream_sw_framebuffer_packet sw_framebuffer; + }; + } ATTRIBUTE_PACKED game_stream_packet; + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_GameTypes 6. Game types + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Game types data** + /// + ///@{ + + //============================================================================ + /// @brief **Game reguin definition** + /// + /// Returned from game_get_region() + typedef enum GAME_REGION + { + /// @brief Game region unknown + GAME_REGION_UNKNOWN, + + /// @brief Game region NTSC + GAME_REGION_NTSC, + + /// @brief Game region PAL + GAME_REGION_PAL, + } GAME_REGION; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Special game types passed into game_load_game_special().** + /// + /// @remark Only used when multiple ROMs are required. + /// + typedef enum SPECIAL_GAME_TYPE + { + /// @brief Game Type BSX + SPECIAL_GAME_TYPE_BSX, + + /// @brief Game Type BSX slotted + SPECIAL_GAME_TYPE_BSX_SLOTTED, + + /// @brief Game Type sufami turbo + SPECIAL_GAME_TYPE_SUFAMI_TURBO, + + /// @brief Game Type super game boy + SPECIAL_GAME_TYPE_SUPER_GAME_BOY, + } SPECIAL_GAME_TYPE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **Game Memory** + /// + typedef enum GAME_MEMORY + { + /// @brief Passed to game_get_memory_data/size(). If the memory type doesn't apply + /// to the implementation NULL/0 can be returned. + GAME_MEMORY_MASK = 0xff, + + /// @brief Regular save ram. + /// + /// This ram is usually found on a game cartridge, backed + /// up by a battery. If save game data is too complex for a single memory + /// buffer, the SYSTEM_DIRECTORY environment callback can be used. + GAME_MEMORY_SAVE_RAM = 0, + + /// @brief Some games have a built-in clock to keep track of time. + /// + /// This memory is usually just a couple of bytes to keep track of time. + GAME_MEMORY_RTC = 1, + + /// @brief System ram lets a frontend peek into a game systems main RAM + GAME_MEMORY_SYSTEM_RAM = 2, + + /// @brief Video ram lets a frontend peek into a game systems video RAM (VRAM) + GAME_MEMORY_VIDEO_RAM = 3, + + /// @brief Special memory type + GAME_MEMORY_SNES_BSX_RAM = ((1 << 8) | GAME_MEMORY_SAVE_RAM), + + /// @brief Special memory type + GAME_MEMORY_SNES_BSX_PRAM = ((2 << 8) | GAME_MEMORY_SAVE_RAM), + + /// @brief Special memory type + GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM = ((3 << 8) | GAME_MEMORY_SAVE_RAM), + + /// @brief Special memory type + GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM = ((4 << 8) | GAME_MEMORY_SAVE_RAM), + + /// @brief Special memory type + GAME_MEMORY_SNES_GAME_BOY_RAM = ((5 << 8) | GAME_MEMORY_SAVE_RAM), + + /// @brief Special memory type + GAME_MEMORY_SNES_GAME_BOY_RTC = ((6 << 8) | GAME_MEMORY_RTC), + } GAME_MEMORY; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief **ID values for SIMD CPU features** + typedef enum GAME_SIMD + { + /// @brief SIMD CPU SSE + GAME_SIMD_SSE = (1 << 0), + + /// @brief SIMD CPU SSE2 + GAME_SIMD_SSE2 = (1 << 1), + + /// @brief SIMD CPU VMX + GAME_SIMD_VMX = (1 << 2), + + /// @brief SIMD CPU VMX128 + GAME_SIMD_VMX128 = (1 << 3), + + /// @brief SIMD CPU AVX + GAME_SIMD_AVX = (1 << 4), + + /// @brief SIMD CPU NEON + GAME_SIMD_NEON = (1 << 5), + + /// @brief SIMD CPU SSE3 + GAME_SIMD_SSE3 = (1 << 6), + + /// @brief SIMD CPU SSSE3 + GAME_SIMD_SSSE3 = (1 << 7), + + /// @brief SIMD CPU MMX + GAME_SIMD_MMX = (1 << 8), + + /// @brief SIMD CPU MMXEXT + GAME_SIMD_MMXEXT = (1 << 9), + + /// @brief SIMD CPU SSE4 + GAME_SIMD_SSE4 = (1 << 10), + + /// @brief SIMD CPU SSE42 + GAME_SIMD_SSE42 = (1 << 11), + + /// @brief SIMD CPU AVX2 + GAME_SIMD_AVX2 = (1 << 12), + + /// @brief SIMD CPU VFPU + GAME_SIMD_VFPU = (1 << 13), + } GAME_SIMD; + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_InputTypes 7. Input types + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Input types** + /// + ///@{ + + //============================================================================ + /// @brief + typedef enum GAME_INPUT_EVENT_SOURCE + { + /// @brief + GAME_INPUT_EVENT_DIGITAL_BUTTON, + + /// @brief + GAME_INPUT_EVENT_ANALOG_BUTTON, + + /// @brief + GAME_INPUT_EVENT_AXIS, + + /// @brief + GAME_INPUT_EVENT_ANALOG_STICK, + + /// @brief + GAME_INPUT_EVENT_ACCELEROMETER, + + /// @brief + GAME_INPUT_EVENT_KEY, + + /// @brief + GAME_INPUT_EVENT_RELATIVE_POINTER, + + /// @brief + GAME_INPUT_EVENT_ABSOLUTE_POINTER, + + /// @brief + GAME_INPUT_EVENT_MOTOR, + } GAME_INPUT_EVENT_SOURCE; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef enum GAME_KEY_MOD + { + /// @brief + GAME_KEY_MOD_NONE = 0x0000, + + /// @brief + GAME_KEY_MOD_SHIFT = 0x0001, + + /// @brief + GAME_KEY_MOD_CTRL = 0x0002, + + /// @brief + GAME_KEY_MOD_ALT = 0x0004, + + /// @brief + GAME_KEY_MOD_META = 0x0008, + + /// @brief + GAME_KEY_MOD_SUPER = 0x0010, + + /// @brief + GAME_KEY_MOD_NUMLOCK = 0x0100, + + /// @brief + GAME_KEY_MOD_CAPSLOCK = 0x0200, + + /// @brief + GAME_KEY_MOD_SCROLLOCK = 0x0400, + } GAME_KEY_MOD; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Type of port on the virtual game console + typedef enum GAME_PORT_TYPE + { + /// @brief Game port unknown + GAME_PORT_UNKNOWN, + + /// @brief Game port Keyboard + GAME_PORT_KEYBOARD, + + /// @brief Game port mouse + GAME_PORT_MOUSE, + + /// @brief Game port controller + GAME_PORT_CONTROLLER, + } GAME_PORT_TYPE; + //---------------------------------------------------------------------------- + + /*! @cond PRIVATE */ + /*! + * @brief "C" Game add-on controller layout. + * + * Structure used to interface in "C" between Kodi and Addon. + * + * See @ref AddonGameControllerLayout for description of values. + */ + typedef struct game_controller_layout + { + char* controller_id; + bool provides_input; // False for multitaps + char** digital_buttons; + unsigned int digital_button_count; + char** analog_buttons; + unsigned int analog_button_count; + char** analog_sticks; + unsigned int analog_stick_count; + char** accelerometers; + unsigned int accelerometer_count; + char** keys; + unsigned int key_count; + char** rel_pointers; + unsigned int rel_pointer_count; + char** abs_pointers; + unsigned int abs_pointer_count; + char** motors; + unsigned int motor_count; + } ATTRIBUTE_PACKED game_controller_layout; + /*! @endcond */ + + struct game_input_port; + + //============================================================================ + /// @brief Device that can provide input + typedef struct game_input_device + { + /// @brief ID used in the Kodi controller API + const char* controller_id; + + /// @brief + const char* port_address; + + /// @brief + struct game_input_port* available_ports; + + /// @brief + unsigned int port_count; + } ATTRIBUTE_PACKED game_input_device; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief Port that can provide input + /// + /// Ports can accept multiple devices and devices can have multiple ports, so + /// the topology of possible configurations is a tree structure of alternating + /// port and device nodes. + /// + typedef struct game_input_port + { + /// @brief + GAME_PORT_TYPE type; + + /// @brief Required for GAME_PORT_CONTROLLER type + const char* port_id; + + /// @brief + game_input_device* accepted_devices; + + /// @brief + unsigned int device_count; + } ATTRIBUTE_PACKED game_input_port; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief The input topology is the possible ways to connect input devices + /// + /// This represents the logical topology, which is the possible connections that + /// the game client's logic can handle. It is strictly a subset of the physical + /// topology. Loops are not allowed. + /// + typedef struct game_input_topology + { + /// @brief The list of ports on the virtual game console + game_input_port* ports; + + /// @brief The number of ports + unsigned int port_count; + + /// @brief A limit on the number of input-providing devices, or -1 for no limit + int player_limit; + } ATTRIBUTE_PACKED game_input_topology; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_digital_button_event + { + /// @brief + bool pressed; + } ATTRIBUTE_PACKED game_digital_button_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_analog_button_event + { + /// @brief + float magnitude; + } ATTRIBUTE_PACKED game_analog_button_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_axis_event + { + /// @brief + float position; + } ATTRIBUTE_PACKED game_axis_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_analog_stick_event + { + /// @brief + float x; + + /// @brief + float y; + } ATTRIBUTE_PACKED game_analog_stick_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_accelerometer_event + { + /// @brief + float x; + + /// @brief + float y; + + /// @brief + float z; + } ATTRIBUTE_PACKED game_accelerometer_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_key_event + { + /// @brief + bool pressed; + + /// @brief If the keypress generates a printing character + /// + /// The unicode value contains the character generated. If the key is a + /// non-printing character, e.g. a function or arrow key, the unicode value + /// is zero. + uint32_t unicode; + + /// @brief + GAME_KEY_MOD modifiers; + } ATTRIBUTE_PACKED game_key_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_rel_pointer_event + { + /// @brief + int x; + + /// @brief + int y; + } ATTRIBUTE_PACKED game_rel_pointer_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_abs_pointer_event + { + /// @brief + bool pressed; + + /// @brief + float x; + + /// @brief + float y; + } ATTRIBUTE_PACKED game_abs_pointer_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_motor_event + { + /// @brief + float magnitude; + } ATTRIBUTE_PACKED game_motor_event; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @brief + typedef struct game_input_event + { + /// @brief + GAME_INPUT_EVENT_SOURCE type; + + /// @brief + const char* controller_id; + + /// @brief + GAME_PORT_TYPE port_type; + + /// @brief + const char* port_address; + + /// @brief + const char* feature_name; + union + { + /// @brief + struct game_digital_button_event digital_button; + + /// @brief + struct game_analog_button_event analog_button; + + /// @brief + struct game_axis_event axis; + + /// @brief + struct game_analog_stick_event analog_stick; + + /// @brief + struct game_accelerometer_event accelerometer; + + /// @brief + struct game_key_event key; + + /// @brief + struct game_rel_pointer_event rel_pointer; + + /// @brief + struct game_abs_pointer_event abs_pointer; + + /// @brief + struct game_motor_event motor; + }; + } ATTRIBUTE_PACKED game_input_event; + //---------------------------------------------------------------------------- + + ///@} + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + /// @defgroup cpp_kodi_addon_game_Defs_EnvironmentTypes 8. Environment types + /// @ingroup cpp_kodi_addon_game_Defs + /// @brief **Environment types** + /// + ///@{ + + //============================================================================ + /// @brief Game system timing + /// + struct game_system_timing + { + /// @brief FPS of video content. + double fps; + + /// @brief Sampling rate of audio. + double sample_rate; + }; + //---------------------------------------------------------------------------- + + ///@} + + + //--==----==----==----==----==----==----==----==----==----==----==----==----==-- + + /*! + * @brief Game properties + * + * Not to be used outside this header. + */ + typedef struct AddonProps_Game + { + /*! + * The path of the game client being loaded. + */ + const char* game_client_dll_path; + + /*! + * Paths to proxy DLLs used to load the game client. + */ + const char** proxy_dll_paths; + + /*! + * Number of proxy DLL paths provided. + */ + unsigned int proxy_dll_count; + + /*! + * The "system" directories of the frontend. These directories can be used to + * store system-specific ROMs such as BIOSes, configuration data, etc. + */ + const char** resource_directories; + + /*! + * Number of resource directories provided + */ + unsigned int resource_directory_count; + + /*! + * The writable directory of the frontend. This directory can be used to store + * SRAM, memory cards, high scores, etc, if the game client cannot use the + * regular memory interface, GetMemoryData(). + */ + const char* profile_directory; + + /*! + * The value of the property from addon.xml + */ + bool supports_vfs; + + /*! + * The extensions in the property from addon.xml + */ + const char** extensions; + + /*! + * Number of extensions provided + */ + unsigned int extension_count; + } AddonProps_Game; + + typedef void* KODI_GAME_STREAM_HANDLE; + + /*! Structure to transfer the methods from kodi_game_dll.h to Kodi */ + + struct AddonInstance_Game; + + /*! + * @brief Game callbacks + * + * Not to be used outside this header. + */ + typedef struct AddonToKodiFuncTable_Game + { + KODI_HANDLE kodiInstance; + + void (*CloseGame)(KODI_HANDLE kodiInstance); + KODI_GAME_STREAM_HANDLE (*OpenStream)(KODI_HANDLE, const struct game_stream_properties*); + bool (*GetStreamBuffer)(KODI_HANDLE, + KODI_GAME_STREAM_HANDLE, + unsigned int, + unsigned int, + struct game_stream_buffer*); + void (*AddStreamData)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, const struct game_stream_packet*); + void (*ReleaseStreamBuffer)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, struct game_stream_buffer*); + void (*CloseStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE); + game_proc_address_t (*HwGetProcAddress)(KODI_HANDLE kodiInstance, const char* symbol); + bool (*InputEvent)(KODI_HANDLE kodiInstance, const struct game_input_event* event); + } AddonToKodiFuncTable_Game; + + /*! + * @brief Game function hooks + * + * Not to be used outside this header. + */ + typedef struct KodiToAddonFuncTable_Game + { + KODI_HANDLE addonInstance; + + GAME_ERROR(__cdecl* LoadGame)(const struct AddonInstance_Game*, const char*); + GAME_ERROR(__cdecl* LoadGameSpecial) + (const struct AddonInstance_Game*, enum SPECIAL_GAME_TYPE, const char**, size_t); + GAME_ERROR(__cdecl* LoadStandalone)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* UnloadGame)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* GetGameTiming) + (const struct AddonInstance_Game*, struct game_system_timing*); + GAME_REGION(__cdecl* GetRegion)(const struct AddonInstance_Game*); + bool(__cdecl* RequiresGameLoop)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* RunFrame)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* Reset)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* HwContextReset)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* HwContextDestroy)(const struct AddonInstance_Game*); + bool(__cdecl* HasFeature)(const struct AddonInstance_Game*, const char*, const char*); + game_input_topology*(__cdecl* GetTopology)(const struct AddonInstance_Game*); + void(__cdecl* FreeTopology)(const struct AddonInstance_Game*, struct game_input_topology*); + void(__cdecl* SetControllerLayouts)(const struct AddonInstance_Game*, + const struct game_controller_layout*, + unsigned int); + bool(__cdecl* EnableKeyboard)(const struct AddonInstance_Game*, bool, const char*); + bool(__cdecl* EnableMouse)(const struct AddonInstance_Game*, bool, const char*); + bool(__cdecl* ConnectController)(const struct AddonInstance_Game*, + bool, + const char*, + const char*); + bool(__cdecl* InputEvent)(const struct AddonInstance_Game*, const struct game_input_event*); + size_t(__cdecl* SerializeSize)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* Serialize)(const struct AddonInstance_Game*, uint8_t*, size_t); + GAME_ERROR(__cdecl* Deserialize)(const struct AddonInstance_Game*, const uint8_t*, size_t); + GAME_ERROR(__cdecl* CheatReset)(const struct AddonInstance_Game*); + GAME_ERROR(__cdecl* GetMemory) + (const struct AddonInstance_Game*, enum GAME_MEMORY, uint8_t**, size_t*); + GAME_ERROR(__cdecl* SetCheat) + (const struct AddonInstance_Game*, unsigned int, bool, const char*); + } KodiToAddonFuncTable_Game; + + /*! + * @brief Game instance + * + * Not to be used outside this header. + */ + typedef struct AddonInstance_Game + { + struct AddonProps_Game* props; + struct AddonToKodiFuncTable_Game* toKodi; + struct KodiToAddonFuncTable_Game* toAddon; + } AddonInstance_Game; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* !C_API_ADDONINSTANCE_GAME_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h new file mode 100644 index 0000000..6455b38 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h @@ -0,0 +1,83 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_IMAGE_DECODER_H +#define C_API_ADDONINSTANCE_IMAGE_DECODER_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_IMAGE_DECODER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h new file mode 100644 index 0000000..393f34a --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h @@ -0,0 +1,709 @@ +/* + * Copyright (C) 2014-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 + +#ifndef C_API_ADDONINSTANCE_PERIPHERAL_H +#define C_API_ADDONINSTANCE_PERIPHERAL_H + +#include "../addon_base.h" + +/* indicates a joystick has no preference for port number */ +#define NO_PORT_REQUESTED (-1) + +/* joystick's driver button/hat/axis index is unknown */ +#define DRIVER_INDEX_UNKNOWN (-1) + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_General_PERIPHERAL_ERROR enum PERIPHERAL_ERROR + /// @ingroup cpp_kodi_addon_peripheral_Defs_General + /// @brief **Peripheral add-on error codes**\n + /// Used as return values on most peripheral related functions. + /// + /// In this way, a peripheral instance signals errors in its processing and, + /// under certain conditions, allows Kodi to make corrections. + /// + ///@{ + typedef enum PERIPHERAL_ERROR + { + /// @brief __0__ : No error occurred + PERIPHERAL_NO_ERROR = 0, + + /// @brief __-1__ : An unknown error occurred + PERIPHERAL_ERROR_UNKNOWN = -1, + + /// @brief __-2__ : The command failed + PERIPHERAL_ERROR_FAILED = -2, + + /// @brief __-3__ : The parameters of the method are invalid for this operation + PERIPHERAL_ERROR_INVALID_PARAMETERS = -3, + + /// @brief __-4__ : The method that the frontend called is not implemented + PERIPHERAL_ERROR_NOT_IMPLEMENTED = -4, + + /// @brief __-5__ : No peripherals are connected + PERIPHERAL_ERROR_NOT_CONNECTED = -5, + + /// @brief __-6__ : Peripherals are connected, but command was interrupted + PERIPHERAL_ERROR_CONNECTION_FAILED = -6, + } PERIPHERAL_ERROR; + ///@} + //---------------------------------------------------------------------------- + + // @name Peripheral types + //{ + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Peripheral_PERIPHERAL_TYPE enum PERIPHERAL_TYPE + /// @ingroup cpp_kodi_addon_peripheral_Defs_Peripheral + /// @brief **Peripheral types**\n + /// Types used to identify wanted peripheral. + ///@{ + typedef enum PERIPHERAL_TYPE + { + /// @brief Type declared as unknown. + PERIPHERAL_TYPE_UNKNOWN, + + /// @brief Type declared as joystick. + PERIPHERAL_TYPE_JOYSTICK, + + /// @brief Type declared as keyboard. + PERIPHERAL_TYPE_KEYBOARD, + } PERIPHERAL_TYPE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Information shared between peripherals + */ + typedef struct PERIPHERAL_INFO + { + PERIPHERAL_TYPE type; /*!< type of peripheral */ + char* name; /*!< name of peripheral */ + uint16_t vendor_id; /*!< vendor ID of peripheral, 0x0000 if unknown */ + uint16_t product_id; /*!< product ID of peripheral, 0x0000 if unknown */ + unsigned int index; /*!< the order in which the add-on identified this peripheral */ + } ATTRIBUTE_PACKED PERIPHERAL_INFO; + + /*! + * @brief Peripheral add-on capabilities. + */ + typedef struct PERIPHERAL_CAPABILITIES + { + bool provides_joysticks; /*!< true if the add-on provides joysticks */ + bool provides_joystick_rumble; + bool provides_joystick_power_off; + bool provides_buttonmaps; /*!< true if the add-on provides button maps */ + } ATTRIBUTE_PACKED PERIPHERAL_CAPABILITIES; + + //} + + // @name Event types + //{ + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Event_PERIPHERAL_EVENT_TYPE enum PERIPHERAL_EVENT_TYPE + /// @ingroup cpp_kodi_addon_peripheral_Defs_Event + /// @brief **Event types**\n + /// Types of events that can be sent and received. + ///@{ + typedef enum PERIPHERAL_EVENT_TYPE + { + /// @brief unknown event + PERIPHERAL_EVENT_TYPE_NONE, + + /// @brief state changed for joystick driver button + PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON, + + /// @brief state changed for joystick driver hat + PERIPHERAL_EVENT_TYPE_DRIVER_HAT, + + /// @brief state changed for joystick driver axis + PERIPHERAL_EVENT_TYPE_DRIVER_AXIS, + + /// @brief set the state for joystick rumble motor + PERIPHERAL_EVENT_TYPE_SET_MOTOR, + } PERIPHERAL_EVENT_TYPE; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Event_JOYSTICK_STATE_BUTTON enum JOYSTICK_STATE_BUTTON + /// @ingroup cpp_kodi_addon_peripheral_Defs_Event + /// @brief **State button**\n + /// States a button can have + ///@{ + typedef enum JOYSTICK_STATE_BUTTON + { + /// @brief button is released + JOYSTICK_STATE_BUTTON_UNPRESSED = 0x0, + + /// @brief button is pressed + JOYSTICK_STATE_BUTTON_PRESSED = 0x1, + } JOYSTICK_STATE_BUTTON; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Event_JOYSTICK_STATE_HAT enum JOYSTICK_STATE_HAT + /// @ingroup cpp_kodi_addon_peripheral_Defs_Event + /// @brief **State hat**\n + /// States a D-pad (also called a hat) can have + ///@{ + typedef enum JOYSTICK_STATE_HAT + { + /// @brief no directions are pressed + JOYSTICK_STATE_HAT_UNPRESSED = 0x0, + + /// @brief only left is pressed + JOYSTICK_STATE_HAT_LEFT = 0x1, + + /// @brief only right is pressed + JOYSTICK_STATE_HAT_RIGHT = 0x2, + + /// @brief only up is pressed + JOYSTICK_STATE_HAT_UP = 0x4, + + /// @brief only down is pressed + JOYSTICK_STATE_HAT_DOWN = 0x8, + + /// @brief left and up is pressed + JOYSTICK_STATE_HAT_LEFT_UP = JOYSTICK_STATE_HAT_LEFT | JOYSTICK_STATE_HAT_UP, + + /// @brief left and down is pressed + JOYSTICK_STATE_HAT_LEFT_DOWN = JOYSTICK_STATE_HAT_LEFT | JOYSTICK_STATE_HAT_DOWN, + + /// @brief right and up is pressed + JOYSTICK_STATE_HAT_RIGHT_UP = JOYSTICK_STATE_HAT_RIGHT | JOYSTICK_STATE_HAT_UP, + + /// @brief right and down is pressed + JOYSTICK_STATE_HAT_RIGHT_DOWN = JOYSTICK_STATE_HAT_RIGHT | JOYSTICK_STATE_HAT_DOWN, + } JOYSTICK_STATE_HAT; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_peripheral_Defs_Event + /// @brief Axis value in the closed interval [-1.0, 1.0] + /// + /// The axis state uses the XInput coordinate system: + /// - Negative values signify down or to the left + /// - Positive values signify up or to the right + /// + typedef float JOYSTICK_STATE_AXIS; + //---------------------------------------------------------------------------- + + //============================================================================ + /// @ingroup cpp_kodi_addon_peripheral_Defs_Event + /// @brief Motor value in the closed interval [0.0, 1.0] + typedef float JOYSTICK_STATE_MOTOR; + //---------------------------------------------------------------------------- + + /*! + * @brief Event information + */ + typedef struct PERIPHERAL_EVENT + { + /*! @brief Index of the peripheral handling/receiving the event */ + unsigned int peripheral_index; + + /*! @brief Type of the event used to determine which enum field to access below */ + PERIPHERAL_EVENT_TYPE type; + + /*! @brief The index of the event source */ + unsigned int driver_index; + + JOYSTICK_STATE_BUTTON driver_button_state; + JOYSTICK_STATE_HAT driver_hat_state; + JOYSTICK_STATE_AXIS driver_axis_state; + JOYSTICK_STATE_MOTOR motor_state; + } ATTRIBUTE_PACKED PERIPHERAL_EVENT; + + //} + + // @name Joystick types + //{ + + /*! + * @brief Info specific to joystick peripherals + */ + typedef struct JOYSTICK_INFO + { + PERIPHERAL_INFO peripheral; /*!< @brief peripheral info for this joystick */ + char* provider; /*!< @brief name of the driver or interface providing the joystick */ + int requested_port; /*!< @brief requested port number (such as for 360 controllers), or NO_PORT_REQUESTED */ + unsigned int button_count; /*!< @brief number of buttons reported by the driver */ + unsigned int hat_count; /*!< @brief number of hats reported by the driver */ + unsigned int axis_count; /*!< @brief number of axes reported by the driver */ + unsigned int motor_count; /*!< @brief number of motors reported by the driver */ + bool supports_poweroff; /*!< @brief whether the joystick supports being powered off */ + } ATTRIBUTE_PACKED JOYSTICK_INFO; + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_DRIVER_PRIMITIVE_TYPE enum JOYSTICK_DRIVER_PRIMITIVE_TYPE + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Driver primitive type**\n + /// Driver input primitives + /// + /// Mapping lower-level driver values to higher-level controller features is + /// non-injective; two triggers can share a single axis. + /// + /// To handle this, driver values are subdivided into "primitives" that map + /// injectively to higher-level features. + /// + ///@{ + typedef enum JOYSTICK_DRIVER_PRIMITIVE_TYPE + { + /// @brief Driver input primitive type unknown + JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN, + + /// @brief Driver input primitive type button + JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON, + + /// @brief Driver input primitive type hat direction + JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION, + + /// @brief Driver input primitive type semiaxis + JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS, + + /// @brief Driver input primitive type motor + JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, + + /// @brief Driver input primitive type key + JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY, + + /// @brief Driver input primitive type mouse button + JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON, + + /// @brief Driver input primitive type relative pointer direction + JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION, + } JOYSTICK_DRIVER_PRIMITIVE_TYPE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Button primitive + */ + typedef struct JOYSTICK_DRIVER_BUTTON + { + int index; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_BUTTON; + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_DRIVER_HAT_DIRECTION enum JOYSTICK_DRIVER_HAT_DIRECTION + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Driver direction**\n + /// Hat direction. + ///@{ + typedef enum JOYSTICK_DRIVER_HAT_DIRECTION + { + /// @brief Driver hat unknown + JOYSTICK_DRIVER_HAT_UNKNOWN, + + /// @brief Driver hat left + JOYSTICK_DRIVER_HAT_LEFT, + + /// @brief Driver hat right + JOYSTICK_DRIVER_HAT_RIGHT, + + /// @brief Driver hat up + JOYSTICK_DRIVER_HAT_UP, + + /// @brief Driver hat down + JOYSTICK_DRIVER_HAT_DOWN, + } JOYSTICK_DRIVER_HAT_DIRECTION; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Hat direction primitive + */ + typedef struct JOYSTICK_DRIVER_HAT + { + int index; + JOYSTICK_DRIVER_HAT_DIRECTION direction; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_HAT; + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_DRIVER_SEMIAXIS_DIRECTION enum JOYSTICK_DRIVER_SEMIAXIS_DIRECTION + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Driver direction**\n + /// Semiaxis direction. + ///@{ + typedef enum JOYSTICK_DRIVER_SEMIAXIS_DIRECTION + { + /// @brief negative half of the axis + JOYSTICK_DRIVER_SEMIAXIS_NEGATIVE = -1, + + /// @brief unknown direction + JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN = 0, + + /// @brief positive half of the axis + JOYSTICK_DRIVER_SEMIAXIS_POSITIVE = 1, + } JOYSTICK_DRIVER_SEMIAXIS_DIRECTION; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Semiaxis primitive + */ + typedef struct JOYSTICK_DRIVER_SEMIAXIS + { + int index; + int center; + JOYSTICK_DRIVER_SEMIAXIS_DIRECTION direction; + unsigned int range; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_SEMIAXIS; + + /*! + * @brief Motor primitive + */ + typedef struct JOYSTICK_DRIVER_MOTOR + { + int index; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_MOTOR; + + /*! + * @brief Keyboard key primitive + */ + typedef struct JOYSTICK_DRIVER_KEY + { + char keycode[16]; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_KEY; + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_DRIVER_MOUSE_INDEX enum JOYSTICK_DRIVER_MOUSE_INDEX + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Buttons**\n + /// Mouse buttons. + ///@{ + typedef enum JOYSTICK_DRIVER_MOUSE_INDEX + { + /// @brief Mouse index unknown + JOYSTICK_DRIVER_MOUSE_INDEX_UNKNOWN, + + /// @brief Mouse index left + JOYSTICK_DRIVER_MOUSE_INDEX_LEFT, + + /// @brief Mouse index right + JOYSTICK_DRIVER_MOUSE_INDEX_RIGHT, + + /// @brief Mouse index middle + JOYSTICK_DRIVER_MOUSE_INDEX_MIDDLE, + + /// @brief Mouse index button 4 + JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON4, + + /// @brief Mouse index button 5 + JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON5, + + /// @brief Mouse index wheel up + JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_UP, + + /// @brief Mouse index wheel down + JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_DOWN, + + /// @brief Mouse index horizontal wheel left + JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_LEFT, + + /// @brief Mouse index horizontal wheel right + JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_RIGHT, + } JOYSTICK_DRIVER_MOUSE_INDEX; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Mouse button primitive + */ + typedef struct JOYSTICK_DRIVER_MOUSE_BUTTON + { + JOYSTICK_DRIVER_MOUSE_INDEX button; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_MOUSE_BUTTON; + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_DRIVER_RELPOINTER_DIRECTION enum JOYSTICK_DRIVER_RELPOINTER_DIRECTION + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Pointer direction**\n + /// Relative pointer direction + ///@{ + typedef enum JOYSTICK_DRIVER_RELPOINTER_DIRECTION + { + /// @brief Relative pointer direction unknown + JOYSTICK_DRIVER_RELPOINTER_UNKNOWN, + + /// @brief Relative pointer direction left + JOYSTICK_DRIVER_RELPOINTER_LEFT, + + /// @brief Relative pointer direction right + JOYSTICK_DRIVER_RELPOINTER_RIGHT, + + /// @brief Relative pointer direction up + JOYSTICK_DRIVER_RELPOINTER_UP, + + /// @brief Relative pointer direction down + JOYSTICK_DRIVER_RELPOINTER_DOWN, + } JOYSTICK_DRIVER_RELPOINTER_DIRECTION; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Relative pointer direction primitive + */ + typedef struct JOYSTICK_DRIVER_RELPOINTER + { + JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_RELPOINTER; + + /*! + * @brief Driver primitive struct + */ + typedef struct JOYSTICK_DRIVER_PRIMITIVE + { + JOYSTICK_DRIVER_PRIMITIVE_TYPE type; + union + { + struct JOYSTICK_DRIVER_BUTTON button; + struct JOYSTICK_DRIVER_HAT hat; + struct JOYSTICK_DRIVER_SEMIAXIS semiaxis; + struct JOYSTICK_DRIVER_MOTOR motor; + struct JOYSTICK_DRIVER_KEY key; + struct JOYSTICK_DRIVER_MOUSE_BUTTON mouse; + struct JOYSTICK_DRIVER_RELPOINTER relpointer; + }; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_PRIMITIVE; + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_FEATURE_TYPE enum JOYSTICK_FEATURE_TYPE + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Feature type**\n + /// Controller feature. + /// + /// Controller features are an abstraction over driver values. Each feature + /// maps to one or more driver primitives. + /// + ///@{ + typedef enum JOYSTICK_FEATURE_TYPE + { + /// @brief Unknown type + JOYSTICK_FEATURE_TYPE_UNKNOWN, + + /// @brief Type scalar + JOYSTICK_FEATURE_TYPE_SCALAR, + + /// @brief Type analog stick + JOYSTICK_FEATURE_TYPE_ANALOG_STICK, + + /// @brief Type accelerometer + JOYSTICK_FEATURE_TYPE_ACCELEROMETER, + + /// @brief Type motor + JOYSTICK_FEATURE_TYPE_MOTOR, + + /// @brief Type relative pointer + JOYSTICK_FEATURE_TYPE_RELPOINTER, + + /// @brief Type absolut pointer + JOYSTICK_FEATURE_TYPE_ABSPOINTER, + + /// @brief Type wheel + JOYSTICK_FEATURE_TYPE_WHEEL, + + /// @brief Type throttle + JOYSTICK_FEATURE_TYPE_THROTTLE, + + /// @brief Type key + JOYSTICK_FEATURE_TYPE_KEY, + } JOYSTICK_FEATURE_TYPE; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_addon_peripheral_Defs_Joystick_JOYSTICK_FEATURE_PRIMITIVE enum JOYSTICK_FEATURE_PRIMITIVE + /// @ingroup cpp_kodi_addon_peripheral_Defs_Joystick + /// @brief **Feature primitives**\n + /// Indices used to access a feature's driver primitives. + /// + ///@{ + typedef enum JOYSTICK_FEATURE_PRIMITIVE + { + /// @brief Scalar feature (a button, hat direction or semiaxis) + JOYSTICK_SCALAR_PRIMITIVE = 0, + + /// @brief Analog stick up + JOYSTICK_ANALOG_STICK_UP = 0, + /// @brief Analog stick down + JOYSTICK_ANALOG_STICK_DOWN = 1, + /// @brief Analog stick right + JOYSTICK_ANALOG_STICK_RIGHT = 2, + /// @brief Analog stick left + JOYSTICK_ANALOG_STICK_LEFT = 3, + + /// @brief Accelerometer X + JOYSTICK_ACCELEROMETER_POSITIVE_X = 0, + /// @brief Accelerometer Y + JOYSTICK_ACCELEROMETER_POSITIVE_Y = 1, + /// @brief Accelerometer Z + JOYSTICK_ACCELEROMETER_POSITIVE_Z = 2, + + /// @brief Motor + JOYSTICK_MOTOR_PRIMITIVE = 0, + + /// @brief Wheel left + JOYSTICK_WHEEL_LEFT = 0, + /// @brief Wheel right + JOYSTICK_WHEEL_RIGHT = 1, + + /// @brief Throttle up + JOYSTICK_THROTTLE_UP = 0, + /// @brief Throttle down + JOYSTICK_THROTTLE_DOWN = 1, + + /// @brief Key + JOYSTICK_KEY_PRIMITIVE = 0, + + /// @brief Mouse button + JOYSTICK_MOUSE_BUTTON = 0, + + /// @brief Relative pointer direction up + JOYSTICK_RELPOINTER_UP = 0, + /// @brief Relative pointer direction down + JOYSTICK_RELPOINTER_DOWN = 1, + /// @brief Relative pointer direction right + JOYSTICK_RELPOINTER_RIGHT = 2, + /// @brief Relative pointer direction left + JOYSTICK_RELPOINTER_LEFT = 3, + + /// @brief Maximum number of primitives + JOYSTICK_PRIMITIVE_MAX = 4, + } JOYSTICK_FEATURE_PRIMITIVE; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Mapping between higher-level controller feature and its driver primitives + */ + typedef struct JOYSTICK_FEATURE + { + char* name; + JOYSTICK_FEATURE_TYPE type; + struct JOYSTICK_DRIVER_PRIMITIVE primitives[JOYSTICK_PRIMITIVE_MAX]; + } ATTRIBUTE_PACKED JOYSTICK_FEATURE; + //} + + typedef struct AddonProps_Peripheral + { + const char* user_path; /*!< @brief path to the user profile */ + const char* addon_path; /*!< @brief path to this add-on */ + } ATTRIBUTE_PACKED AddonProps_Peripheral; + + struct AddonInstance_Peripheral; + + typedef struct AddonToKodiFuncTable_Peripheral + { + KODI_HANDLE kodiInstance; + void (*trigger_scan)(void* kodiInstance); + void (*refresh_button_maps)(void* kodiInstance, + const char* device_name, + const char* controller_id); + unsigned int (*feature_count)(void* kodiInstance, + const char* controller_id, + JOYSTICK_FEATURE_TYPE type); + JOYSTICK_FEATURE_TYPE(*feature_type) + (void* kodiInstance, const char* controller_id, const char* feature_name); + } AddonToKodiFuncTable_Peripheral; + + //! @todo Mouse, light gun, multitouch + + typedef struct KodiToAddonFuncTable_Peripheral + { + KODI_HANDLE addonInstance; + + void(__cdecl* get_capabilities)(const struct AddonInstance_Peripheral* addonInstance, + struct PERIPHERAL_CAPABILITIES* capabilities); + PERIPHERAL_ERROR(__cdecl* perform_device_scan) + (const struct AddonInstance_Peripheral* addonInstance, + unsigned int* peripheral_count, + struct PERIPHERAL_INFO** scan_results); + void(__cdecl* free_scan_results)(const struct AddonInstance_Peripheral* addonInstance, + unsigned int peripheral_count, + struct PERIPHERAL_INFO* scan_results); + PERIPHERAL_ERROR(__cdecl* get_events) + (const struct AddonInstance_Peripheral* addonInstance, + unsigned int* event_count, + struct PERIPHERAL_EVENT** events); + void(__cdecl* free_events)(const struct AddonInstance_Peripheral* addonInstance, + unsigned int event_count, + struct PERIPHERAL_EVENT* events); + bool(__cdecl* send_event)(const struct AddonInstance_Peripheral* addonInstance, + const struct PERIPHERAL_EVENT* event); + + /// @name Joystick operations + ///{ + PERIPHERAL_ERROR(__cdecl* get_joystick_info) + (const struct AddonInstance_Peripheral* addonInstance, + unsigned int index, + struct JOYSTICK_INFO* info); + void(__cdecl* free_joystick_info)(const struct AddonInstance_Peripheral* addonInstance, + struct JOYSTICK_INFO* info); + PERIPHERAL_ERROR(__cdecl* get_features) + (const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick, + const char* controller_id, + unsigned int* feature_count, + struct JOYSTICK_FEATURE** features); + void(__cdecl* free_features)(const struct AddonInstance_Peripheral* addonInstance, + unsigned int feature_count, + struct JOYSTICK_FEATURE* features); + PERIPHERAL_ERROR(__cdecl* map_features) + (const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick, + const char* controller_id, + unsigned int feature_count, + const struct JOYSTICK_FEATURE* features); + PERIPHERAL_ERROR(__cdecl* get_ignored_primitives) + (const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick, + unsigned int* feature_count, + struct JOYSTICK_DRIVER_PRIMITIVE** primitives); + void(__cdecl* free_primitives)(const struct AddonInstance_Peripheral* addonInstance, + unsigned int, + struct JOYSTICK_DRIVER_PRIMITIVE* primitives); + PERIPHERAL_ERROR(__cdecl* set_ignored_primitives) + (const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick, + unsigned int primitive_count, + const struct JOYSTICK_DRIVER_PRIMITIVE* primitives); + void(__cdecl* save_button_map)(const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick); + void(__cdecl* revert_button_map)(const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick); + void(__cdecl* reset_button_map)(const struct AddonInstance_Peripheral* addonInstance, + const struct JOYSTICK_INFO* joystick, + const char* controller_id); + void(__cdecl* power_off_joystick)(const struct AddonInstance_Peripheral* addonInstance, + unsigned int index); + ///} + } KodiToAddonFuncTable_Peripheral; + + typedef struct AddonInstance_Peripheral + { + struct AddonProps_Peripheral* props; + struct AddonToKodiFuncTable_Peripheral* toKodi; + struct KodiToAddonFuncTable_Peripheral* toAddon; + } AddonInstance_Peripheral; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_ADDONINSTANCE_PERIPHERAL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h new file mode 100644 index 0000000..a50ea2b --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h @@ -0,0 +1,332 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_H +#define C_API_ADDONINSTANCE_PVR_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/CMakeLists.txt new file mode 100644 index 0000000..0e37ea4 --- /dev/null +++ b/xbmc/addons/kodi-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-dev-kit_include_kodi_c-api_addon-instance_pvr) +endif() diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h new file mode 100644 index 0000000..a24d27f --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h @@ -0,0 +1,59 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H +#define C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h new file mode 100644 index 0000000..00daffa --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h @@ -0,0 +1,109 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_CHANNELS_H +#define C_API_ADDONINSTANCE_PVR_CHANNELS_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_CHANNELS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h new file mode 100644 index 0000000..449000f --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h @@ -0,0 +1,66 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_DEFINES_H +#define C_API_ADDONINSTANCE_PVR_DEFINES_H + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_DEFINES_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h new file mode 100644 index 0000000..e7cdf06 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h @@ -0,0 +1,67 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_EDL_H +#define C_API_ADDONINSTANCE_PVR_EDL_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_EDL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h new file mode 100644 index 0000000..d7512dc --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h @@ -0,0 +1,658 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_EPG_H +#define C_API_ADDONINSTANCE_PVR_EPG_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_EPG_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h new file mode 100644 index 0000000..e2136f6 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h @@ -0,0 +1,295 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_GENERAL_H +#define C_API_ADDONINSTANCE_PVR_GENERAL_H + +#include "pvr_defines.h" + +#ifdef BUILD_KODI_ADDON +#include "../../../InputStreamConstants.h" +#else +#include "cores/VideoPlayer/Interface/Addon/InputStreamConstants.h" +#endif + +#include + +//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +// "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_INFO, "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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_GENERAL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h new file mode 100644 index 0000000..2ead263 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h @@ -0,0 +1,77 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_MENUHOOK_H +#define C_API_ADDONINSTANCE_PVR_MENUHOOK_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_MENUHOOK_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h new file mode 100644 index 0000000..2e2c081 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h @@ -0,0 +1,148 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_RECORDINGS_H +#define C_API_ADDONINSTANCE_PVR_RECORDINGS_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_RECORDINGS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h new file mode 100644 index 0000000..1206c67 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h @@ -0,0 +1,160 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_STREAM_H +#define C_API_ADDONINSTANCE_PVR_STREAM_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_STREAM_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h new file mode 100644 index 0000000..209726d --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h @@ -0,0 +1,412 @@ +/* + * 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 + +#ifndef C_API_ADDONINSTANCE_PVR_TIMERS_H +#define C_API_ADDONINSTANCE_PVR_TIMERS_H + +#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 */ + +#endif /* !C_API_ADDONINSTANCE_PVR_TIMERS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h new file mode 100644 index 0000000..32cf6e1 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2005-2020 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 */ + + struct AddonInstance_Screensaver; + + /*! + * @brief Screensaver properties + * + * Not to be used outside this header. + */ + typedef struct AddonProps_Screensaver + { + ADDON_HARDWARE_CONTEXT device; + int x; + int y; + int width; + int height; + float pixelRatio; + const char* name; + const char* presets; + const char* profile; + } AddonProps_Screensaver; + + /*! + * @brief Screensaver callbacks + * + * Not to be used outside this header. + */ + typedef struct AddonToKodiFuncTable_Screensaver + { + KODI_HANDLE kodiInstance; + } AddonToKodiFuncTable_Screensaver; + + /*! + * @brief Screensaver function hooks + * + * Not to be used outside this header. + */ + typedef struct KodiToAddonFuncTable_Screensaver + { + KODI_HANDLE addonInstance; + bool(__cdecl* Start)(struct AddonInstance_Screensaver* instance); + void(__cdecl* Stop)(struct AddonInstance_Screensaver* instance); + void(__cdecl* Render)(struct AddonInstance_Screensaver* instance); + } KodiToAddonFuncTable_Screensaver; + + /*! + * @brief Screensaver instance + * + * Not to be used outside this header. + */ + typedef struct AddonInstance_Screensaver + { + struct AddonProps_Screensaver* props; + struct AddonToKodiFuncTable_Screensaver* toKodi; + struct KodiToAddonFuncTable_Screensaver* toAddon; + } AddonInstance_Screensaver; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h new file mode 100644 index 0000000..a6c3f44 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2005-2020 Team Kodi + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#ifndef C_API_ADDONINSTANCE_VFS_H +#define C_API_ADDONINSTANCE_VFS_H + +#include "../addon_base.h" +#include "../filesystem.h" + +#define VFS_FILE_HANDLE void* + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + struct VFSURL + { + const char* url; + const char* domain; + const char* hostname; + const char* filename; + unsigned int port; + const char* options; + const char* username; + const char* password; + const char* redacted; + const char* sharename; + const char* protocol; + }; + + typedef struct VFSGetDirectoryCallbacks /* internal */ + { + bool(__cdecl* get_keyboard_input)(KODI_HANDLE ctx, + const char* heading, + char** input, + bool hidden_input); + void(__cdecl* set_error_dialog)(KODI_HANDLE ctx, + const char* heading, + const char* line1, + const char* line2, + const char* line3); + void(__cdecl* require_authentication)(KODI_HANDLE ctx, const char* url); + KODI_HANDLE ctx; + } VFSGetDirectoryCallbacks; + + typedef struct AddonProps_VFSEntry /* internal */ + { + int dummy; + } AddonProps_VFSEntry; + + typedef struct AddonToKodiFuncTable_VFSEntry /* internal */ + { + KODI_HANDLE kodiInstance; + } AddonToKodiFuncTable_VFSEntry; + + struct AddonInstance_VFSEntry; + typedef struct KodiToAddonFuncTable_VFSEntry /* internal */ + { + KODI_HANDLE addonInstance; + + VFS_FILE_HANDLE(__cdecl* open) + (const struct AddonInstance_VFSEntry* instance, const struct VFSURL* url); + VFS_FILE_HANDLE(__cdecl* open_for_write) + (const struct AddonInstance_VFSEntry* instance, const struct VFSURL* url, bool overwrite); + ssize_t(__cdecl* read)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + uint8_t* buffer, + size_t buf_size); + ssize_t(__cdecl* write)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + const uint8_t* buffer, + size_t buf_size); + int64_t(__cdecl* seek)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + int64_t position, + int whence); + int(__cdecl* truncate)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + int64_t size); + int64_t(__cdecl* get_length)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context); + int64_t(__cdecl* get_position)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context); + int(__cdecl* get_chunk_size)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context); + bool(__cdecl* io_control_get_seek_possible)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context); + bool(__cdecl* io_control_get_cache_status)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + VFS_CACHE_STATUS_DATA* status); + bool(__cdecl* io_control_set_cache_rate)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + unsigned int rate); + bool(__cdecl* io_control_set_retry)(const struct AddonInstance_VFSEntry* instance, + VFS_FILE_HANDLE context, + bool retry); + int(__cdecl* stat)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url, + struct STAT_STRUCTURE* buffer); + bool(__cdecl* close)(const struct AddonInstance_VFSEntry* instance, VFS_FILE_HANDLE context); + + bool(__cdecl* exists)(const struct AddonInstance_VFSEntry* instance, const struct VFSURL* url); + void(__cdecl* clear_out_idle)(const struct AddonInstance_VFSEntry* instance); + void(__cdecl* disconnect_all)(const struct AddonInstance_VFSEntry* instance); + bool(__cdecl* delete_it)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url); + bool(__cdecl* rename)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url, + const struct VFSURL* url2); + bool(__cdecl* directory_exists)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url); + bool(__cdecl* remove_directory)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url); + bool(__cdecl* create_directory)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url); + bool(__cdecl* get_directory)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url, + struct VFSDirEntry** entries, + int* num_entries, + struct VFSGetDirectoryCallbacks* callbacks); + bool(__cdecl* contains_files)(const struct AddonInstance_VFSEntry* instance, + const struct VFSURL* url, + struct VFSDirEntry** entries, + int* num_entries, + char* rootpath); + void(__cdecl* free_directory)(const struct AddonInstance_VFSEntry* instance, + struct VFSDirEntry* entries, + int num_entries); + } KodiToAddonFuncTable_VFSEntry; + + typedef struct AddonInstance_VFSEntry /* internal */ + { + struct AddonProps_VFSEntry* props; + struct AddonToKodiFuncTable_VFSEntry* toKodi; + struct KodiToAddonFuncTable_VFSEntry* toAddon; + } AddonInstance_VFSEntry; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_ADDONINSTANCE_VFS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h new file mode 100644 index 0000000..913aad8 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2005-2020 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" + +#define VIZ_LYRICS_SIZE 32768 + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + struct VIS_INFO + { + bool bWantsFreq; + int iSyncDelay; + }; + + struct VIS_TRACK + { + const char *title; + const char *artist; + const char *album; + const char *albumArtist; + const char *genre; + const char *comment; + const char *lyrics; + + const char *reserved1; + const char *reserved2; + + int trackNumber; + int discNumber; + int duration; + int year; + int rating; + + int reserved3; + int reserved4; + }; + + typedef struct AddonProps_Visualization + { + ADDON_HARDWARE_CONTEXT device; + int x; + int y; + int width; + int height; + float pixelRatio; + const char* name; + const char* presets; + const char* profile; + } AddonProps_Visualization; + + typedef struct AddonToKodiFuncTable_Visualization + { + KODI_HANDLE kodiInstance; + void(__cdecl* transfer_preset)(KODI_HANDLE kodiInstance, const char* preset); + void(__cdecl* clear_presets)(KODI_HANDLE kodiInstance); + } AddonToKodiFuncTable_Visualization; + + struct AddonInstance_Visualization; + + typedef struct KodiToAddonFuncTable_Visualization + { + KODI_HANDLE addonInstance; + bool(__cdecl* start)(const struct AddonInstance_Visualization* instance, + int channels, + int samples_per_sec, + int bits_per_sample, + const char* song_name); + void(__cdecl* stop)(const struct AddonInstance_Visualization* instance); + + void(__cdecl* get_info)(const struct AddonInstance_Visualization* instance, + struct VIS_INFO* info); + + void(__cdecl* audio_data)(const struct AddonInstance_Visualization* instance, + const float* audio_data, + int audio_data_length, + float* freq_data, + int freq_data_length); + bool(__cdecl* is_dirty)(const struct AddonInstance_Visualization* instance); + void(__cdecl* render)(const struct AddonInstance_Visualization* instance); + + unsigned int(__cdecl* get_presets)(const struct AddonInstance_Visualization* instance); + int(__cdecl* get_active_preset)(const struct AddonInstance_Visualization* instance); + bool(__cdecl* prev_preset)(const struct AddonInstance_Visualization* instance); + bool(__cdecl* next_preset)(const struct AddonInstance_Visualization* instance); + bool(__cdecl* load_preset)(const struct AddonInstance_Visualization* instance, int select); + bool(__cdecl* random_preset)(const struct AddonInstance_Visualization* instance); + bool(__cdecl* lock_preset)(const struct AddonInstance_Visualization* instance); + bool(__cdecl* rate_preset)(const struct AddonInstance_Visualization* instance, bool plus_minus); + bool(__cdecl* is_locked)(const struct AddonInstance_Visualization* instance); + + bool(__cdecl* update_albumart)(const struct AddonInstance_Visualization* instance, + const char* albumart); + bool(__cdecl* update_track)(const struct AddonInstance_Visualization* instance, + const struct VIS_TRACK* track); + } KodiToAddonFuncTable_Visualization; + + typedef struct AddonInstance_Visualization + { + struct AddonProps_Visualization* props; + struct AddonToKodiFuncTable_Visualization* toKodi; + struct KodiToAddonFuncTable_Visualization* toAddon; + } AddonInstance_Visualization; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ -- cgit v1.2.3