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-dev-kit/include/kodi/c-api/CMakeLists.txt | 13 + .../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 ++ .../kodi-dev-kit/include/kodi/c-api/addon_base.h | 264 +++++ .../kodi-dev-kit/include/kodi/c-api/audio_engine.h | 314 +++++ .../kodi-dev-kit/include/kodi/c-api/filesystem.h | 325 ++++++ .../kodi-dev-kit/include/kodi/c-api/general.h | 130 +++ .../include/kodi/c-api/gui/CMakeLists.txt | 8 + .../include/kodi/c-api/gui/controls/CMakeLists.txt | 16 + .../include/kodi/c-api/gui/controls/button.h | 35 + .../include/kodi/c-api/gui/controls/edit.h | 79 ++ .../include/kodi/c-api/gui/controls/fade_label.h | 34 + .../include/kodi/c-api/gui/controls/image.h | 37 + .../include/kodi/c-api/gui/controls/label.h | 32 + .../include/kodi/c-api/gui/controls/progress.h | 32 + .../include/kodi/c-api/gui/controls/radio_button.h | 35 + .../include/kodi/c-api/gui/controls/rendering.h | 38 + .../kodi/c-api/gui/controls/settings_slider.h | 48 + .../include/kodi/c-api/gui/controls/slider.h | 48 + .../include/kodi/c-api/gui/controls/spin.h | 58 + .../include/kodi/c-api/gui/controls/text_box.h | 36 + .../include/kodi/c-api/gui/definitions.h | 106 ++ .../include/kodi/c-api/gui/dialogs/CMakeLists.txt | 14 + .../include/kodi/c-api/gui/dialogs/context_menu.h | 33 + .../kodi/c-api/gui/dialogs/extended_progress.h | 43 + .../include/kodi/c-api/gui/dialogs/filebrowser.h | 77 ++ .../include/kodi/c-api/gui/dialogs/keyboard.h | 74 ++ .../include/kodi/c-api/gui/dialogs/numeric.h | 54 + .../include/kodi/c-api/gui/dialogs/ok.h | 37 + .../include/kodi/c-api/gui/dialogs/progress.h | 45 + .../include/kodi/c-api/gui/dialogs/select.h | 42 + .../include/kodi/c-api/gui/dialogs/text_viewer.h | 30 + .../include/kodi/c-api/gui/dialogs/yes_no.h | 50 + .../kodi-dev-kit/include/kodi/c-api/gui/general.h | 37 + .../include/kodi/c-api/gui/input/CMakeLists.txt | 5 + .../include/kodi/c-api/gui/input/action_ids.h | 763 ++++++++++++ .../include/kodi/c-api/gui/list_item.h | 54 + .../kodi-dev-kit/include/kodi/c-api/gui/window.h | 183 +++ .../kodi-dev-kit/include/kodi/c-api/network.h | 48 + .../include/kodi/c-api/platform/android/system.h | 34 + 59 files changed, 8225 insertions(+) create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/CMakeLists.txt 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 create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/CMakeLists.txt create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/CMakeLists.txt create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/CMakeLists.txt create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/CMakeLists.txt create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h create mode 100644 xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api') diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/CMakeLists.txt new file mode 100644 index 0000000..091e0fe --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/CMakeLists.txt @@ -0,0 +1,13 @@ +set(HEADERS addon_base.h + audio_engine.h + filesystem.h + general.h + network.h) + +if(CORE_SYSTEM_NAME STREQUAL android) + list(APPEND SOURCES platform/android/system.h) +endif() + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-dev-kit_include_kodi_c-api) +endif() 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 */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h new file mode 100644 index 0000000..faa99fa --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h @@ -0,0 +1,264 @@ +/* + * Copyright (C) 2005-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#ifndef C_API_ADDON_BASE_H +#define C_API_ADDON_BASE_H + +#if !defined(NOMINMAX) +#define NOMINMAX +#endif + +#include "stdbool.h" +#include "stdint.h" + +#ifndef TARGET_WINDOWS +#ifndef __cdecl +#define __cdecl +#endif +#ifndef __declspec +#define __declspec(X) +#endif +#endif + +#undef ATTRIBUTE_PACKED +#undef PRAGMA_PACK_BEGIN +#undef PRAGMA_PACK_END + +#if defined(__GNUC__) +#define ATTRIBUTE_PACKED __attribute__((packed)) +#define PRAGMA_PACK 0 +#define ATTRIBUTE_HIDDEN __attribute__((visibility("hidden"))) +#endif + +#if !defined(ATTRIBUTE_PACKED) +#define ATTRIBUTE_PACKED +#define PRAGMA_PACK 1 +#endif + +#if !defined(ATTRIBUTE_HIDDEN) +#define ATTRIBUTE_HIDDEN +#endif + +#ifdef _MSC_VER +#define ATTRIBUTE_FORCEINLINE __forceinline +#elif defined(__GNUC__) +#define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) +#elif defined(__CLANG__) +#if __has_attribute(__always_inline__) +#define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) +#else +#define ATTRIBUTE_FORCEINLINE inline +#endif +#else +#define ATTRIBUTE_FORCEINLINE inline +#endif + +// Hardware specific device context interface +#define ADDON_HARDWARE_CONTEXT void* + +/* + * To have a on add-on and kodi itself handled string always on known size! + */ +#define ADDON_STANDARD_STRING_LENGTH 1024 +#define ADDON_STANDARD_STRING_LENGTH_SMALL 256 + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_addon_addonbase + /// @brief Return value of functions in @ref cpp_kodi_addon_addonbase "kodi::addon::CAddonBase" + /// and associated classes. + /// + ///@{ + typedef enum ADDON_STATUS + { + /// @brief For everything OK and no error + ADDON_STATUS_OK, + + /// @brief A needed connection was lost + ADDON_STATUS_LOST_CONNECTION, + + /// @brief Addon needs a restart inside Kodi + ADDON_STATUS_NEED_RESTART, + + /// @brief Necessary settings are not yet set + ADDON_STATUS_NEED_SETTINGS, + + /// @brief Unknown and incomprehensible error + ADDON_STATUS_UNKNOWN, + + /// @brief Permanent failure, like failing to resolve methods + ADDON_STATUS_PERMANENT_FAILURE, + + /* internal used return error if function becomes not used from child on + * addon */ + ADDON_STATUS_NOT_IMPLEMENTED + } ADDON_STATUS; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_Defs_AddonLog enum AddonLog + /// @ingroup cpp_kodi_Defs + /// @brief **Log file type definitions**\n + /// These define the types of log entries given with @ref kodi::Log() to Kodi. + /// + /// ------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// #include + /// + /// kodi::Log(ADDON_LOG_ERROR, "%s: There is an error occurred!", __func__); + /// + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum AddonLog + { + /// @brief **0** : To include debug information in the log file. + ADDON_LOG_DEBUG = 0, + + /// @brief **1** : To include information messages in the log file. + ADDON_LOG_INFO = 1, + + /// @brief **2** : To write warnings in the log file. + ADDON_LOG_WARNING = 2, + + /// @brief **3** : To report error messages in the log file. + ADDON_LOG_ERROR = 3, + + /// @brief **4** : To notify fatal unrecoverable errors, which can may also indicate + /// upcoming crashes. + ADDON_LOG_FATAL = 4 + } AddonLog; + ///@} + //---------------------------------------------------------------------------- + + /*! @brief Standard undefined pointer handle */ + typedef void* KODI_HANDLE; + + /*! + * @brief Handle used to return data from the PVR add-on to CPVRClient + */ + struct ADDON_HANDLE_STRUCT + { + void* callerAddress; /*!< address of the caller */ + void* dataAddress; /*!< address to store data in */ + int dataIdentifier; /*!< parameter to pass back when calling the callback */ + }; + typedef struct ADDON_HANDLE_STRUCT* ADDON_HANDLE; + + /*! + * @brief Callback function tables from addon to Kodi + * Set complete from Kodi! + */ + struct AddonToKodiFuncTable_kodi; + struct AddonToKodiFuncTable_kodi_audioengine; + struct AddonToKodiFuncTable_kodi_filesystem; + struct AddonToKodiFuncTable_kodi_network; + struct AddonToKodiFuncTable_kodi_gui; + typedef struct AddonToKodiFuncTable_Addon + { + // Pointer inside Kodi, used on callback functions to give related handle + // class, for this ADDON::CAddonDll inside Kodi. + KODI_HANDLE kodiBase; + + // Function addresses used for callbacks from addon to Kodi + char* (*get_type_version)(void* kodiBase, int type); + + void (*free_string)(void* kodiBase, char* str); + void (*free_string_array)(void* kodiBase, char** arr, int numElements); + char* (*get_addon_path)(void* kodiBase); + char* (*get_base_user_path)(void* kodiBase); + void (*addon_log_msg)(void* kodiBase, const int loglevel, const char* msg); + + bool (*get_setting_bool)(void* kodiBase, const char* id, bool* value); + bool (*get_setting_int)(void* kodiBase, const char* id, int* value); + bool (*get_setting_float)(void* kodiBase, const char* id, float* value); + bool (*get_setting_string)(void* kodiBase, const char* id, char** value); + + bool (*set_setting_bool)(void* kodiBase, const char* id, bool value); + bool (*set_setting_int)(void* kodiBase, const char* id, int value); + bool (*set_setting_float)(void* kodiBase, const char* id, float value); + bool (*set_setting_string)(void* kodiBase, const char* id, const char* value); + + void* (*get_interface)(void* kodiBase, const char* name, const char* version); + + struct AddonToKodiFuncTable_kodi* kodi; + struct AddonToKodiFuncTable_kodi_audioengine* kodi_audioengine; + struct AddonToKodiFuncTable_kodi_filesystem* kodi_filesystem; + struct AddonToKodiFuncTable_kodi_gui* kodi_gui; + struct AddonToKodiFuncTable_kodi_network* kodi_network; + + // Move up by min version change about + bool (*is_setting_using_default)(void* kodiBase, const char* id); + } AddonToKodiFuncTable_Addon; + + /*! + * @brief Function tables from Kodi to addon + */ + typedef struct KodiToAddonFuncTable_Addon + { + void (*destroy)(); + ADDON_STATUS (*get_status)(); + ADDON_STATUS(*create_instance) + (int instanceType, + const char* instanceID, + KODI_HANDLE instance, + const char* version, + KODI_HANDLE* addonInstance, + KODI_HANDLE parent); + void (*destroy_instance)(int instanceType, KODI_HANDLE instance); + ADDON_STATUS (*set_setting)(const char* settingName, const void* settingValue); + } KodiToAddonFuncTable_Addon; + + /*! + * @brief Main structure passed from kodi to addon with basic information needed to + * create add-on. + */ + typedef struct AddonGlobalInterface + { + // String with full path where add-on is installed (without his name on end) + // Set from Kodi! + const char* libBasePath; + + // Master API version of Kodi itself (ADDON_GLOBAL_VERSION_MAIN) + const char* kodi_base_api_version; + + // Pointer of first created instance, used in case this add-on goes with single way + // Set from Kodi! + KODI_HANDLE firstKodiInstance; + + // Pointer to master base class inside add-on + // Set from addon header (kodi::addon::CAddonBase)! + KODI_HANDLE addonBase; + + // Pointer to a instance used on single way (together with this class) + // Set from addon header (kodi::addon::IAddonInstance)! + KODI_HANDLE globalSingleInstance; + + // Callback function tables from addon to Kodi + // Set from Kodi! + AddonToKodiFuncTable_Addon* toKodi; + + // Function tables from Kodi to addon + // Set from addon header! + KodiToAddonFuncTable_Addon* toAddon; + } AddonGlobalInterface; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* !C_API_ADDON_BASE_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h new file mode 100644 index 0000000..97510f7 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h @@ -0,0 +1,314 @@ +/* + * Copyright (C) 2005-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#ifndef C_API_AUDIO_ENGINE_H +#define C_API_AUDIO_ENGINE_H + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Definitions, structures and enumerators of audio engine + //{{{ + + //============================================================================ + /// @defgroup cpp_kodi_audioengine_Defs_AudioEngineStreamOptions enum AudioEngineStreamOptions + /// @ingroup cpp_kodi_audioengine_Defs + /// @brief **Bit options to pass to CAEStream**\n + /// A bit field of stream options. + /// + /// + /// ------------------------------------------------------------------------ + /// + /// **Usage example:** + /// ~~~~~~~~~~~~~{.cpp} + /// // Here only as minimal, "format" must be set to wanted types + /// kodi::audioengine::AudioEngineFormat format; + /// m_audioengine = new kodi::audioengine::CAEStream(format, AUDIO_STREAM_FORCE_RESAMPLE | AUDIO_STREAM_AUTOSTART); + /// ~~~~~~~~~~~~~ + /// + ///@{ + typedef enum AudioEngineStreamOptions + { + /// force resample even if rates match + AUDIO_STREAM_FORCE_RESAMPLE = 1 << 0, + /// create the stream paused + AUDIO_STREAM_PAUSED = 1 << 1, + /// autostart the stream when enough data is buffered + AUDIO_STREAM_AUTOSTART = 1 << 2, + } AudioEngineStreamOptions; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_audioengine_Defs_AudioEngineChannel enum AudioEngineChannel + /// @ingroup cpp_kodi_audioengine_Defs + /// @brief **The possible channels**\n + /// Used to set available or used channels on stream. + /// + /// + /// ------------------------------------------------------------------------ + /// + /// **Usage example:** + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::audioengine::AudioEngineFormat format; + /// format.SetChannelLayout(std::vector(AUDIOENGINE_CH_FL, AUDIOENGINE_CH_FR)); + /// ~~~~~~~~~~~~~ + /// + ///@{ + enum AudioEngineChannel + { + /// Used inside to indicate the end of a list and not for addon use directly. + AUDIOENGINE_CH_NULL = -1, + /// RAW Audio format + AUDIOENGINE_CH_RAW, + /// Front left + AUDIOENGINE_CH_FL, + /// Front right + AUDIOENGINE_CH_FR, + /// Front center + AUDIOENGINE_CH_FC, + /// LFE / Subwoofer + AUDIOENGINE_CH_LFE, + /// Back left + AUDIOENGINE_CH_BL, + /// Back right + AUDIOENGINE_CH_BR, + /// Front left over center + AUDIOENGINE_CH_FLOC, + /// Front right over center + AUDIOENGINE_CH_FROC, + /// Back center + AUDIOENGINE_CH_BC, + /// Side left + AUDIOENGINE_CH_SL, + /// Side right + AUDIOENGINE_CH_SR, + /// Top front left + AUDIOENGINE_CH_TFL, + /// Top front right + AUDIOENGINE_CH_TFR, + /// Top front center + AUDIOENGINE_CH_TFC, + /// Top center + AUDIOENGINE_CH_TC, + /// Top back left + AUDIOENGINE_CH_TBL, + /// Top back right + AUDIOENGINE_CH_TBR, + /// Top back center + AUDIOENGINE_CH_TBC, + /// Back left over center + AUDIOENGINE_CH_BLOC, + /// Back right over center + AUDIOENGINE_CH_BROC, + /// Maximum possible value, to use e.g. as size inside list + AUDIOENGINE_CH_MAX + }; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_audioengine_Defs_AudioEngineDataFormat enum AudioEngineDataFormat + /// @ingroup cpp_kodi_audioengine_Defs + /// @brief **Audio sample formats**\n + /// The bit layout of the audio data. + /// + /// LE = Little Endian, BE = Big Endian, NE = Native Endian + /// + /// For planar sample formats, each audio channel is in a separate data plane, + /// and linesize is the buffer size, in bytes, for a single plane. All data + /// planes must be the same size. For packed sample formats, only the first + /// data plane is used, and samples for each channel are interleaved. In this + /// case, linesize is the buffer size, in bytes, for the 1 plane. + /// + /// @note This is ordered from the worst to best preferred formats + /// + /// + /// ------------------------------------------------------------------------ + /// + /// **Usage example:** + /// ~~~~~~~~~~~~~{.cpp} + /// kodi::audioengine::AudioEngineFormat format; + /// format.SetDataFormat(AUDIOENGINE_FMT_FLOATP); + /// ~~~~~~~~~~~~~ + /// + ///@{ + enum AudioEngineDataFormat + { + /// To define format as invalid + AUDIOENGINE_FMT_INVALID = -1, + + /// Unsigned integer 8 bit + AUDIOENGINE_FMT_U8, + + /// Big Endian signed integer 16 bit + AUDIOENGINE_FMT_S16BE, + /// Little Endian signed integer 16 bit + AUDIOENGINE_FMT_S16LE, + /// Native Endian signed integer 16 bit + AUDIOENGINE_FMT_S16NE, + + /// Big Endian signed integer 32 bit + AUDIOENGINE_FMT_S32BE, + /// Little Endian signed integer 32 bit + AUDIOENGINE_FMT_S32LE, + /// Native Endian signed integer 32 bit + AUDIOENGINE_FMT_S32NE, + + /// Big Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24BE4, + /// Little Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24LE4, + /// Native Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24NE4, + /// S32 with bits_per_sample < 32 + AUDIOENGINE_FMT_S24NE4MSB, + + /// Big Endian signed integer 24 bit (3 bytes) + AUDIOENGINE_FMT_S24BE3, + /// Little Endian signed integer 24 bit (3 bytes) + AUDIOENGINE_FMT_S24LE3, + /// Native Endian signed integer 24 bit (3 bytes) + AUDIOENGINE_FMT_S24NE3, + + /// Double floating point + AUDIOENGINE_FMT_DOUBLE, + /// Floating point + AUDIOENGINE_FMT_FLOAT, + + /// **Bitstream**\n + /// RAW Audio format + AUDIOENGINE_FMT_RAW, + + /// **Planar format**\n + /// Unsigned byte + AUDIOENGINE_FMT_U8P, + /// **Planar format**\n + /// Native Endian signed 16 bit + AUDIOENGINE_FMT_S16NEP, + /// **Planar format**\n + /// Native Endian signed 32 bit + AUDIOENGINE_FMT_S32NEP, + /// **Planar format**\n + /// Native Endian signed integer 24 bit (in 4 bytes) + AUDIOENGINE_FMT_S24NE4P, + /// **Planar format**\n + /// S32 with bits_per_sample < 32 + AUDIOENGINE_FMT_S24NE4MSBP, + /// **Planar format**\n + /// Native Endian signed integer 24 bit (in 3 bytes) + AUDIOENGINE_FMT_S24NE3P, + /// **Planar format**\n + /// Double floating point + AUDIOENGINE_FMT_DOUBLEP, + /// **Planar format**\n + /// Floating point + AUDIOENGINE_FMT_FLOATP, + + /// Amount of sample formats. + AUDIOENGINE_FMT_MAX + }; + ///@} + //---------------------------------------------------------------------------- + + /*! + * @brief Internal API structure which are used for data exchange between + * Kodi and addon. + */ + struct AUDIO_ENGINE_FORMAT + { + /*! The stream's data format (eg, AUDIOENGINE_FMT_S16LE) */ + enum AudioEngineDataFormat m_dataFormat; + + /*! The stream's sample rate (eg, 48000) */ + unsigned int m_sampleRate; + + /*! The encoded streams sample rate if a bitstream, otherwise undefined */ + unsigned int m_encodedRate; + + /*! The amount of used speaker channels */ + unsigned int m_channelCount; + + /*! The stream's channel layout */ + enum AudioEngineChannel m_channels[AUDIOENGINE_CH_MAX]; + + /*! The number of frames per period */ + unsigned int m_frames; + + /*! The size of one frame in bytes */ + unsigned int m_frameSize; + }; + + /* A stream handle pointer, which is only used internally by the addon stream handle */ + typedef void AEStreamHandle; + + //}}} + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Internal interface tables for intercommunications between addon and kodi + //{{{ + + /* + * Function address structure, not need to visible on dev kit doxygen + * documentation + */ + typedef struct AddonToKodiFuncTable_kodi_audioengine + { + AEStreamHandle* (*make_stream)(void* kodiBase, + struct AUDIO_ENGINE_FORMAT* format, + unsigned int options); + void (*free_stream)(void* kodiBase, AEStreamHandle* stream); + bool (*get_current_sink_format)(void* kodiBase, struct AUDIO_ENGINE_FORMAT* sink_format); + + // Audio Engine Stream definitions + unsigned int (*aestream_get_space)(void* kodiBase, AEStreamHandle* handle); + unsigned int (*aestream_add_data)(void* kodiBase, + AEStreamHandle* handle, + uint8_t* const* data, + unsigned int offset, + unsigned int frames, + double pts, + bool hasDownmix, + double centerMixLevel); + double (*aestream_get_delay)(void* kodiBase, AEStreamHandle* handle); + bool (*aestream_is_buffering)(void* kodiBase, AEStreamHandle* handle); + double (*aestream_get_cache_time)(void* kodiBase, AEStreamHandle* handle); + double (*aestream_get_cache_total)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_pause)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_resume)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_drain)(void* kodiBase, AEStreamHandle* handle, bool wait); + bool (*aestream_is_draining)(void* kodiBase, AEStreamHandle* handle); + bool (*aestream_is_drained)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_flush)(void* kodiBase, AEStreamHandle* handle); + float (*aestream_get_volume)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_set_volume)(void* kodiBase, AEStreamHandle* handle, float volume); + float (*aestream_get_amplification)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_set_amplification)(void* kodiBase, AEStreamHandle* handle, float amplify); + unsigned int (*aestream_get_frame_size)(void* kodiBase, AEStreamHandle* handle); + unsigned int (*aestream_get_channel_count)(void* kodiBase, AEStreamHandle* handle); + unsigned int (*aestream_get_sample_rate)(void* kodiBase, AEStreamHandle* handle); + enum AudioEngineDataFormat (*aestream_get_data_format)(void* kodiBase, AEStreamHandle* handle); + double (*aestream_get_resample_ratio)(void* kodiBase, AEStreamHandle* handle); + void (*aestream_set_resample_ratio)(void* kodiBase, AEStreamHandle* handle, double ratio); + } AddonToKodiFuncTable_kodi_audioengine; + + //}}} + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* !C_API_AUDIO_ENGINE_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h new file mode 100644 index 0000000..70f9400 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h @@ -0,0 +1,325 @@ +/* + * 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_FILESYSTEM_H +#define C_API_FILESYSTEM_H + +#include +#include +#include + +#ifdef _WIN32 // windows +#ifndef _SSIZE_T_DEFINED +typedef intptr_t ssize_t; +#define _SSIZE_T_DEFINED +#endif // !_SSIZE_T_DEFINED + +// Prevent conflicts with Windows macros where have this names. +#ifdef CreateDirectory +#undef CreateDirectory +#endif // CreateDirectory +#ifdef DeleteFile +#undef DeleteFile +#endif // DeleteFile +#ifdef RemoveDirectory +#undef RemoveDirectory +#endif // RemoveDirectory +#endif // _WIN32 + +#ifdef TARGET_POSIX // Linux, Mac, FreeBSD +#include +#endif // TARGET_POSIX + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Definitions, structures and enumerators of filesystem + //{{{ + + //============================================================================ + /// @defgroup cpp_kodi_vfs_Defs_OpenFileFlags enum OpenFileFlags + /// @ingroup cpp_kodi_vfs_Defs + /// @brief **Flags to define way how file becomes opened**\n + /// The values can be used together, e.g. `file.Open("myfile", ADDON_READ_TRUNCATED | ADDON_READ_CHUNKED);` + /// + /// Used on @ref kodi::vfs::CFile::OpenFile(). + /// + ///@{ + typedef enum OpenFileFlags + { + /// @brief **0000 0000 0001** :\n + /// Indicate that caller can handle truncated reads, where function + /// returns before entire buffer has been filled. + ADDON_READ_TRUNCATED = 0x01, + + /// @brief **0000 0000 0010** :\n + /// Indicate that that caller support read in the minimum defined + /// chunk size, this disables internal cache then. + ADDON_READ_CHUNKED = 0x02, + + /// @brief **0000 0000 0100** :\n + /// Use cache to access this file. + ADDON_READ_CACHED = 0x04, + + /// @brief **0000 0000 1000** :\n + /// Open without caching. regardless to file type. + ADDON_READ_NO_CACHE = 0x08, + + /// @brief **0000 0001 0000** :\n + /// Calcuate bitrate for file while reading. + ADDON_READ_BITRATE = 0x10, + + /// @brief **0000 0010 0000** :\n + /// Indicate to the caller we will seek between multiple streams in + /// the file frequently. + ADDON_READ_MULTI_STREAM = 0x20, + + /// @brief **0000 0100 0000** :\n + /// indicate to the caller file is audio and/or video (and e.g. may + /// grow). + ADDON_READ_AUDIO_VIDEO = 0x40, + + /// @brief **0000 1000 0000** :\n + /// Indicate that caller will do write operations before reading. + ADDON_READ_AFTER_WRITE = 0x80, + + /// @brief **0001 0000 0000** :\n + /// Indicate that caller want to reopen a file if its already open. + ADDON_READ_REOPEN = 0x100 + } OpenFileFlags; + ///@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_vfs_Defs_CURLOptiontype enum CURLOptiontype + /// @ingroup cpp_kodi_vfs_Defs + /// @brief **CURL message types**\n + /// Used on kodi::vfs::CFile::CURLAddOption(). + /// + //@{ + typedef enum CURLOptiontype + { + /// @brief Set a general option. + ADDON_CURL_OPTION_OPTION, + + /// @brief Set a protocol option. + /// + /// The following names for *ADDON_CURL_OPTION_PROTOCOL* are possible: + /// + /// | Option name | Description + /// |------------------------------------:|:-------------------------------- + /// | `accept-charset` | Set the "accept-charset" header + /// | `acceptencoding or encoding` | Set the "accept-encoding" header + /// | `active-remote` | Set the "active-remote" header + /// | `auth` | Set the authentication method. Possible values: any, anysafe, digest, ntlm + /// | `connection-timeout` | Set the connection timeout in seconds + /// | `cookie` | Set the "cookie" header + /// | `customrequest` | Set a custom HTTP request like DELETE + /// | `noshout` | Set to true if kodi detects a stream as shoutcast by mistake. + /// | `postdata` | Set the post body (value needs to be base64 encoded). (Implicitly sets the request to POST) + /// | `referer` | Set the "referer" header + /// | `user-agent` | Set the "user-agent" header + /// | `seekable` | Set the stream seekable. 1: enable, 0: disable + /// | `sslcipherlist` | Set list of accepted SSL ciphers. + /// + ADDON_CURL_OPTION_PROTOCOL, + + /// @brief Set User and password + ADDON_CURL_OPTION_CREDENTIALS, + + /// @brief Add a Header + ADDON_CURL_OPTION_HEADER + } CURLOptiontype; + //@} + //---------------------------------------------------------------------------- + + //============================================================================ + /// @defgroup cpp_kodi_vfs_Defs_FilePropertyTypes enum FilePropertyTypes + /// @ingroup cpp_kodi_vfs_Defs + /// @brief **File property types**\n + /// Mostly to read internet sources. + /// + /// Used on kodi::vfs::CFile::GetPropertyValue() and kodi::vfs::CFile::GetPropertyValues(). + /// + //@{ + typedef enum FilePropertyTypes + { + /// @brief Get protocol response line. + ADDON_FILE_PROPERTY_RESPONSE_PROTOCOL, + /// @brief Get a response header. + ADDON_FILE_PROPERTY_RESPONSE_HEADER, + /// @brief Get file content type. + ADDON_FILE_PROPERTY_CONTENT_TYPE, + /// @brief Get file content charset. + ADDON_FILE_PROPERTY_CONTENT_CHARSET, + /// @brief Get file mime type. + ADDON_FILE_PROPERTY_MIME_TYPE, + /// @brief Get file effective URL (last one if redirected). + ADDON_FILE_PROPERTY_EFFECTIVE_URL + } FilePropertyTypes; + //@} + //---------------------------------------------------------------------------- + + //}}} + + //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + // "C" Internal interface tables for intercommunications between addon and kodi + //{{{ + + struct KODI_HTTP_HEADER + { + void* handle; + + char* (*get_value)(void* kodiBase, void* handle, const char* param); + char** (*get_values)(void* kodiBase, void* handle, const char* param, int* length); + char* (*get_header)(void* kodiBase, void* handle); + char* (*get_mime_type)(void* kodiBase, void* handle); + char* (*get_charset)(void* kodiBase, void* handle); + char* (*get_proto_line)(void* kodiBase, void* handle); + }; + + struct STAT_STRUCTURE + { + /// ID of device containing file + uint32_t deviceId; + /// Total size, in bytes + uint64_t size; + /// Time of last access + time_t accessTime; + /// Time of last modification + time_t modificationTime; + /// Time of last status change + time_t statusTime; + /// The stat url is a directory + bool isDirectory; + /// The stat url is a symbolic link + bool isSymLink; + /// The stat url is block special + bool isBlock; + /// The stat url is character special + bool isCharacter; + /// The stat url is FIFO special + bool isFifo; + /// The stat url is regular + bool isRegular; + /// The stat url is socket + bool isSocket; + /// The file serial number, which distinguishes this file from all other files on the same + /// device. + uint64_t fileSerialNumber; + }; + + struct VFS_CACHE_STATUS_DATA + { + uint64_t forward; + unsigned int maxrate; + unsigned int currate; + bool lowspeed; + }; + + struct VFSProperty + { + char* name; + char* val; + }; + + struct VFSDirEntry + { + char* label; //!< item label + char* title; //!< item title + char* path; //!< item path + unsigned int num_props; //!< Number of properties attached to item + struct VFSProperty* properties; //!< Properties + time_t date_time; //!< file creation date & time + bool folder; //!< Item is a folder + uint64_t size; //!< Size of file represented by item + }; + + typedef struct AddonToKodiFuncTable_kodi_filesystem + { + bool (*can_open_directory)(void* kodiBase, const char* url); + bool (*create_directory)(void* kodiBase, const char* path); + bool (*remove_directory)(void* kodiBase, const char* path); + bool (*directory_exists)(void* kodiBase, const char* path); + bool (*get_directory)(void* kodiBase, + const char* path, + const char* mask, + struct VFSDirEntry** items, + unsigned int* num_items); + void (*free_directory)(void* kodiBase, struct VFSDirEntry* items, unsigned int num_items); + + bool (*file_exists)(void* kodiBase, const char* filename, bool useCache); + bool (*stat_file)(void* kodiBase, const char* filename, struct STAT_STRUCTURE* buffer); + bool (*delete_file)(void* kodiBase, const char* filename); + bool (*rename_file)(void* kodiBase, const char* filename, const char* newFileName); + bool (*copy_file)(void* kodiBase, const char* filename, const char* dest); + + char* (*get_file_md5)(void* kodiBase, const char* filename); + char* (*get_cache_thumb_name)(void* kodiBase, const char* filename); + char* (*make_legal_filename)(void* kodiBase, const char* filename); + char* (*make_legal_path)(void* kodiBase, const char* path); + char* (*translate_special_protocol)(void* kodiBase, const char* strSource); + bool (*is_internet_stream)(void* kodiBase, const char* path, bool strictCheck); + bool (*is_on_lan)(void* kodiBase, const char* path); + bool (*is_remote)(void* kodiBase, const char* path); + bool (*is_local)(void* kodiBase, const char* path); + bool (*is_url)(void* kodiBase, const char* path); + bool (*get_http_header)(void* kodiBase, const char* url, struct KODI_HTTP_HEADER* headers); + bool (*get_mime_type)(void* kodiBase, const char* url, char** content, const char* useragent); + bool (*get_content_type)(void* kodiBase, + const char* url, + char** content, + const char* useragent); + bool (*get_cookies)(void* kodiBase, const char* url, char** cookies); + bool (*http_header_create)(void* kodiBase, struct KODI_HTTP_HEADER* headers); + void (*http_header_free)(void* kodiBase, struct KODI_HTTP_HEADER* headers); + + void* (*open_file)(void* kodiBase, const char* filename, unsigned int flags); + void* (*open_file_for_write)(void* kodiBase, const char* filename, bool overwrite); + ssize_t (*read_file)(void* kodiBase, void* file, void* ptr, size_t size); + bool (*read_file_string)(void* kodiBase, void* file, char* szLine, int iLineLength); + ssize_t (*write_file)(void* kodiBase, void* file, const void* ptr, size_t size); + void (*flush_file)(void* kodiBase, void* file); + int64_t (*seek_file)(void* kodiBase, void* file, int64_t position, int whence); + int (*truncate_file)(void* kodiBase, void* file, int64_t size); + int64_t (*get_file_position)(void* kodiBase, void* file); + int64_t (*get_file_length)(void* kodiBase, void* file); + double (*get_file_download_speed)(void* kodiBase, void* file); + void (*close_file)(void* kodiBase, void* file); + int (*get_file_chunk_size)(void* kodiBase, void* file); + bool (*io_control_get_seek_possible)(void* kodiBase, void* file); + bool (*io_control_get_cache_status)(void* kodiBase, + void* file, + struct VFS_CACHE_STATUS_DATA* status); + bool (*io_control_set_cache_rate)(void* kodiBase, void* file, unsigned int rate); + bool (*io_control_set_retry)(void* kodiBase, void* file, bool retry); + char** (*get_property_values)( + void* kodiBase, void* file, int type, const char* name, int* numValues); + + void* (*curl_create)(void* kodiBase, const char* url); + bool (*curl_add_option)( + void* kodiBase, void* file, int type, const char* name, const char* value); + bool (*curl_open)(void* kodiBase, void* file, unsigned int flags); + + bool (*get_disk_space)( + void* kodiBase, const char* path, uint64_t* capacity, uint64_t* free, uint64_t* available); + bool (*remove_directory_recursive)(void* kodiBase, const char* path); + } AddonToKodiFuncTable_kodi_filesystem; + + //}}} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_FILESYSTEM_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h new file mode 100644 index 0000000..12afd02 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h @@ -0,0 +1,130 @@ +/* + * 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_GENERAL_H +#define C_API_GENERAL_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// \ingroup cpp_kodi_Defs + /// @brief For kodi::CurrentKeyboardLayout used defines + /// + typedef enum StdKbButtons + { + /// The quantity of buttons per row on Kodi's standard keyboard + STD_KB_BUTTONS_PER_ROW = 20, + /// The quantity of rows on Kodi's standard keyboard + STD_KB_BUTTONS_MAX_ROWS = 4, + /// Keyboard layout type, this for initial standard + STD_KB_MODIFIER_KEY_NONE = 0x00, + /// Keyboard layout type, this for shift controled layout (uppercase) + STD_KB_MODIFIER_KEY_SHIFT = 0x01, + /// Keyboard layout type, this to show symbols + STD_KB_MODIFIER_KEY_SYMBOL = 0x02 + } StdKbButtons; + //---------------------------------------------------------------------------- + + //============================================================================ + /// \ingroup cpp_kodi_Defs + /// @brief For kodi::QueueNotification() used message types + /// + typedef enum QueueMsg + { + /// Show info notification message + QUEUE_INFO, + /// Show warning notification message + QUEUE_WARNING, + /// Show error notification message + QUEUE_ERROR, + /// Show with own given image and parts if set on values + QUEUE_OWN_STYLE + } QueueMsg; + //---------------------------------------------------------------------------- + + //============================================================================ + /// \ingroup cpp_kodi_Defs + /// @brief Format codes to get string from them. + /// + /// Used on kodi::GetLanguage(). + /// + typedef enum LangFormats + { + /// two letter code as defined in ISO 639-1 + LANG_FMT_ISO_639_1, + /// three letter code as defined in ISO 639-2/T or ISO 639-2/B + LANG_FMT_ISO_639_2, + /// full language name in English + LANG_FMT_ENGLISH_NAME + } LangFormats; + //---------------------------------------------------------------------------- + + /* + * For interface between add-on and kodi. + * + * This structure defines the addresses of functions stored inside Kodi which + * are then available for the add-on to call + * + * All function pointers there are used by the C++ interface functions below. + * You find the set of them on xbmc/addons/interfaces/General.cpp + * + * Note: For add-on development itself this is not needed + */ + typedef struct AddonKeyboardKeyTable + { + char* keys[STD_KB_BUTTONS_MAX_ROWS][STD_KB_BUTTONS_PER_ROW]; + } AddonKeyboardKeyTable; + typedef struct AddonToKodiFuncTable_kodi + { + char* (*get_addon_info)(void* kodiBase, const char* id); + bool (*open_settings_dialog)(void* kodiBase); + char* (*unknown_to_utf8)(void* kodiBase, const char* source, bool* ret, bool failOnBadChar); + char* (*get_localized_string)(void* kodiBase, long label_id); + char* (*get_language)(void* kodiBase, int format, bool region); + bool (*queue_notification)(void* kodiBase, + int type, + const char* header, + const char* message, + const char* imageFile, + unsigned int displayTime, + bool withSound, + unsigned int messageTime); + void (*get_md5)(void* kodiBase, const char* text, char* md5); + char* (*get_temp_path)(void* kodiBase); + char* (*get_region)(void* kodiBase, const char* id); + void (*get_free_mem)(void* kodiBase, long* free, long* total, bool as_bytes); + int (*get_global_idle_time)(void* kodiBase); + bool (*is_addon_avilable)(void* kodiBase, const char* id, char** version, bool* enabled); + void (*kodi_version)(void* kodiBase, + char** compile_name, + int* major, + int* minor, + char** revision, + char** tag, + char** tagversion); + char* (*get_current_skin_id)(void* kodiBase); + bool (*get_keyboard_layout)(void* kodiBase, + char** layout_name, + int modifier_key, + struct AddonKeyboardKeyTable* layout); + bool (*change_keyboard_layout)(void* kodiBase, char** layout_name); + } AddonToKodiFuncTable_kodi; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GENERAL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/CMakeLists.txt new file mode 100644 index 0000000..53c4e60 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/CMakeLists.txt @@ -0,0 +1,8 @@ +set(HEADERS definitions.h + general.h + list_item.h + window.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-dev-kit_include_kodi_c-api_gui) +endif() diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/CMakeLists.txt new file mode 100644 index 0000000..2e6cd53 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/CMakeLists.txt @@ -0,0 +1,16 @@ +set(HEADERS button.h + edit.h + fade_label.h + image.h + label.h + progress.h + radio_button.h + rendering.h + settings_slider.h + slider.h + spin.h + text_box.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-dev-kit_include_kodi_c-api_gui_controls) +endif() diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h new file mode 100644 index 0000000..84fd822 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h @@ -0,0 +1,35 @@ +/* + * 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_GUI_CONTROLS_BUTTON_H +#define C_API_GUI_CONTROLS_BUTTON_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_button + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_enabled)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool enabled); + void (*set_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* label); + char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_label2)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* label); + char* (*get_label2)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_control_button; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_BUTTON_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h new file mode 100644 index 0000000..ca38b27 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h @@ -0,0 +1,79 @@ +/* + * 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_GUI_CONTROLS_EDIT_H +#define C_API_GUI_CONTROLS_EDIT_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + //============================================================================ + /// @ingroup cpp_kodi_gui_windows_controls_CEdit_Defs + /// @{ + /// @anchor AddonGUIInputType + /// @brief Text input types used on kodi::gui::controls::CEdit + enum AddonGUIInputType + { + /// Text inside edit control only readable + ADDON_INPUT_TYPE_READONLY = -1, + /// Normal text entries + ADDON_INPUT_TYPE_TEXT = 0, + /// To use on edit control only numeric numbers + ADDON_INPUT_TYPE_NUMBER, + /// To insert seconds + ADDON_INPUT_TYPE_SECONDS, + /// To insert time + ADDON_INPUT_TYPE_TIME, + /// To insert a date + ADDON_INPUT_TYPE_DATE, + /// Used for write in IP addresses + ADDON_INPUT_TYPE_IPADDRESS, + /// Text field used as password entry field with not visible text + ADDON_INPUT_TYPE_PASSWORD, + /// Text field used as password entry field with not visible text but + /// returned as MD5 value + ADDON_INPUT_TYPE_PASSWORD_MD5, + /// Use text field for search purpose + ADDON_INPUT_TYPE_SEARCH, + /// Text field as filter + ADDON_INPUT_TYPE_FILTER, + /// + ADDON_INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW + }; + /// @} + //---------------------------------------------------------------------------- + + typedef struct AddonToKodiFuncTable_kodi_gui_control_edit + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_enabled)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool enabled); + void (*set_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* label); + char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_text)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); + char* (*get_text)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_cursor_position)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + unsigned int position); + unsigned int (*get_cursor_position)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_input_type)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + int type, + const char* heading); + } AddonToKodiFuncTable_kodi_gui_control_edit; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_EDIT_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h new file mode 100644 index 0000000..fea014b --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h @@ -0,0 +1,34 @@ +/* + * 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_GUI_CONTROLS_FADE_LABEL_H +#define C_API_GUI_CONTROLS_FADE_LABEL_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_fade_label + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*add_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); + char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_scrolling)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool scroll); + void (*reset)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_control_fade_label; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_FADE_LABEL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h new file mode 100644 index 0000000..4a46e6d --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h @@ -0,0 +1,37 @@ +/* + * 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_GUI_CONTROLS_IMAGE_H +#define C_API_GUI_CONTROLS_IMAGE_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_image + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_filename)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + const char* filename, + bool use_cache); + void (*set_color_diffuse)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + uint32_t color_diffuse); + } AddonToKodiFuncTable_kodi_gui_control_image; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_IMAGE_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h new file mode 100644 index 0000000..d8a9fe4 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h @@ -0,0 +1,32 @@ +/* + * 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_GUI_CONTROLS_LABEL_H +#define C_API_GUI_CONTROLS_LABEL_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_label + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); + char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_control_label; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_LABEL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h new file mode 100644 index 0000000..88638e0 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h @@ -0,0 +1,32 @@ +/* + * 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_GUI_CONTROLS_PROGRESS_H +#define C_API_GUI_CONTROLS_PROGRESS_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_progress + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_percentage)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, float percent); + float (*get_percentage)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_control_progress; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_PROGRESS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h new file mode 100644 index 0000000..a672d95 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h @@ -0,0 +1,35 @@ +/* + * 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_GUI_CONTROLS_RADIO_BUTTON_H +#define C_API_GUI_CONTROLS_RADIO_BUTTON_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_radio_button + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_enabled)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool enabled); + void (*set_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); + char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_selected)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool selected); + bool (*is_selected)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_control_radio_button; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_RADIO_BUTTON_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h new file mode 100644 index 0000000..d4053a6 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h @@ -0,0 +1,38 @@ +/* + * 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_GUI_CONTROLS_RENDERING_H +#define C_API_GUI_CONTROLS_RENDERING_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_rendering + { + void (*set_callbacks)( + KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + KODI_GUI_CLIENT_HANDLE clienthandle, + bool (*createCB)(KODI_GUI_CLIENT_HANDLE, int, int, int, int, ADDON_HARDWARE_CONTEXT), + void (*renderCB)(KODI_GUI_CLIENT_HANDLE), + void (*stopCB)(KODI_GUI_CLIENT_HANDLE), + bool (*dirtyCB)(KODI_GUI_CLIENT_HANDLE)); + void (*destroy)(void* kodiBase, KODI_GUI_CONTROL_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_control_rendering; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_RENDERING_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h new file mode 100644 index 0000000..2cbc972 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h @@ -0,0 +1,48 @@ +/* + * 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_GUI_CONTROLS_SETTINGS_SLIDER_H +#define C_API_GUI_CONTROLS_SETTINGS_SLIDER_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_settings_slider + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_enabled)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool enabled); + void (*set_text)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* label); + void (*reset)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_int_range)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int start, int end); + void (*set_int_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int value); + int (*get_int_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_int_interval)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int interval); + void (*set_percentage)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, float percent); + float (*get_percentage)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_float_range)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + float start, + float end); + void (*set_float_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, float value); + float (*get_float_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_float_interval)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + float interval); + } AddonToKodiFuncTable_kodi_gui_control_settings_slider; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_SETTINGS_SLIDER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h new file mode 100644 index 0000000..0a67208 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h @@ -0,0 +1,48 @@ +/* + * 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_GUI_CONTROLS_SLIDER_H +#define C_API_GUI_CONTROLS_SLIDER_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_slider + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_enabled)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool enabled); + void (*reset)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + char* (*get_description)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_int_range)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int start, int end); + void (*set_int_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int value); + int (*get_int_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_int_interval)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int interval); + void (*set_percentage)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, float percent); + float (*get_percentage)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_float_range)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + float start, + float end); + void (*set_float_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, float value); + float (*get_float_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_float_interval)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + float interval); + } AddonToKodiFuncTable_kodi_gui_control_slider; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_SLIDER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h new file mode 100644 index 0000000..d5e5c86 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h @@ -0,0 +1,58 @@ +/* + * 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_GUI_CONTROLS_SPIN_H +#define C_API_GUI_CONTROLS_SPIN_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_spin + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*set_enabled)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool enabled); + void (*set_text)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); + void (*reset)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_type)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int type); + void (*add_string_label)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + const char* label, + const char* value); + void (*set_string_value)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + const char* value); + char* (*get_string_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*add_int_label)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + const char* label, + int value); + void (*set_int_range)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int start, int end); + void (*set_int_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int value); + int (*get_int_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_float_range)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + float start, + float end); + void (*set_float_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, float value); + float (*get_float_value)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_float_interval)(KODI_HANDLE kodiBase, + KODI_GUI_CONTROL_HANDLE handle, + float interval); + } AddonToKodiFuncTable_kodi_gui_control_spin; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_SPIN_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h new file mode 100644 index 0000000..276d04c --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h @@ -0,0 +1,36 @@ +/* + * 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_GUI_CONTROLS_TEXT_BOX_H +#define C_API_GUI_CONTROLS_TEXT_BOX_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_control_text_box + { + void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); + void (*reset)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*set_text)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); + char* (*get_text)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); + void (*scroll)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, unsigned int scroll); + void (*set_auto_scrolling)( + KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, int delay, int time, int repeat); + } AddonToKodiFuncTable_kodi_gui_control_text_box; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_CONTROLS_TEXT_BOX_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h new file mode 100644 index 0000000..ec60bc2 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h @@ -0,0 +1,106 @@ +/* + * 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_GUI_DEFINITIONS_H +#define C_API_GUI_DEFINITIONS_H + +#include "../addon_base.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef void* KODI_GUI_HANDLE; + typedef void* KODI_GUI_CLIENT_HANDLE; + typedef void* KODI_GUI_CONTROL_HANDLE; + typedef void* KODI_GUI_LISTITEM_HANDLE; + typedef void* KODI_GUI_WINDOW_HANDLE; + + struct AddonToKodiFuncTable_kodi_gui_general; + struct AddonToKodiFuncTable_kodi_gui_control_button; + struct AddonToKodiFuncTable_kodi_gui_control_edit; + struct AddonToKodiFuncTable_kodi_gui_control_fade_label; + struct AddonToKodiFuncTable_kodi_gui_control_label; + struct AddonToKodiFuncTable_kodi_gui_control_image; + struct AddonToKodiFuncTable_kodi_gui_control_progress; + struct AddonToKodiFuncTable_kodi_gui_control_radio_button; + struct AddonToKodiFuncTable_kodi_gui_control_rendering; + struct AddonToKodiFuncTable_kodi_gui_control_settings_slider; + struct AddonToKodiFuncTable_kodi_gui_control_slider; + struct AddonToKodiFuncTable_kodi_gui_control_spin; + struct AddonToKodiFuncTable_kodi_gui_control_text_box; + struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu; + struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress; + struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser; + struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard; + struct AddonToKodiFuncTable_kodi_gui_dialogNumeric; + struct AddonToKodiFuncTable_kodi_gui_dialogOK; + struct AddonToKodiFuncTable_kodi_gui_dialogProgress; + struct AddonToKodiFuncTable_kodi_gui_dialogSelect; + struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer; + struct AddonToKodiFuncTable_kodi_gui_dialogYesNo; + struct AddonToKodiFuncTable_kodi_gui_listItem; + struct AddonToKodiFuncTable_kodi_gui_window; + + typedef struct AddonToKodiFuncTable_kodi_gui + { + struct AddonToKodiFuncTable_kodi_gui_general* general; + struct AddonToKodiFuncTable_kodi_gui_control_button* control_button; + struct AddonToKodiFuncTable_kodi_gui_control_edit* control_edit; + struct AddonToKodiFuncTable_kodi_gui_control_fade_label* control_fade_label; + struct AddonToKodiFuncTable_kodi_gui_control_label* control_label; + struct AddonToKodiFuncTable_kodi_gui_control_image* control_image; + struct AddonToKodiFuncTable_kodi_gui_control_progress* control_progress; + struct AddonToKodiFuncTable_kodi_gui_control_radio_button* control_radio_button; + struct AddonToKodiFuncTable_kodi_gui_control_rendering* control_rendering; + struct AddonToKodiFuncTable_kodi_gui_control_settings_slider* control_settings_slider; + struct AddonToKodiFuncTable_kodi_gui_control_slider* control_slider; + struct AddonToKodiFuncTable_kodi_gui_control_spin* control_spin; + struct AddonToKodiFuncTable_kodi_gui_control_text_box* control_text_box; + KODI_HANDLE control_dummy1; + KODI_HANDLE control_dummy2; + KODI_HANDLE control_dummy3; + KODI_HANDLE control_dummy4; + KODI_HANDLE control_dummy5; + KODI_HANDLE control_dummy6; + KODI_HANDLE control_dummy7; + KODI_HANDLE control_dummy8; + KODI_HANDLE control_dummy9; + KODI_HANDLE control_dummy10; /* This and above used to add new controls */ + struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu* dialogContextMenu; + struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress* dialogExtendedProgress; + struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser* dialogFileBrowser; + struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard* dialogKeyboard; + struct AddonToKodiFuncTable_kodi_gui_dialogNumeric* dialogNumeric; + struct AddonToKodiFuncTable_kodi_gui_dialogOK* dialogOK; + struct AddonToKodiFuncTable_kodi_gui_dialogProgress* dialogProgress; + struct AddonToKodiFuncTable_kodi_gui_dialogSelect* dialogSelect; + struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer* dialogTextViewer; + struct AddonToKodiFuncTable_kodi_gui_dialogYesNo* dialogYesNo; + KODI_HANDLE dialog_dummy1; + KODI_HANDLE dialog_dummy2; + KODI_HANDLE dialog_dummy3; + KODI_HANDLE dialog_dummy4; + KODI_HANDLE dialog_dummy5; + KODI_HANDLE dialog_dummy6; + KODI_HANDLE dialog_dummy7; + KODI_HANDLE dialog_dummy8; + KODI_HANDLE dialog_dummy9; + KODI_HANDLE dialog_dummy10; /* This and above used to add new dialogs */ + struct AddonToKodiFuncTable_kodi_gui_listItem* listItem; + struct AddonToKodiFuncTable_kodi_gui_window* window; + } AddonToKodiFuncTable_kodi_gui; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DEFINITIONS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/CMakeLists.txt new file mode 100644 index 0000000..bc35e91 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/CMakeLists.txt @@ -0,0 +1,14 @@ +set(HEADERS context_menu.h + extended_progress.h + filebrowser.h + keyboard.h + numeric.h + ok.h + progress.h + select.h + text_viewer.h + yes_no.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-dev-kit_include_kodi_c-api_gui_dialogs) +endif() diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h new file mode 100644 index 0000000..8bb5370 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h @@ -0,0 +1,33 @@ +/* + * 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_GUI_DIALOGS_CONTEXT_MENU_H +#define C_API_GUI_DIALOGS_CONTEXT_MENU_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu + { + int (*open)(KODI_HANDLE kodiBase, + const char* heading, + const char* entries[], + unsigned int size); + } AddonToKodiFuncTable_kodi_gui_dialogContextMenu; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_CONTEXT_MENU_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h new file mode 100644 index 0000000..e53588f --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h @@ -0,0 +1,43 @@ +/* + * 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_GUI_DIALOGS_EXTENDED_PROGRESS_H +#define C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress + { + KODI_GUI_HANDLE (*new_dialog)(KODI_HANDLE kodiBase, const char* title); + void (*delete_dialog)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + char* (*get_title)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*set_title)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, const char* title); + char* (*get_text)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*set_text)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, const char* text); + bool (*is_finished)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*mark_finished)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + float (*get_percentage)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*set_percentage)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, float percentage); + void (*set_progress)(KODI_HANDLE kodiBase, + KODI_GUI_HANDLE handle, + int currentItem, + int itemCount); + } AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h new file mode 100644 index 0000000..7ae4fac --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h @@ -0,0 +1,77 @@ +/* + * 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_GUI_DIALOGS_FILEBROWSER_H +#define C_API_GUI_DIALOGS_FILEBROWSER_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser + { + bool (*show_and_get_directory)(KODI_HANDLE kodiBase, + const char* shares, + const char* heading, + const char* path_in, + char** path_out, + bool writeOnly); + bool (*show_and_get_file)(KODI_HANDLE kodiBase, + const char* shares, + const char* mask, + const char* heading, + const char* path_in, + char** path_out, + bool use_thumbs, + bool use_file_directories); + bool (*show_and_get_file_from_dir)(KODI_HANDLE kodiBase, + const char* directory, + const char* mask, + const char* heading, + const char* path_in, + char** path_out, + bool use_thumbs, + bool use_file_directories, + bool singleList); + bool (*show_and_get_file_list)(KODI_HANDLE kodiBase, + const char* shares, + const char* mask, + const char* heading, + char*** file_list, + unsigned int* entries, + bool use_thumbs, + bool use_file_directories); + bool (*show_and_get_source)(KODI_HANDLE kodiBase, + const char* path_in, + char** path_out, + bool allow_network_shares, + const char* additional_share, + const char* type); + bool (*show_and_get_image)(KODI_HANDLE kodiBase, + const char* shares, + const char* heading, + const char* path_in, + char** path_out); + bool (*show_and_get_image_list)(KODI_HANDLE kodiBase, + const char* shares, + const char* heading, + char*** file_list, + unsigned int* entries); + void (*clear_file_list)(KODI_HANDLE kodiBase, char*** file_list, unsigned int entries); + } AddonToKodiFuncTable_kodi_gui_dialogFileBrowser; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_FILEBROWSER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h new file mode 100644 index 0000000..fc3c34c --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h @@ -0,0 +1,74 @@ +/* + * 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_GUI_DIALOGS_KEYBOARD_H +#define C_API_GUI_DIALOGS_KEYBOARD_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard + { + bool (*show_and_get_input_with_head)(KODI_HANDLE kodiBase, + const char* text_in, + char** text_out, + const char* heading, + bool allow_empty_result, + bool hiddenInput, + unsigned int auto_close_ms); + bool (*show_and_get_input)(KODI_HANDLE kodiBase, + const char* text_in, + char** text_out, + bool allow_empty_result, + unsigned int auto_close_ms); + bool (*show_and_get_new_password_with_head)(KODI_HANDLE kodiBase, + const char* password_in, + char** password_out, + const char* heading, + bool allow_empty_result, + unsigned int auto_close_ms); + bool (*show_and_get_new_password)(KODI_HANDLE kodiBase, + const char* password_in, + char** password_out, + unsigned int auto_close_ms); + bool (*show_and_verify_new_password_with_head)(KODI_HANDLE kodiBase, + char** password_out, + const char* heading, + bool allow_empty_result, + unsigned int auto_close_ms); + bool (*show_and_verify_new_password)(KODI_HANDLE kodiBase, + char** password_out, + unsigned int auto_close_ms); + int (*show_and_verify_password)(KODI_HANDLE kodiBase, + const char* password_in, + char** password_out, + const char* heading, + int retries, + unsigned int auto_close_ms); + bool (*show_and_get_filter)(KODI_HANDLE kodiBase, + const char* text_in, + char** text_out, + bool searching, + unsigned int auto_close_ms); + bool (*send_text_to_active_keyboard)(KODI_HANDLE kodiBase, + const char* text, + bool close_keyboard); + bool (*is_keyboard_activated)(KODI_HANDLE kodiBase); + } AddonToKodiFuncTable_kodi_gui_dialogKeyboard; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_KEYBOARD_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h new file mode 100644 index 0000000..df23cd7 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h @@ -0,0 +1,54 @@ +/* + * 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_GUI_DIALOGS_NUMERIC_H +#define C_API_GUI_DIALOGS_NUMERIC_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogNumeric + { + bool (*show_and_verify_new_password)(KODI_HANDLE kodiBase, char** password); + int (*show_and_verify_password)(KODI_HANDLE kodiBase, + const char* password, + const char* heading, + int retries); + bool (*show_and_verify_input)(KODI_HANDLE kodiBase, + const char* verify_in, + char** verify_out, + const char* heading, + bool verify_input); + bool (*show_and_get_time)(KODI_HANDLE kodiBase, struct tm* time, const char* heading); + bool (*show_and_get_date)(KODI_HANDLE kodiBase, struct tm* date, const char* heading); + bool (*show_and_get_ip_address)(KODI_HANDLE kodiBase, + const char* ip_address_in, + char** ip_address_out, + const char* heading); + bool (*show_and_get_number)(KODI_HANDLE kodiBase, + const char* input_in, + char** input_out, + const char* heading, + unsigned int auto_close_ms); + bool (*show_and_get_seconds)(KODI_HANDLE kodiBase, + const char* time_in, + char** time_out, + const char* heading); + } AddonToKodiFuncTable_kodi_gui_dialogNumeric; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_NUMERIC_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h new file mode 100644 index 0000000..9f37051 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h @@ -0,0 +1,37 @@ +/* + * 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_GUI_DIALOGS_OK_H +#define C_API_GUI_DIALOGS_OK_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogOK + { + void (*show_and_get_input_single_text)(KODI_HANDLE kodiBase, + const char* heading, + const char* text); + void (*show_and_get_input_line_text)(KODI_HANDLE kodiBase, + const char* heading, + const char* line0, + const char* line1, + const char* line2); + } AddonToKodiFuncTable_kodi_gui_dialogOK; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_OK_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h new file mode 100644 index 0000000..f1c8972 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h @@ -0,0 +1,45 @@ +/* + * 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_GUI_DIALOGS_PROGRESS_H +#define C_API_GUI_DIALOGS_PROGRESS_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogProgress + { + KODI_GUI_HANDLE (*new_dialog)(KODI_HANDLE kodiBase); + void (*delete_dialog)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*open)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*set_heading)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, const char* heading); + void (*set_line)(KODI_HANDLE kodiBase, + KODI_GUI_HANDLE handle, + unsigned int lineNo, + const char* line); + void (*set_can_cancel)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, bool canCancel); + bool (*is_canceled)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*set_percentage)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, int percentage); + int (*get_percentage)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + void (*show_progress_bar)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, bool pnOff); + void (*set_progress_max)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, int max); + void (*set_progress_advance)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle, int nSteps); + bool (*abort)(KODI_HANDLE kodiBase, KODI_GUI_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_dialogProgress; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_PROGRESS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h new file mode 100644 index 0000000..41ab82f --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h @@ -0,0 +1,42 @@ +/* + * 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_GUI_DIALOGS_SELECT_H +#define C_API_GUI_DIALOGS_SELECT_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogSelect + { + int (*open)(KODI_HANDLE kodiBase, + const char* heading, + const char* entries[], + unsigned int size, + int selected, + unsigned int autoclose); + bool (*open_multi_select)(KODI_HANDLE kodiBase, + const char* heading, + const char* entryIDs[], + const char* entryNames[], + bool entriesSelected[], + unsigned int size, + unsigned int autoclose); + } AddonToKodiFuncTable_kodi_gui_dialogSelect; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_SELECT_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h new file mode 100644 index 0000000..eb38b0b --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h @@ -0,0 +1,30 @@ +/* + * 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_GUI_DIALOGS_TEXT_VIEWER_H +#define C_API_GUI_DIALOGS_TEXT_VIEWER_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer + { + void (*open)(KODI_HANDLE kodiBase, const char* heading, const char* text); + } AddonToKodiFuncTable_kodi_gui_dialogTextViewer; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_TEXT_VIEWER_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h new file mode 100644 index 0000000..01ed806 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h @@ -0,0 +1,50 @@ +/* + * 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_GUI_DIALOGS_YES_NO_H +#define C_API_GUI_DIALOGS_YES_NO_H + +#include "../definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_dialogYesNo + { + bool (*show_and_get_input_single_text)(KODI_HANDLE kodiBase, + const char* heading, + const char* text, + bool* canceled, + const char* noLabel, + const char* yesLabel); + bool (*show_and_get_input_line_text)(KODI_HANDLE kodiBase, + const char* heading, + const char* line0, + const char* line1, + const char* line2, + const char* noLabel, + const char* yesLabel); + bool (*show_and_get_input_line_button_text)(KODI_HANDLE kodiBase, + const char* heading, + const char* line0, + const char* line1, + const char* line2, + bool* canceled, + const char* noLabel, + const char* yesLabel); + } AddonToKodiFuncTable_kodi_gui_dialogYesNo; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_DIALOGS_YES_NO_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h new file mode 100644 index 0000000..d0d256c --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h @@ -0,0 +1,37 @@ +/* + * 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_GUI_GENERAL_H +#define C_API_GUI_GENERAL_H + +#include "definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_general + { + void (*lock)(); + void (*unlock)(); + int (*get_screen_height)(KODI_HANDLE kodiBase); + int (*get_screen_width)(KODI_HANDLE kodiBase); + int (*get_video_resolution)(KODI_HANDLE kodiBase); + int (*get_current_window_dialog_id)(KODI_HANDLE kodiBase); + int (*get_current_window_id)(KODI_HANDLE kodiBase); + ADDON_HARDWARE_CONTEXT (*get_hw_context)(KODI_HANDLE kodiBase); + } AddonToKodiFuncTable_kodi_gui_general; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_GENERAL_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/CMakeLists.txt new file mode 100644 index 0000000..c0bbd11 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/CMakeLists.txt @@ -0,0 +1,5 @@ +set(HEADERS action_ids.h) + +if(NOT ENABLE_STATIC_LIBS) + core_add_library(addons_kodi-dev-kit_include_kodi_c-api_gui_input) +endif() diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h new file mode 100644 index 0000000..274f3d9 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h @@ -0,0 +1,763 @@ +/* + * 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_GUI_ACTION_IDS_H +#define C_API_GUI_ACTION_IDS_H + +/// @defgroup cpp_kodi_gui_Defs_action_ids enum ADDON_ACTION +/// @ingroup cpp_kodi_gui_Defs +/// @brief **Action Id's**\n +/// Actions that we have defined. +/// +///@{ +enum ADDON_ACTION +{ + /// @ingroup cpp_kodi_gui_key_action_ids + ///@{ + + /// @brief `0 `: None. + ADDON_ACTION_NONE = 0, + + /// @brief `1 `: Move left. + ADDON_ACTION_MOVE_LEFT = 1, + + /// @brief `2 `: Move right. + ADDON_ACTION_MOVE_RIGHT = 2, + + /// @brief `3 `: Move up. + ADDON_ACTION_MOVE_UP = 3, + + /// @brief `4 `: Move down. + ADDON_ACTION_MOVE_DOWN = 4, + + /// @brief `5 `: Page up. + ADDON_ACTION_PAGE_UP = 5, + + /// @brief `6 `: Page down. + ADDON_ACTION_PAGE_DOWN = 6, + + /// @brief `7 `: Select item. + ADDON_ACTION_SELECT_ITEM = 7, + + /// @brief `8 `: Highlight item. + ADDON_ACTION_HIGHLIGHT_ITEM = 8, + + /// @brief `9 `: Parent directory. + ADDON_ACTION_PARENT_DIR = 9, + + /// @brief `10 `: Previous menu. + ADDON_ACTION_PREVIOUS_MENU = 10, + + /// @brief `11 `: Show info. + ADDON_ACTION_SHOW_INFO = 11, + + /// @brief `12 `: Pause. + ADDON_ACTION_PAUSE = 12, + + /// @brief `13 `: Stop. + ADDON_ACTION_STOP = 13, + + /// @brief `14 `: Next item. + ADDON_ACTION_NEXT_ITEM = 14, + + /// @brief `15 `: Previous item. + ADDON_ACTION_PREV_ITEM = 15, + + /// @brief `16 `: Can be used to specify specific action in a window, Playback control is handled in ADDON_ACTION_PLAYER_* + ADDON_ACTION_FORWARD = 16, + + /// @brief `17 `: Can be used to specify specific action in a window, Playback control is handled in ADDON_ACTION_PLAYER_* + ADDON_ACTION_REWIND = 17, + + /// @brief `18 `: Toggle between GUI and movie or GUI and visualisation. + ADDON_ACTION_SHOW_GUI = 18, + + /// @brief `19 `: Toggle quick-access zoom modes. Can b used in videoFullScreen.zml window id=2005 + ADDON_ACTION_ASPECT_RATIO = 19, + + /// @brief `20 `: Seek +1% in the movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_STEP_FORWARD = 20, + + /// @brief `21 `: Seek -1% in the movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_STEP_BACK = 21, + + /// @brief `22 `: Seek +10% in the movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_BIG_STEP_FORWARD = 22, + + /// @brief `23 `: Seek -10% in the movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_BIG_STEP_BACK = 23, + + /// @brief `24 `: Show/hide OSD. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_SHOW_OSD = 24, + + /// @brief `25 `: Turn subtitles on/off. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_SHOW_SUBTITLES = 25, + + /// @brief `26 `: Switch to next subtitle of movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_NEXT_SUBTITLE = 26, + + /// @brief `27 `: Show debug info for VideoPlayer + ADDON_ACTION_PLAYER_DEBUG = 27, + + /// @brief `28 `: Show next picture of slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_NEXT_PICTURE = 28, + + /// @brief `29 `: Show previous picture of slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_PREV_PICTURE = 29, + + /// @brief `30 `: Zoom in picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_OUT = 30, + + /// @brief `31 `: Zoom out picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_IN = 31, + + /// @brief `32 `: Used to toggle between source view and destination view. Can be used in myfiles.xml window id=3 + ADDON_ACTION_TOGGLE_SOURCE_DEST = 32, + + /// @brief `33 `: Used to toggle between current view and playlist view. Can b used in all mymusic xml files + ADDON_ACTION_SHOW_PLAYLIST = 33, + + /// @brief `34 `: Used to queue a item to the playlist. Can b used in all mymusic xml files + ADDON_ACTION_QUEUE_ITEM = 34, + + /// @brief `35 `: Not used anymore + ADDON_ACTION_REMOVE_ITEM = 35, + + /// @brief `36 `: Not used anymore + ADDON_ACTION_SHOW_FULLSCREEN = 36, + + /// @brief `37 `: Zoom 1x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_NORMAL = 37, + + /// @brief `38 `: Zoom 2x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_1 = 38, + + /// @brief `39 `: Zoom 3x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_2 = 39, + + /// @brief `40 `: Zoom 4x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_3 = 40, + + /// @brief `41 `: Zoom 5x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_4 = 41, + + /// @brief `42 `: Zoom 6x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_5 = 42, + + /// @brief `43 `: Zoom 7x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_6 = 43, + + /// @brief `44 `: Zoom 8x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_7 = 44, + + /// @brief `45 `: Zoom 9x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_8 = 45, + + /// @brief `46 `: Zoom 10x picture during slideshow. Can b used in slideshow.xml window id=2007 + ADDON_ACTION_ZOOM_LEVEL_9 = 46, + + /// @brief `47 `: Select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11 + ADDON_ACTION_CALIBRATE_SWAP_ARROWS = 47, + + /// @brief `48 `: Reset calibration to defaults. Can b used in: `settingsScreenCalibration.xml` windowid=11/settingsUICalibration.xml windowid=10 + ADDON_ACTION_CALIBRATE_RESET = 48, + + /// @brief `49 `: Analog thumbstick move. Can b used in: `slideshow.xml` + /// windowid=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml + /// windowid=10 + /// @note see also ADDON_ACTION_ANALOG_MOVE_X_LEFT, ADDON_ACTION_ANALOG_MOVE_X_RIGHT, + /// ADDON_ACTION_ANALOG_MOVE_Y_UP, ADDON_ACTION_ANALOG_MOVE_Y_DOWN + ADDON_ACTION_ANALOG_MOVE = 49, + + /// @brief `50 `: Rotate current picture clockwise during slideshow. Can be used in slideshow.xml window id=2007 + ADDON_ACTION_ROTATE_PICTURE_CW = 50, + + /// @brief `51 `: Rotate current picture counterclockwise during slideshow. Can be used in slideshow.xml window id=2007 + ADDON_ACTION_ROTATE_PICTURE_CCW = 51, + + /// @brief `52 `: Decrease subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_SUBTITLE_DELAY_MIN = 52, + + /// @brief `53 `: Increase subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_SUBTITLE_DELAY_PLUS = 53, + + /// @brief `54 `: Increase avsync delay. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_AUDIO_DELAY_MIN = 54, + + /// @brief `55 `: Decrease avsync delay. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_AUDIO_DELAY_PLUS = 55, + + /// @brief `56 `: Select next language in movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_AUDIO_NEXT_LANGUAGE = 56, + + /// @brief `57 `: Switch 2 next resolution. Can b used during screen calibration settingsScreenCalibration.xml windowid=11 + ADDON_ACTION_CHANGE_RESOLUTION = 57, + + /// @brief `58 `: remote keys 0-9. are used by multiple windows + /// for example in videoFullScreen.xml window id=2005 you can + /// enter time (mmss) to jump to particular point in the movie + /// with spincontrols you can enter 3digit number to quickly set + /// spincontrol to desired value + /// + /// Remote key 0 + ADDON_ACTION_REMOTE_0 = 58, + + /// @brief `59 `: Remote key 1 + ADDON_ACTION_REMOTE_1 = 59, + + /// @brief `60 `: Remote key 2 + ADDON_ACTION_REMOTE_2 = 60, + + /// @brief `61 `: Remote key 3 + ADDON_ACTION_REMOTE_3 = 61, + + /// @brief `62 `: Remote key 4 + ADDON_ACTION_REMOTE_4 = 62, + + /// @brief `63 `: Remote key 5 + ADDON_ACTION_REMOTE_5 = 63, + + /// @brief `64 `: Remote key 6 + ADDON_ACTION_REMOTE_6 = 64, + + /// @brief `65 `: Remote key 7 + ADDON_ACTION_REMOTE_7 = 65, + + /// @brief `66 `: Remote key 8 + ADDON_ACTION_REMOTE_8 = 66, + + /// @brief `67 `: Remote key 9 + ADDON_ACTION_REMOTE_9 = 67, + + /// @brief `69 `: Show player process info (video decoder, pixel format, pvr signal strength and the like + ADDON_ACTION_PLAYER_PROCESS_INFO = 69, + + /// @brief `70 `: Program select. + ADDON_ACTION_PLAYER_PROGRAM_SELECT = 70, + + /// @brief `71 `: Resolution select. + ADDON_ACTION_PLAYER_RESOLUTION_SELECT = 71, + + /// @brief `76 `: Jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_SMALL_STEP_BACK = 76, + + /// @brief `77 `: FF in current file played. global action, can be used anywhere + ADDON_ACTION_PLAYER_FORWARD = 77, + + /// @brief `78 `: RW in current file played. global action, can be used anywhere + ADDON_ACTION_PLAYER_REWIND = 78, + + /// @brief `79 `: Play current song. Unpauses song and sets playspeed to 1x. global action, can be used anywhere + ADDON_ACTION_PLAYER_PLAY = 79, + + /// @brief `80 `: Delete current selected item. Can be used in myfiles.xml window id=3 and in myvideoTitle.xml window id=25 + ADDON_ACTION_DELETE_ITEM = 80, + + /// @brief `81 `: Copy current selected item. Can be used in myfiles.xml window id=3 + ADDON_ACTION_COPY_ITEM = 81, + + /// @brief `82 `: move current selected item. Can be used in myfiles.xml window id=3 + ADDON_ACTION_MOVE_ITEM = 82, + + /// @brief `85 `: Take a screenshot. + ADDON_ACTION_TAKE_SCREENSHOT = 85, + + /// @brief `87 `: Rename item. + ADDON_ACTION_RENAME_ITEM = 87, + + /// @brief `87 `: Volume up. + ADDON_ACTION_VOLUME_UP = 88, + + /// @brief `87 `: Volume down. + ADDON_ACTION_VOLUME_DOWN = 89, + + /// @brief `90 `: Volume amplication. + ADDON_ACTION_VOLAMP = 90, + + /// @brief `90 `: Mute. + ADDON_ACTION_MUTE = 91, + + /// @brief `90 `: Nav back. + ADDON_ACTION_NAV_BACK = 92, + + /// @brief `90 `: Volume amp up, + ADDON_ACTION_VOLAMP_UP = 93, + + /// @brief `94 `: Volume amp down. + ADDON_ACTION_VOLAMP_DOWN = 94, + + /// @brief `95 `: Creates an episode bookmark on the currently playing video file containing more than one + /// episode + ADDON_ACTION_CREATE_EPISODE_BOOKMARK = 95, + + /// @brief `96 `: Creates a bookmark of the currently playing video file + ADDON_ACTION_CREATE_BOOKMARK = 96, + + /// @brief `97 `: Goto the next chapter, if not available perform a big step forward + ADDON_ACTION_CHAPTER_OR_BIG_STEP_FORWARD = 97, + + /// @brief `98 `: Goto the previous chapter, if not available perform a big step back + ADDON_ACTION_CHAPTER_OR_BIG_STEP_BACK = 98, + + /// @brief `99 `: Switch to next subtitle of movie, but will not enable/disable the subtitles. Can be used + /// in videoFullScreen.xml window id=2005 + ADDON_ACTION_CYCLE_SUBTITLE = 99, + + /// @brief `100`: Mouse action values start. + /// + /// Ends with @ref ADDON_ACTION_MOUSE_END. + ADDON_ACTION_MOUSE_START = 100, + + /// @brief `100`: Mouse left click. + ADDON_ACTION_MOUSE_LEFT_CLICK = 100, + + /// @brief `101`: Mouse right click. + ADDON_ACTION_MOUSE_RIGHT_CLICK = 101, + + /// @brief `102`: Mouse middle click. + ADDON_ACTION_MOUSE_MIDDLE_CLICK = 102, + + /// @brief `103`: Mouse double click. + ADDON_ACTION_MOUSE_DOUBLE_CLICK = 103, + + /// @brief `104`: Mouse wheel up. + ADDON_ACTION_MOUSE_WHEEL_UP = 104, + + /// @brief `105`: Mouse wheel down. + ADDON_ACTION_MOUSE_WHEEL_DOWN = 105, + + /// @brief `106`: Mouse drag. + ADDON_ACTION_MOUSE_DRAG = 106, + + /// @brief `107`: Mouse move. + ADDON_ACTION_MOUSE_MOVE = 107, + + /// @brief `108`: Mouse long click. + ADDON_ACTION_MOUSE_LONG_CLICK = 108, + + /// @brief `109`: Mouse drag end. + ADDON_ACTION_MOUSE_DRAG_END = 109, + + /// @brief `109`: Mouse action values end. + /// + /// Starts with @ref ADDON_ACTION_MOUSE_START. + ADDON_ACTION_MOUSE_END = 109, + + /// @brief `110`: Backspace. + ADDON_ACTION_BACKSPACE = 110, + + /// @brief `111`: Scroll up. + ADDON_ACTION_SCROLL_UP = 111, + + /// @brief `112`: Scroll down. + ADDON_ACTION_SCROLL_DOWN = 112, + + /// @brief `113`: Analog forward. + ADDON_ACTION_ANALOG_FORWARD = 113, + + /// @brief `114`: Analog rewind. + ADDON_ACTION_ANALOG_REWIND = 114, + + /// @brief `115`: move item up in playlist + ADDON_ACTION_MOVE_ITEM_UP = 115, + + /// @brief `116`: move item down in playlist + ADDON_ACTION_MOVE_ITEM_DOWN = 116, + + /// @brief `117`: pops up the context menu + ADDON_ACTION_CONTEXT_MENU = 117, + + /// @brief `118`: stuff for virtual keyboard shortcuts + ADDON_ACTION_SHIFT = 118, + + /// @brief `119`: stuff for virtual keyboard shortcuts + ADDON_ACTION_SYMBOLS = 119, + + /// @brief `120`: stuff for virtual keyboard shortcuts + ADDON_ACTION_CURSOR_LEFT = 120, + + /// @brief `121`: stuff for virtual keyboard shortcuts + ADDON_ACTION_CURSOR_RIGHT = 121, + + /// @brief `122`: Build in function + ADDON_ACTION_BUILT_IN_FUNCTION = 122, + + /// @brief `114`: Displays current time, can be used in videoFullScreen.xml window id=2005 + ADDON_ACTION_SHOW_OSD_TIME = 123, + + /// @brief `124`: Seeks forward, and displays the seek bar. + ADDON_ACTION_ANALOG_SEEK_FORWARD = 124, + + /// @brief `125`: Seeks backward, and displays the seek bar. + ADDON_ACTION_ANALOG_SEEK_BACK = 125, + + /// @brief `126`: Visualization preset show. + ADDON_ACTION_VIS_PRESET_SHOW = 126, + + /// @brief `128`: Visualization preset next. + ADDON_ACTION_VIS_PRESET_NEXT = 128, + + /// @brief `129`: Visualization preset previous. + ADDON_ACTION_VIS_PRESET_PREV = 129, + + /// @brief `130`: Visualization preset lock. + ADDON_ACTION_VIS_PRESET_LOCK = 130, + + /// @brief `131`: Visualization preset random. + ADDON_ACTION_VIS_PRESET_RANDOM = 131, + + /// @brief `132`: Visualization preset plus. + ADDON_ACTION_VIS_RATE_PRESET_PLUS = 132, + + /// @brief `133`: Visualization preset minus. + ADDON_ACTION_VIS_RATE_PRESET_MINUS = 133, + + /// @brief `134`: Show Videomenu + ADDON_ACTION_SHOW_VIDEOMENU = 134, + + /// @brief `135`: Enter. + ADDON_ACTION_ENTER = 135, + + /// @brief `136`: Increase rating. + ADDON_ACTION_INCREASE_RATING = 136, + + /// @brief `137`: Decrease rating. + ADDON_ACTION_DECREASE_RATING = 137, + + /// @brief `138`: Switch to next scene/cutpoint in movie. + ADDON_ACTION_NEXT_SCENE = 138, + + /// @brief `139`: Switch to previous scene/cutpoint in movie. + ADDON_ACTION_PREV_SCENE = 139, + + /// @brief `140`: Jump through a list or container to next letter. + ADDON_ACTION_NEXT_LETTER = 140, + + /// @brief `141`: Jump through a list or container to previous letter. + ADDON_ACTION_PREV_LETTER = 141, + + /// @brief `142`: Jump direct to a particular letter using SMS-style input + /// + /// Jump to SMS2. + ADDON_ACTION_JUMP_SMS2 = 142, + + /// @brief `143`: Jump to SMS3. + ADDON_ACTION_JUMP_SMS3 = 143, + + /// @brief `144`: Jump to SMS4. + ADDON_ACTION_JUMP_SMS4 = 144, + + /// @brief `145`: Jump to SMS5. + ADDON_ACTION_JUMP_SMS5 = 145, + + /// @brief `146`: Jump to SMS6. + ADDON_ACTION_JUMP_SMS6 = 146, + + /// @brief `147`: Jump to SMS7. + ADDON_ACTION_JUMP_SMS7 = 147, + + /// @brief `148`: Jump to SMS8. + ADDON_ACTION_JUMP_SMS8 = 148, + + /// @brief `149`: Jump to SMS9. + ADDON_ACTION_JUMP_SMS9 = 149, + + /// @brief `150`: Filter clear. + ADDON_ACTION_FILTER_CLEAR = 150, + + /// @brief `151`: Filter SMS2. + ADDON_ACTION_FILTER_SMS2 = 151, + + /// @brief `152`: Filter SMS3. + ADDON_ACTION_FILTER_SMS3 = 152, + + /// @brief `153`: Filter SMS4. + ADDON_ACTION_FILTER_SMS4 = 153, + + /// @brief `154`: Filter SMS5. + ADDON_ACTION_FILTER_SMS5 = 154, + + /// @brief `155`: Filter SMS6. + ADDON_ACTION_FILTER_SMS6 = 155, + + /// @brief `156`: Filter SMS7. + ADDON_ACTION_FILTER_SMS7 = 156, + + /// @brief `157`: Filter SMS8. + ADDON_ACTION_FILTER_SMS8 = 157, + + /// @brief `158`: Filter SMS9. + ADDON_ACTION_FILTER_SMS9 = 158, + + /// @brief `159`: First page. + ADDON_ACTION_FIRST_PAGE = 159, + + /// @brief `160`: Last page. + ADDON_ACTION_LAST_PAGE = 160, + + /// @brief `161`: Audio delay. + ADDON_ACTION_AUDIO_DELAY = 161, + + /// @brief `162`: Subtitle delay. + ADDON_ACTION_SUBTITLE_DELAY = 162, + + /// @brief `163`: Menu. + ADDON_ACTION_MENU = 163, + + /// @brief `164`: Set rating. + ADDON_ACTION_SET_RATING = 164, + + /// @brief `170`: Record. + ADDON_ACTION_RECORD = 170, + + /// @brief `180`: Paste. + ADDON_ACTION_PASTE = 180, + + /// @brief `181`: Next control. + ADDON_ACTION_NEXT_CONTROL = 181, + + /// @brief `182`: Previous control. + ADDON_ACTION_PREV_CONTROL = 182, + + /// @brief `183`: Channel switch. + ADDON_ACTION_CHANNEL_SWITCH = 183, + + /// @brief `184`: Channel up. + ADDON_ACTION_CHANNEL_UP = 184, + + /// @brief `185`: Channel down. + ADDON_ACTION_CHANNEL_DOWN = 185, + + /// @brief `186`: Next channel group. + ADDON_ACTION_NEXT_CHANNELGROUP = 186, + + /// @brief `187`: Previous channel group. + ADDON_ACTION_PREVIOUS_CHANNELGROUP = 187, + + /// @brief `188`: PVR play. + ADDON_ACTION_PVR_PLAY = 188, + + /// @brief `189`: PVR play TV. + ADDON_ACTION_PVR_PLAY_TV = 189, + + /// @brief `190`: PVR play radio. + ADDON_ACTION_PVR_PLAY_RADIO = 190, + + /// @brief `191`: PVR show timer rule. + ADDON_ACTION_PVR_SHOW_TIMER_RULE = 191, + + /// @brief `192`: Channel number sep + ADDON_ACTION_CHANNEL_NUMBER_SEP = 192, + + /// @brief `193`: PVR announce reminders + ADDON_ACTION_PVR_ANNOUNCE_REMINDERS = 193, + + /// @brief `199`: Switch 2 desktop resolution + ADDON_ACTION_TOGGLE_FULLSCREEN = 199, + + /// @brief `200`: Toggle watched status (videos) + ADDON_ACTION_TOGGLE_WATCHED = 200, + + /// @brief `201`: Scan item + ADDON_ACTION_SCAN_ITEM = 201, + + /// @brief `202`: Switch digital <-> analog + ADDON_ACTION_TOGGLE_DIGITAL_ANALOG = 202, + + /// @brief `203`: Reloads CButtonTranslator's keymaps + ADDON_ACTION_RELOAD_KEYMAPS = 203, + + /// @brief `204`: Start the GUIControlProfiler running + ADDON_ACTION_GUIPROFILE_BEGIN = 204, + + /// @brief `215`: Teletext Color button Red to control TopText + ADDON_ACTION_TELETEXT_RED = 215, + + /// @brief `216`: Teletext Color button Green to control TopText + ADDON_ACTION_TELETEXT_GREEN = 216, + + /// @brief `217`: Teletext Color button Yellow to control TopText + ADDON_ACTION_TELETEXT_YELLOW = 217, + + /// @brief `218`: Teletext Color button Blue to control TopText + ADDON_ACTION_TELETEXT_BLUE = 218, + + /// @brief `219`: Increase par. + ADDON_ACTION_INCREASE_PAR = 219, + + /// @brief `220`: Decrease par. + ADDON_ACTION_DECREASE_PAR = 220, + + /// @brief `227`: Shift up video image in VideoPlayer + ADDON_ACTION_VSHIFT_UP = 227, + + /// @brief `228`: Shift down video image in VideoPlayer + ADDON_ACTION_VSHIFT_DOWN = 228, + + /// @brief `229`: Play/pause. If playing it pauses, if paused it plays. + ADDON_ACTION_PLAYER_PLAYPAUSE = 229, + + /// @brief `230`: Shift up subtitles in VideoPlayer + ADDON_ACTION_SUBTITLE_VSHIFT_UP = 230, + + /// @brief `231`: Shift down subtitles in VideoPlayer + ADDON_ACTION_SUBTITLE_VSHIFT_DOWN = 231, + + /// @brief `232`: Toggle vertical alignment of subtitles + ADDON_ACTION_SUBTITLE_ALIGN = 232, + + /// @brief `233`: Filter. + ADDON_ACTION_FILTER = 233, + + /// @brief `234`: Switch player. + ADDON_ACTION_SWITCH_PLAYER = 234, + + /// @brief `235`: Stereo mode next. + ADDON_ACTION_STEREOMODE_NEXT = 235, + + /// @brief `236`: Stereo mode previous. + ADDON_ACTION_STEREOMODE_PREVIOUS = 236, + + /// @brief `237`: Turns 3d mode on/off. + ADDON_ACTION_STEREOMODE_TOGGLE = 237, + + /// @brief `238`: Stereo mode select. + ADDON_ACTION_STEREOMODE_SELECT = 238, + + /// @brief `239`: Stereo mode to mono. + ADDON_ACTION_STEREOMODE_TOMONO = 239, + + /// @brief `240`: Stereo mode set. + ADDON_ACTION_STEREOMODE_SET = 240, + + /// @brief `241`: Settings reset. + ADDON_ACTION_SETTINGS_RESET = 241, + + /// @brief `242`: Settings level change. + ADDON_ACTION_SETTINGS_LEVEL_CHANGE = 242, + + /// @brief `243`: Show autoclosing OSD. Can b used in videoFullScreen.xml window id=2005 + ADDON_ACTION_TRIGGER_OSD = 243, + + /// @brief `244`: Input text. + ADDON_ACTION_INPUT_TEXT = 244, + + /// @brief `245`: Volume set. + ADDON_ACTION_VOLUME_SET = 245, + + /// @brief `246`: Toggle commercial skip. + ADDON_ACTION_TOGGLE_COMMSKIP = 246, + + /// @brief `247`: Browse for subtitle. Can be used in videofullscreen + ADDON_ACTION_BROWSE_SUBTITLE = 247, + + /// @brief `248`: Send a reset command to the active game + ADDON_ACTION_PLAYER_RESET = 248, + + /// @brief `249`: Toggle font. Used in TextViewer dialog + ADDON_ACTION_TOGGLE_FONT = 249, + + /// @brief `250`: Cycle video streams. Used in videofullscreen. + ADDON_ACTION_VIDEO_NEXT_STREAM = 250, + + /// @brief `251`: Used to queue an item to the next position in the playlist + ADDON_ACTION_QUEUE_ITEM_NEXT = 251, + + /// @brief `247`: Toggle display HDR on/off + ADDON_ACTION_HDR_TOGGLE = 260, + + /// @brief `300`: Voice actions + ADDON_ACTION_VOICE_RECOGNIZE = 300, + + // Number 347 used om front by ADDON_ACTION_BROWSE_SUBTITLE + + /// @brief `401`: Touch actions + ADDON_ACTION_TOUCH_TAP = 401, + + /// @brief `410`: Touch actions + ADDON_ACTION_TOUCH_TAP_TEN = 410, + + /// @brief `411`: Touch actions + ADDON_ACTION_TOUCH_LONGPRESS = 411, + + /// @brief `412`: Touch actions + ADDON_ACTION_TOUCH_LONGPRESS_TEN = 420, + + /// @brief `500`: Gesture notify. + ADDON_ACTION_GESTURE_NOTIFY = 500, + + /// @brief `501`: Gesture begin. + ADDON_ACTION_GESTURE_BEGIN = 501, + + /// @brief `502`: Send action with point and currentPinchScale (fingers together < 1.0 -> fingers apart > 1.0) + ADDON_ACTION_GESTURE_ZOOM = 502, + + /// @brief `503`: Gesture rotate. + ADDON_ACTION_GESTURE_ROTATE = 503, + + /// @brief `504`: Gesture pan. + ADDON_ACTION_GESTURE_PAN = 504, + + /// @brief `505`: Gesture was interrupted in unspecified state + ADDON_ACTION_GESTURE_ABORT = 505, + + /// @brief `511`: Gesture swipe left. + ADDON_ACTION_GESTURE_SWIPE_LEFT = 511, + + /// @brief `520`: Gesture swipe left ten + ADDON_ACTION_GESTURE_SWIPE_LEFT_TEN = 520, + + /// @brief `521`: Gesture swipe right + ADDON_ACTION_GESTURE_SWIPE_RIGHT = 521, + + /// @brief `530`: Gesture swipe right ten + ADDON_ACTION_GESTURE_SWIPE_RIGHT_TEN = 530, + + /// @brief `531`: Gesture swipe up + ADDON_ACTION_GESTURE_SWIPE_UP = 531, + + /// @brief `540`: Gesture swipe up ten + ADDON_ACTION_GESTURE_SWIPE_UP_TEN = 540, + + /// @brief `541`: Gesture swipe down. + ADDON_ACTION_GESTURE_SWIPE_DOWN = 541, + + /// @brief `550`: Gesture swipe down ten. + ADDON_ACTION_GESTURE_SWIPE_DOWN_TEN = 550, + + /// @brief `599`: 5xx is reserved for additional gesture actions + ADDON_ACTION_GESTURE_END = 599, + + // other, non-gesture actions + + /// @brief `601`: Analog thumbstick move, horizontal axis, left; see ADDON_ACTION_ANALOG_MOVE + ADDON_ACTION_ANALOG_MOVE_X_LEFT = 601, + + /// @brief `602`: Analog thumbstick move, horizontal axis, right; see ADDON_ACTION_ANALOG_MOVE + ADDON_ACTION_ANALOG_MOVE_X_RIGHT = 602, + + /// @brief `603`: Analog thumbstick move, vertical axis, up; see ADDON_ACTION_ANALOG_MOVE + ADDON_ACTION_ANALOG_MOVE_Y_UP = 603, + + /// @brief `604`: Analog thumbstick move, vertical axis, down; see ADDON_ACTION_ANALOG_MOVE + ADDON_ACTION_ANALOG_MOVE_Y_DOWN = 604, + + /// @brief `998`: ERROR action is used to play an error sound. + ADDON_ACTION_ERROR = 998, + + /// @brief `999`: The NOOP action can be specified to disable an input event. This is + /// useful in user keyboard.xml etc to disable actions specified in the + /// system mappings. + ADDON_ACTION_NOOP = 999 + ///@} +}; +///@} + +#endif /* !C_API_GUI_ACTION_IDS_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h new file mode 100644 index 0000000..f0c4dc7 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h @@ -0,0 +1,54 @@ +/* + * 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_GUI_LIST_ITEM_H +#define C_API_GUI_LIST_ITEM_H + +#include "definitions.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct AddonToKodiFuncTable_kodi_gui_listItem + { + KODI_GUI_LISTITEM_HANDLE(*create) + (KODI_HANDLE kodiBase, + const char* label, + const char* label2, + const char* path); + void (*destroy)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle); + + char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle); + void (*set_label)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle, const char* label); + char* (*get_label2)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle); + void (*set_label2)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle, const char* label); + char* (*get_art)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle, const char* type); + void (*set_art)(KODI_HANDLE kodiBase, + KODI_GUI_LISTITEM_HANDLE handle, + const char* type, + const char* image); + char* (*get_path)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle); + void (*set_path)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle, const char* path); + char* (*get_property)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle, const char* key); + void (*set_property)(KODI_HANDLE kodiBase, + KODI_GUI_LISTITEM_HANDLE handle, + const char* key, + const char* value); + void (*select)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle, bool select); + bool (*is_selected)(KODI_HANDLE kodiBase, KODI_GUI_LISTITEM_HANDLE handle); + } AddonToKodiFuncTable_kodi_gui_listItem; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_LIST_ITEM_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h new file mode 100644 index 0000000..0f844f5 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h @@ -0,0 +1,183 @@ +/* + * 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_GUI_WINDOW_H +#define C_API_GUI_WINDOW_H + +#include "definitions.h" +#include "input/action_ids.h" + +#include + +#define ADDON_MAX_CONTEXT_ENTRIES 20 +#define ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH 80 + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + typedef struct gui_context_menu_pair + { + unsigned int id; + char name[ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH]; + } gui_context_menu_pair; + + typedef struct AddonToKodiFuncTable_kodi_gui_window + { + /* Window creation functions */ + KODI_GUI_WINDOW_HANDLE(*create) + (KODI_HANDLE kodiBase, + const char* xml_filename, + const char* default_skin, + bool as_dialog, + bool is_media); + void (*destroy)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + + void (*set_callbacks)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + KODI_GUI_CLIENT_HANDLE clienthandle, + bool (*CBInit)(KODI_GUI_CLIENT_HANDLE), + bool (*CBFocus)(KODI_GUI_CLIENT_HANDLE, int), + bool (*CBClick)(KODI_GUI_CLIENT_HANDLE, int), + bool (*CBOnAction)(KODI_GUI_CLIENT_HANDLE, enum ADDON_ACTION), + void (*CBGetContextButtons)( + KODI_GUI_CLIENT_HANDLE, int, gui_context_menu_pair*, unsigned int*), + bool (*CBOnContextButton)(KODI_GUI_CLIENT_HANDLE, int, unsigned int)); + bool (*show)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + bool (*close)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + bool (*do_modal)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + + /* Window control functions */ + bool (*set_focus_id)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + int (*get_focus_id)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + void (*set_control_label)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + int control_id, + const char* label); + void (*set_control_visible)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + int control_id, + bool visible); + void (*set_control_selected)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + int control_id, + bool selected); + + /* Window property functions */ + void (*set_property)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* key, + const char* value); + void (*set_property_int)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* key, + int value); + void (*set_property_bool)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* key, + bool value); + void (*set_property_double)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* key, + double value); + char* (*get_property)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, const char* key); + int (*get_property_int)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, const char* key); + bool (*get_property_bool)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, const char* key); + double (*get_property_double)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* key); + void (*clear_properties)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + void (*clear_property)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, const char* key); + + /* List item functions */ + void (*clear_item_list)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + void (*add_list_item)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + KODI_GUI_LISTITEM_HANDLE item, + int list_position); + void (*remove_list_item_from_position)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + int list_position); + void (*remove_list_item)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + KODI_GUI_LISTITEM_HANDLE item); + KODI_GUI_LISTITEM_HANDLE(*get_list_item) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int list_position); + void (*set_current_list_position)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + int list_position); + int (*get_current_list_position)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + int (*get_list_size)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + void (*set_container_property)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* key, + const char* value); + void (*set_container_content)(KODI_HANDLE kodiBase, + KODI_GUI_WINDOW_HANDLE handle, + const char* value); + int (*get_current_container_id)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + + /* Various functions */ + void (*mark_dirty_region)(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle); + + /* GUI control access functions */ + KODI_GUI_CONTROL_HANDLE(*get_control_button) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_edit) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_fade_label) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_image) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_label) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_progress) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_radio_button) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_render_addon) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_settings_slider) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_slider) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_spin) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_text_box) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy1) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy2) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy3) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy4) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy5) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy6) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy7) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy8) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy9) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + KODI_GUI_CONTROL_HANDLE(*get_control_dummy10) + (KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE handle, int control_id); + /* This above used to add new get_control_* functions */ + } AddonToKodiFuncTable_kodi_gui_window; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !C_API_GUI_WINDOW_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h new file mode 100644 index 0000000..88d5231 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h @@ -0,0 +1,48 @@ +/* + * 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_NETWORK_H +#define C_API_NETWORK_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + /* + * For interface between add-on and kodi. + * + * This structure defines the addresses of functions stored inside Kodi which + * are then available for the add-on to call + * + * All function pointers there are used by the C++ interface functions below. + * You find the set of them on xbmc/addons/interfaces/General.cpp + * + * Note: For add-on development itself this is not needed + */ + typedef struct AddonToKodiFuncTable_kodi_network + { + bool (*wake_on_lan)(void* kodiBase, const char* mac); + char* (*get_ip_address)(void* kodiBase); + char* (*dns_lookup)(void* kodiBase, const char* url, bool* ret); + char* (*url_encode)(void* kodiBase, const char* url); + char* (*get_hostname)(void* kodiBase); + bool (*is_local_host)(void* kodiBase, const char* hostname); + bool (*is_host_on_lan)(void* kodiBase, const char* hostname, bool offLineCheck); + char* (*get_user_agent)(void* kodiBase); + } AddonToKodiFuncTable_kodi_network; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* C_API_NETWORK_H */ diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h new file mode 100644 index 0000000..568a2fd --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h @@ -0,0 +1,34 @@ +/* + * 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_PLATFORM_ANDROID_H +#define C_API_PLATFORM_ANDROID_H + +#define INTERFACE_ANDROID_SYSTEM_NAME "ANDROID_SYSTEM" +#define INTERFACE_ANDROID_SYSTEM_VERSION "1.0.2" +#define INTERFACE_ANDROID_SYSTEM_VERSION_MIN "1.0.1" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + struct AddonToKodiFuncTable_android_system + { + void* (*get_jni_env)(); + int (*get_sdk_version)(); + const char *(*get_class_name)(); + }; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* !C_API_PLATFORM_ANDROID_H */ -- cgit v1.2.3