diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/General.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/General.h | 511 |
1 files changed, 511 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/General.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/General.h new file mode 100644 index 0000000..c7977c2 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/General.h | |||
| @@ -0,0 +1,511 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../AddonBase.h" | ||
| 12 | #include "../../c-api/addon-instance/pvr/pvr_general.h" | ||
| 13 | |||
| 14 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ | ||
| 15 | // "C++" Definitions group 1 - General PVR | ||
| 16 | #ifdef __cplusplus | ||
| 17 | |||
| 18 | namespace kodi | ||
| 19 | { | ||
| 20 | namespace addon | ||
| 21 | { | ||
| 22 | |||
| 23 | //============================================================================== | ||
| 24 | /// @defgroup cpp_kodi_addon_pvr_Defs_PVRTypeIntValue class PVRTypeIntValue | ||
| 25 | /// @ingroup cpp_kodi_addon_pvr_Defs_General | ||
| 26 | /// @brief **PVR add-on type value**\n | ||
| 27 | /// Representation of a <b>`<int, std::string>`</b> event related value. | ||
| 28 | /// | ||
| 29 | /// ---------------------------------------------------------------------------- | ||
| 30 | /// | ||
| 31 | /// @copydetails cpp_kodi_addon_pvr_Defs_PVRTypeIntValue_Help | ||
| 32 | /// | ||
| 33 | ///@{ | ||
| 34 | class PVRTypeIntValue : public CStructHdl<PVRTypeIntValue, PVR_ATTRIBUTE_INT_VALUE> | ||
| 35 | { | ||
| 36 | friend class CInstancePVRClient; | ||
| 37 | |||
| 38 | public: | ||
| 39 | /*! \cond PRIVATE */ | ||
| 40 | PVRTypeIntValue(const PVRTypeIntValue& data) : CStructHdl(data) {} | ||
| 41 | /*! \endcond */ | ||
| 42 | |||
| 43 | /// @defgroup cpp_kodi_addon_pvr_Defs_PVRTypeIntValue_Help Value Help | ||
| 44 | /// @ingroup cpp_kodi_addon_pvr_Defs_PVRTypeIntValue | ||
| 45 | /// | ||
| 46 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_PVRTypeIntValue :</b> | ||
| 47 | /// | Name | Type | Set call | Get call | ||
| 48 | /// |------|------|----------|---------- | ||
| 49 | /// | **Value** | `int` | @ref PVRTypeIntValue::SetValue "SetValue" | @ref PVRTypeIntValue::GetValue "GetValue" | ||
| 50 | /// | **Description** | `std::string` | @ref PVRTypeIntValue::SetDescription "SetDescription" | @ref PVRTypeIntValue::GetDescription "GetDescription" | ||
| 51 | /// | ||
| 52 | /// @remark Further can there be used his class constructor to set values. | ||
| 53 | |||
| 54 | /// @addtogroup cpp_kodi_addon_pvr_Defs_PVRTypeIntValue | ||
| 55 | ///@{ | ||
| 56 | |||
| 57 | /// @brief Default class constructor. | ||
| 58 | /// | ||
| 59 | /// @note Values must be set afterwards. | ||
| 60 | PVRTypeIntValue() = default; | ||
| 61 | |||
| 62 | /// @brief Class constructor with integrated value set. | ||
| 63 | /// | ||
| 64 | /// @param[in] value Type identification value | ||
| 65 | /// @param[in] description Type description text | ||
| 66 | PVRTypeIntValue(int value, const std::string& description) | ||
| 67 | { | ||
| 68 | SetValue(value); | ||
| 69 | SetDescription(description); | ||
| 70 | } | ||
| 71 | |||
| 72 | /// @brief To set with the identification value. | ||
| 73 | void SetValue(int value) { m_cStructure->iValue = value; } | ||
| 74 | |||
| 75 | /// @brief To get with the identification value. | ||
| 76 | int GetValue() const { return m_cStructure->iValue; } | ||
| 77 | |||
| 78 | /// @brief To set with the description text of the value. | ||
| 79 | void SetDescription(const std::string& description) | ||
| 80 | { | ||
| 81 | strncpy(m_cStructure->strDescription, description.c_str(), | ||
| 82 | sizeof(m_cStructure->strDescription) - 1); | ||
| 83 | } | ||
| 84 | |||
| 85 | /// @brief To get with the description text of the value. | ||
| 86 | std::string GetDescription() const { return m_cStructure->strDescription; } | ||
| 87 | ///@} | ||
| 88 | |||
| 89 | private: | ||
| 90 | PVRTypeIntValue(const PVR_ATTRIBUTE_INT_VALUE* data) : CStructHdl(data) {} | ||
| 91 | PVRTypeIntValue(PVR_ATTRIBUTE_INT_VALUE* data) : CStructHdl(data) {} | ||
| 92 | }; | ||
| 93 | ///@} | ||
| 94 | //------------------------------------------------------------------------------ | ||
| 95 | |||
| 96 | //============================================================================== | ||
| 97 | /// @defgroup cpp_kodi_addon_pvr_Defs_PVRCapabilities class PVRCapabilities | ||
| 98 | /// @ingroup cpp_kodi_addon_pvr_Defs_General | ||
| 99 | /// @brief **PVR add-on capabilities**\n | ||
| 100 | /// This class is needed to tell Kodi which options are supported on the addon. | ||
| 101 | /// | ||
| 102 | /// If a capability is set to **true**, then the corresponding methods from | ||
| 103 | /// @ref cpp_kodi_addon_pvr "kodi::addon::CInstancePVRClient" need to be | ||
| 104 | /// implemented. | ||
| 105 | /// | ||
| 106 | /// As default them all set to **false**. | ||
| 107 | /// | ||
| 108 | /// Used on @ref kodi::addon::CInstancePVRClient::GetCapabilities(). | ||
| 109 | /// | ||
| 110 | /// ---------------------------------------------------------------------------- | ||
| 111 | /// | ||
| 112 | /// @copydetails cpp_kodi_addon_pvr_Defs_PVRCapabilities_Help | ||
| 113 | /// | ||
| 114 | ///@{ | ||
| 115 | class PVRCapabilities | ||
| 116 | { | ||
| 117 | friend class CInstancePVRClient; | ||
| 118 | |||
| 119 | public: | ||
| 120 | /*! \cond PRIVATE */ | ||
| 121 | explicit PVRCapabilities() = delete; | ||
| 122 | /*! \endcond */ | ||
| 123 | |||
| 124 | /// @defgroup cpp_kodi_addon_pvr_Defs_PVRCapabilities_Help Value Help | ||
| 125 | /// @ingroup cpp_kodi_addon_pvr_Defs_PVRCapabilities | ||
| 126 | /// ---------------------------------------------------------------------------- | ||
| 127 | /// | ||
| 128 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_PVRCapabilities :</b> | ||
| 129 | /// | Name | Type | Set call | Get call | ||
| 130 | /// |------|------|----------|---------- | ||
| 131 | /// | **Supports EPG** | `boolean` | @ref PVRCapabilities::SetSupportsEPG "SetSupportsEPG" | @ref PVRCapabilities::GetSupportsEPG "GetSupportsEPG" | ||
| 132 | /// | **Supports EPG EDL** | `boolean` | @ref PVRCapabilities::SetSupportsEPGEdl "SetSupportsEPGEdl" | @ref PVRCapabilities::GetSupportsEPGEdl "GetSupportsEPGEdl" | ||
| 133 | /// | **Supports TV** | `boolean` | @ref PVRCapabilities::SetSupportsTV "SetSupportsTV" | @ref PVRCapabilities::GetSupportsTV "GetSupportsTV" | ||
| 134 | /// | **Supports radio** | `boolean` | @ref PVRCapabilities::SetSupportsRadio "SetSupportsRadio" | @ref PVRCapabilities::GetSupportsRadio "GetSupportsRadio" | ||
| 135 | /// | **Supports recordings** | `boolean` | @ref PVRCapabilities::SetSupportsRecordings "SetSupportsRecordings" | @ref PVRCapabilities::GetSupportsRecordings "GetSupportsRecordings" | ||
| 136 | /// | **Supports recordings undelete** | `boolean` | @ref PVRCapabilities::SetSupportsRecordingsUndelete "SetSupportsRecordingsUndelete" | @ref PVRCapabilities::GetSupportsRecordingsUndelete "SetSupportsRecordingsUndelete" | ||
| 137 | /// | **Supports timers** | `boolean` | @ref PVRCapabilities::SetSupportsTimers "SetSupportsTimers" | @ref PVRCapabilities::GetSupportsTimers "GetSupportsTimers" | ||
| 138 | /// | **Supports channel groups** | `boolean` | @ref PVRCapabilities::SetSupportsChannelGroups "SetSupportsChannelGroups" | @ref PVRCapabilities::GetSupportsChannelGroups "GetSupportsChannelGroups" | ||
| 139 | /// | **Supports channel scan** | `boolean` | @ref PVRCapabilities::SetSupportsChannelScan "SetSupportsChannelScan" | @ref PVRCapabilities::GetSupportsChannelScan "GetSupportsChannelScan" | ||
| 140 | /// | **Supports channel settings** | `boolean` | @ref PVRCapabilities::SetSupportsChannelSettings "SetSupportsChannelSettings" | @ref PVRCapabilities::GetSupportsChannelSettings "GetSupportsChannelSettings" | ||
| 141 | /// | **Handles input stream** | `boolean` | @ref PVRCapabilities::SetHandlesInputStream "SetHandlesInputStream" | @ref PVRCapabilities::GetHandlesInputStream "GetHandlesInputStream" | ||
| 142 | /// | **Handles demuxing** | `boolean` | @ref PVRCapabilities::SetHandlesDemuxing "SetHandlesDemuxing" | @ref PVRCapabilities::GetHandlesDemuxing "GetHandlesDemuxing" | ||
| 143 | /// | **Supports recording play count** | `boolean` | @ref PVRCapabilities::SetSupportsRecordingPlayCount "SetSupportsRecordingPlayCount" | @ref PVRCapabilities::GetSupportsRecordingPlayCount "GetSupportsRecordingPlayCount" | ||
| 144 | /// | **Supports last played position** | `boolean` | @ref PVRCapabilities::SetSupportsLastPlayedPosition "SetSupportsLastPlayedPosition" | @ref PVRCapabilities::GetSupportsLastPlayedPosition "GetSupportsLastPlayedPosition" | ||
| 145 | /// | **Supports recording EDL** | `boolean` | @ref PVRCapabilities::SetSupportsRecordingEdl "SetSupportsRecordingEdl" | @ref PVRCapabilities::GetSupportsRecordingEdl "GetSupportsRecordingEdl" | ||
| 146 | /// | **Supports recordings rename** | `boolean` | @ref PVRCapabilities::SetSupportsRecordingsRename "SetSupportsRecordingsRename" | @ref PVRCapabilities::GetSupportsRecordingsRename "GetSupportsRecordingsRename" | ||
| 147 | /// | **Supports recordings lifetime change** | `boolean` | @ref PVRCapabilities::SetSupportsRecordingsLifetimeChange "SetSupportsRecordingsLifetimeChange" | @ref PVRCapabilities::GetSupportsRecordingsLifetimeChange "GetSupportsRecordingsLifetimeChange" | ||
| 148 | /// | **Supports descramble info** | `boolean` | @ref PVRCapabilities::SetSupportsDescrambleInfo "SetSupportsDescrambleInfo" | @ref PVRCapabilities::GetSupportsDescrambleInfo "GetSupportsDescrambleInfo" | ||
| 149 | /// | **Supports async EPG transfer** | `boolean` | @ref PVRCapabilities::SetSupportsAsyncEPGTransfer "SetSupportsAsyncEPGTransfer" | @ref PVRCapabilities::GetSupportsAsyncEPGTransfer "GetSupportsAsyncEPGTransfer" | ||
| 150 | /// | **Supports recording size** | `boolean` | @ref PVRCapabilities::SetSupportsRecordingSize "SetSupportsRecordingSize" | @ref PVRCapabilities::GetSupportsRecordingSize "GetSupportsRecordingSize" | ||
| 151 | /// | **Recordings lifetime values** | @ref cpp_kodi_addon_pvr_Defs_PVRTypeIntValue "PVRTypeIntValue" | @ref PVRCapabilities::SetRecordingsLifetimeValues "SetRecordingsLifetimeValues" | @ref PVRCapabilities::GetRecordingsLifetimeValues "GetRecordingsLifetimeValues" | ||
| 152 | /// | ||
| 153 | /// @warning This class can not be used outside of @ref kodi::addon::CInstancePVRClient::GetCapabilities() | ||
| 154 | /// | ||
| 155 | |||
| 156 | /// @addtogroup cpp_kodi_addon_pvr_Defs_PVRCapabilities | ||
| 157 | ///@{ | ||
| 158 | |||
| 159 | /// @brief Set **true** if the add-on provides EPG information. | ||
| 160 | void SetSupportsEPG(bool supportsEPG) { m_capabilities->bSupportsEPG = supportsEPG; } | ||
| 161 | |||
| 162 | /// @brief To get with @ref SetSupportsEPG changed values. | ||
| 163 | bool GetSupportsEPG() const { return m_capabilities->bSupportsEPG; } | ||
| 164 | |||
| 165 | /// @brief Set **true** if the backend supports retrieving an edit decision | ||
| 166 | /// list for an EPG tag. | ||
| 167 | void SetSupportsEPGEdl(bool supportsEPGEdl) { m_capabilities->bSupportsEPGEdl = supportsEPGEdl; } | ||
| 168 | |||
| 169 | /// @brief To get with @ref SetSupportsEPGEdl changed values. | ||
| 170 | bool GetSupportsEPGEdl() const { return m_capabilities->bSupportsEPGEdl; } | ||
| 171 | |||
| 172 | /// @brief Set **true** if this add-on provides TV channels. | ||
| 173 | void SetSupportsTV(bool supportsTV) { m_capabilities->bSupportsTV = supportsTV; } | ||
| 174 | |||
| 175 | /// @brief To get with @ref SetSupportsTV changed values. | ||
| 176 | bool GetSupportsTV() const { return m_capabilities->bSupportsTV; } | ||
| 177 | |||
| 178 | /// @brief Set **true** if this add-on provides TV channels. | ||
| 179 | void SetSupportsRadio(bool supportsRadio) { m_capabilities->bSupportsRadio = supportsRadio; } | ||
| 180 | |||
| 181 | /// @brief To get with @ref SetSupportsRadio changed values. | ||
| 182 | bool GetSupportsRadio() const { return m_capabilities->bSupportsRadio; } | ||
| 183 | |||
| 184 | /// @brief **true** if this add-on supports playback of recordings stored on | ||
| 185 | /// the backend. | ||
| 186 | void SetSupportsRecordings(bool supportsRecordings) | ||
| 187 | { | ||
| 188 | m_capabilities->bSupportsRecordings = supportsRecordings; | ||
| 189 | } | ||
| 190 | |||
| 191 | /// @brief To get with @ref SetSupportsRecordings changed values. | ||
| 192 | bool GetSupportsRecordings() const { return m_capabilities->bSupportsRecordings; } | ||
| 193 | |||
| 194 | /// @brief Set **true** if this add-on supports undelete of recordings stored | ||
| 195 | /// on the backend. | ||
| 196 | void SetSupportsRecordingsUndelete(bool supportsRecordingsUndelete) | ||
| 197 | { | ||
| 198 | m_capabilities->bSupportsRecordingsUndelete = supportsRecordingsUndelete; | ||
| 199 | } | ||
| 200 | |||
| 201 | /// @brief To get with @ref SetSupportsRecordings changed values. | ||
| 202 | bool GetSupportsRecordingsUndelete() const { return m_capabilities->bSupportsRecordingsUndelete; } | ||
| 203 | |||
| 204 | /// @brief Set **true** if this add-on supports the creation and editing of | ||
| 205 | /// timers. | ||
| 206 | void SetSupportsTimers(bool supportsTimers) { m_capabilities->bSupportsTimers = supportsTimers; } | ||
| 207 | |||
| 208 | /// @brief To get with @ref SetSupportsTimers changed values. | ||
| 209 | bool GetSupportsTimers() const { return m_capabilities->bSupportsTimers; } | ||
| 210 | |||
| 211 | /// @brief Set **true** if this add-on supports channel groups. | ||
| 212 | /// | ||
| 213 | /// It use the following functions: | ||
| 214 | /// - @ref kodi::addon::CInstancePVRClient::GetChannelGroupsAmount() | ||
| 215 | /// - @ref kodi::addon::CInstancePVRClient::GetChannelGroups() | ||
| 216 | /// - @ref kodi::addon::CInstancePVRClient::GetChannelGroupMembers() | ||
| 217 | void SetSupportsChannelGroups(bool supportsChannelGroups) | ||
| 218 | { | ||
| 219 | m_capabilities->bSupportsChannelGroups = supportsChannelGroups; | ||
| 220 | } | ||
| 221 | |||
| 222 | /// @brief To get with @ref SetSupportsChannelGroups changed values. | ||
| 223 | bool GetSupportsChannelGroups() const { return m_capabilities->bSupportsChannelGroups; } | ||
| 224 | |||
| 225 | /// @brief Set **true** if this add-on support scanning for new channels on | ||
| 226 | /// the backend. | ||
| 227 | /// | ||
| 228 | /// It use the following function: | ||
| 229 | /// - @ref kodi::addon::CInstancePVRClient::OpenDialogChannelScan() | ||
| 230 | void SetSupportsChannelScan(bool supportsChannelScan) | ||
| 231 | { | ||
| 232 | m_capabilities->bSupportsChannelScan = supportsChannelScan; | ||
| 233 | } | ||
| 234 | |||
| 235 | /// @brief To get with @ref SetSupportsChannelScan changed values. | ||
| 236 | bool GetSupportsChannelScan() const { return m_capabilities->bSupportsChannelScan; } | ||
| 237 | |||
| 238 | /// @brief Set **true** if this add-on supports channel edit. | ||
| 239 | /// | ||
| 240 | /// It use the following functions: | ||
| 241 | /// - @ref kodi::addon::CInstancePVRClient::DeleteChannel() | ||
| 242 | /// - @ref kodi::addon::CInstancePVRClient::RenameChannel() | ||
| 243 | /// - @ref kodi::addon::CInstancePVRClient::OpenDialogChannelSettings() | ||
| 244 | /// - @ref kodi::addon::CInstancePVRClient::OpenDialogChannelAdd() | ||
| 245 | void SetSupportsChannelSettings(bool supportsChannelSettings) | ||
| 246 | { | ||
| 247 | m_capabilities->bSupportsChannelSettings = supportsChannelSettings; | ||
| 248 | } | ||
| 249 | |||
| 250 | /// @brief To get with @ref SetSupportsChannelSettings changed values. | ||
| 251 | bool GetSupportsChannelSettings() const { return m_capabilities->bSupportsChannelSettings; } | ||
| 252 | |||
| 253 | /// @brief Set **true** if this add-on provides an input stream. false if Kodi | ||
| 254 | /// handles the stream. | ||
| 255 | void SetHandlesInputStream(bool handlesInputStream) | ||
| 256 | { | ||
| 257 | m_capabilities->bHandlesInputStream = handlesInputStream; | ||
| 258 | } | ||
| 259 | |||
| 260 | /// @brief To get with @ref SetHandlesInputStream changed values. | ||
| 261 | bool GetHandlesInputStream() const { return m_capabilities->bHandlesInputStream; } | ||
| 262 | |||
| 263 | /// @brief Set **true** if this add-on demultiplexes packets. | ||
| 264 | void SetHandlesDemuxing(bool handlesDemuxing) | ||
| 265 | { | ||
| 266 | m_capabilities->bHandlesDemuxing = handlesDemuxing; | ||
| 267 | } | ||
| 268 | |||
| 269 | /// @brief To get with @ref SetHandlesDemuxing changed values. | ||
| 270 | bool GetHandlesDemuxing() const { return m_capabilities->bHandlesDemuxing; } | ||
| 271 | |||
| 272 | /// @brief Set **true** if the backend supports play count for recordings. | ||
| 273 | void SetSupportsRecordingPlayCount(bool supportsRecordingPlayCount) | ||
| 274 | { | ||
| 275 | m_capabilities->bSupportsRecordingPlayCount = supportsRecordingPlayCount; | ||
| 276 | } | ||
| 277 | |||
| 278 | /// @brief To get with @ref SetSupportsRecordingPlayCount changed values. | ||
| 279 | bool GetSupportsRecordingPlayCount() const { return m_capabilities->bSupportsRecordingPlayCount; } | ||
| 280 | |||
| 281 | /// @brief Set **true** if the backend supports store/retrieve of last played | ||
| 282 | /// position for recordings. | ||
| 283 | void SetSupportsLastPlayedPosition(bool supportsLastPlayedPosition) | ||
| 284 | { | ||
| 285 | m_capabilities->bSupportsLastPlayedPosition = supportsLastPlayedPosition; | ||
| 286 | } | ||
| 287 | |||
| 288 | /// @brief To get with @ref SetSupportsLastPlayedPosition changed values. | ||
| 289 | bool GetSupportsLastPlayedPosition() const { return m_capabilities->bSupportsLastPlayedPosition; } | ||
| 290 | |||
| 291 | /// @brief Set **true** if the backend supports retrieving an edit decision | ||
| 292 | /// list for recordings. | ||
| 293 | void SetSupportsRecordingEdl(bool supportsRecordingEdl) | ||
| 294 | { | ||
| 295 | m_capabilities->bSupportsRecordingEdl = supportsRecordingEdl; | ||
| 296 | } | ||
| 297 | |||
| 298 | /// @brief To get with @ref SetSupportsRecordingEdl changed values. | ||
| 299 | bool GetSupportsRecordingEdl() const { return m_capabilities->bSupportsRecordingEdl; } | ||
| 300 | |||
| 301 | /// @brief Set **true** if the backend supports renaming recordings. | ||
| 302 | void SetSupportsRecordingsRename(bool supportsRecordingsRename) | ||
| 303 | { | ||
| 304 | m_capabilities->bSupportsRecordingsRename = supportsRecordingsRename; | ||
| 305 | } | ||
| 306 | |||
| 307 | /// @brief To get with @ref SetSupportsRecordingsRename changed values. | ||
| 308 | bool GetSupportsRecordingsRename() const { return m_capabilities->bSupportsRecordingsRename; } | ||
| 309 | |||
| 310 | /// @brief Set **true** if the backend supports changing lifetime for | ||
| 311 | /// recordings. | ||
| 312 | void SetSupportsRecordingsLifetimeChange(bool supportsRecordingsLifetimeChange) | ||
| 313 | { | ||
| 314 | m_capabilities->bSupportsRecordingsLifetimeChange = supportsRecordingsLifetimeChange; | ||
| 315 | } | ||
| 316 | |||
| 317 | /// @brief To get with @ref SetSupportsRecordingsLifetimeChange changed | ||
| 318 | /// values. | ||
| 319 | bool GetSupportsRecordingsLifetimeChange() const | ||
| 320 | { | ||
| 321 | return m_capabilities->bSupportsRecordingsLifetimeChange; | ||
| 322 | } | ||
| 323 | |||
| 324 | /// @brief Set **true** if the backend supports descramble information for | ||
| 325 | /// playing channels. | ||
| 326 | void SetSupportsDescrambleInfo(bool supportsDescrambleInfo) | ||
| 327 | { | ||
| 328 | m_capabilities->bSupportsDescrambleInfo = supportsDescrambleInfo; | ||
| 329 | } | ||
| 330 | |||
| 331 | /// @brief To get with @ref SetSupportsDescrambleInfo changed values. | ||
| 332 | bool GetSupportsDescrambleInfo() const { return m_capabilities->bSupportsDescrambleInfo; } | ||
| 333 | |||
| 334 | /// @brief Set **true** if this addon-on supports asynchronous transfer of epg | ||
| 335 | /// events to Kodi using the callback function | ||
| 336 | /// @ref kodi::addon::CInstancePVRClient::EpgEventStateChange(). | ||
| 337 | void SetSupportsAsyncEPGTransfer(bool supportsAsyncEPGTransfer) | ||
| 338 | { | ||
| 339 | m_capabilities->bSupportsAsyncEPGTransfer = supportsAsyncEPGTransfer; | ||
| 340 | } | ||
| 341 | |||
| 342 | /// @brief To get with @ref SetSupportsAsyncEPGTransfer changed values. | ||
| 343 | bool GetSupportsAsyncEPGTransfer() const { return m_capabilities->bSupportsAsyncEPGTransfer; } | ||
| 344 | |||
| 345 | /// @brief Set **true** if this addon-on supports retrieving size of recordings. | ||
| 346 | void SetSupportsRecordingSize(bool supportsRecordingSize) | ||
| 347 | { | ||
| 348 | m_capabilities->bSupportsRecordingSize = supportsRecordingSize; | ||
| 349 | } | ||
| 350 | |||
| 351 | /// @brief To get with @ref SetSupportsRecordingSize changed values. | ||
| 352 | bool GetSupportsRecordingSize() const { return m_capabilities->bSupportsRecordingSize; } | ||
| 353 | |||
| 354 | /// @brief **optional**\n | ||
| 355 | /// Set array containing the possible values for @ref PVRRecording::SetLifetime(). | ||
| 356 | /// | ||
| 357 | /// -------------------------------------------------------------------------- | ||
| 358 | /// | ||
| 359 | /// @copydetails cpp_kodi_addon_pvr_Defs_PVRTypeIntValue_Help | ||
| 360 | void SetRecordingsLifetimeValues( | ||
| 361 | const std::vector<PVRTypeIntValue>& recordingsLifetimeValues) | ||
| 362 | { | ||
| 363 | m_capabilities->iRecordingsLifetimesSize = 0; | ||
| 364 | for (unsigned int i = 0; i < recordingsLifetimeValues.size() && | ||
| 365 | i < sizeof(m_capabilities->recordingsLifetimeValues); | ||
| 366 | ++i) | ||
| 367 | { | ||
| 368 | m_capabilities->recordingsLifetimeValues[i].iValue = | ||
| 369 | recordingsLifetimeValues[i].GetCStructure()->iValue; | ||
| 370 | strncpy(m_capabilities->recordingsLifetimeValues[i].strDescription, | ||
| 371 | recordingsLifetimeValues[i].GetCStructure()->strDescription, | ||
| 372 | sizeof(m_capabilities->recordingsLifetimeValues[i].strDescription) - 1); | ||
| 373 | ++m_capabilities->iRecordingsLifetimesSize; | ||
| 374 | } | ||
| 375 | } | ||
| 376 | |||
| 377 | /// @brief To get with @ref SetRecordingsLifetimeValues changed values. | ||
| 378 | std::vector<PVRTypeIntValue> GetRecordingsLifetimeValues() const | ||
| 379 | { | ||
| 380 | std::vector<PVRTypeIntValue> recordingsLifetimeValues; | ||
| 381 | for (unsigned int i = 0; i < m_capabilities->iRecordingsLifetimesSize; ++i) | ||
| 382 | recordingsLifetimeValues.emplace_back( | ||
| 383 | m_capabilities->recordingsLifetimeValues[i].iValue, | ||
| 384 | m_capabilities->recordingsLifetimeValues[i].strDescription); | ||
| 385 | return recordingsLifetimeValues; | ||
| 386 | } | ||
| 387 | ///@} | ||
| 388 | |||
| 389 | private: | ||
| 390 | PVRCapabilities(PVR_ADDON_CAPABILITIES* capabilities) : m_capabilities(capabilities) {} | ||
| 391 | |||
| 392 | PVR_ADDON_CAPABILITIES* m_capabilities; | ||
| 393 | }; | ||
| 394 | ///@} | ||
| 395 | //------------------------------------------------------------------------------ | ||
| 396 | |||
| 397 | //============================================================================== | ||
| 398 | /// @defgroup cpp_kodi_addon_pvr_Defs_General_Inputstream_PVRStreamProperty class PVRStreamProperty | ||
| 399 | /// @ingroup cpp_kodi_addon_pvr_Defs_General_Inputstream | ||
| 400 | /// @brief **PVR stream property value handler**\n | ||
| 401 | /// To set for Kodi wanted stream properties. | ||
| 402 | /// | ||
| 403 | /// ---------------------------------------------------------------------------- | ||
| 404 | /// | ||
| 405 | /// @copydetails cpp_kodi_addon_pvr_Defs_General_Inputstream_PVRStreamProperty_Help | ||
| 406 | /// | ||
| 407 | ///--------------------------------------------------------------------------- | ||
| 408 | /// | ||
| 409 | /// **Example:** | ||
| 410 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 411 | /// ... | ||
| 412 | /// | ||
| 413 | /// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, | ||
| 414 | /// std::vector<kodi::addon::PVRStreamProperty>& properties) | ||
| 415 | /// { | ||
| 416 | /// ... | ||
| 417 | /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive"); | ||
| 418 | /// return PVR_ERROR_NO_ERROR; | ||
| 419 | /// } | ||
| 420 | /// | ||
| 421 | /// ... | ||
| 422 | /// ~~~~~~~~~~~~~ | ||
| 423 | /// | ||
| 424 | /// | ||
| 425 | /// **Example 2:** | ||
| 426 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 427 | /// ... | ||
| 428 | /// | ||
| 429 | /// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, | ||
| 430 | /// std::vector<kodi::addon::PVRStreamProperty>& properties) | ||
| 431 | /// { | ||
| 432 | /// ... | ||
| 433 | /// kodi::addon::PVRStreamProperty property; | ||
| 434 | /// property.SetName(PVR_STREAM_PROPERTY_INPUTSTREAM); | ||
| 435 | /// property.SetValue("inputstream.adaptive"); | ||
| 436 | /// properties.emplace_back(property); | ||
| 437 | /// return PVR_ERROR_NO_ERROR; | ||
| 438 | /// } | ||
| 439 | /// | ||
| 440 | /// ... | ||
| 441 | /// ~~~~~~~~~~~~~ | ||
| 442 | /// | ||
| 443 | ///@{ | ||
| 444 | class PVRStreamProperty : public CStructHdl<PVRStreamProperty, PVR_NAMED_VALUE> | ||
| 445 | { | ||
| 446 | friend class CInstancePVRClient; | ||
| 447 | |||
| 448 | public: | ||
| 449 | /*! \cond PRIVATE */ | ||
| 450 | PVRStreamProperty(const PVRStreamProperty& data) : CStructHdl(data) {} | ||
| 451 | /*! \endcond */ | ||
| 452 | |||
| 453 | /// @defgroup cpp_kodi_addon_pvr_Defs_General_Inputstream_PVRStreamProperty_Help Value Help | ||
| 454 | /// @ingroup cpp_kodi_addon_pvr_Defs_General_Inputstream_PVRStreamProperty | ||
| 455 | /// | ||
| 456 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_General_Inputstream_PVRStreamProperty :</b> | ||
| 457 | /// | Name | Type | Set call | Get call | ||
| 458 | /// |------|------|----------|---------- | ||
| 459 | /// | **Name** | `int` | @ref PVRStreamProperty::SetValue "SetName" | @ref PVRStreamProperty::GetName "GetName" | ||
| 460 | /// | **Value** | `std::string` | @ref PVRStreamProperty::SetValue "SetValue" | @ref PVRStreamProperty::GetValue "GetValue" | ||
| 461 | /// | ||
| 462 | /// @remark Further can there be used his class constructor to set values. | ||
| 463 | |||
| 464 | /// @addtogroup cpp_kodi_addon_pvr_Defs_General_Inputstream_PVRStreamProperty | ||
| 465 | ///@{ | ||
| 466 | |||
| 467 | /// @brief Default class constructor. | ||
| 468 | /// | ||
| 469 | /// @note Values must be set afterwards. | ||
| 470 | PVRStreamProperty() = default; | ||
| 471 | |||
| 472 | /// @brief Class constructor with integrated value set. | ||
| 473 | /// | ||
| 474 | /// @param[in] name Type identification | ||
| 475 | /// @param[in] value Type used property value | ||
| 476 | PVRStreamProperty(const std::string& name, const std::string& value) | ||
| 477 | { | ||
| 478 | SetName(name); | ||
| 479 | SetValue(value); | ||
| 480 | } | ||
| 481 | |||
| 482 | /// @brief To set with the identification name. | ||
| 483 | void SetName(const std::string& name) | ||
| 484 | { | ||
| 485 | strncpy(m_cStructure->strName, name.c_str(), sizeof(m_cStructure->strName) - 1); | ||
| 486 | } | ||
| 487 | |||
| 488 | /// @brief To get with the identification name. | ||
| 489 | std::string GetName() const { return m_cStructure->strName; } | ||
| 490 | |||
| 491 | /// @brief To set with the used property value. | ||
| 492 | void SetValue(const std::string& value) | ||
| 493 | { | ||
| 494 | strncpy(m_cStructure->strValue, value.c_str(), sizeof(m_cStructure->strValue) - 1); | ||
| 495 | } | ||
| 496 | |||
| 497 | /// @brief To get with the used property value. | ||
| 498 | std::string GetValue() const { return m_cStructure->strValue; } | ||
| 499 | ///@} | ||
| 500 | |||
| 501 | private: | ||
| 502 | PVRStreamProperty(const PVR_NAMED_VALUE* data) : CStructHdl(data) {} | ||
| 503 | PVRStreamProperty(PVR_NAMED_VALUE* data) : CStructHdl(data) {} | ||
| 504 | }; | ||
| 505 | ///@} | ||
| 506 | //------------------------------------------------------------------------------ | ||
| 507 | |||
| 508 | } /* namespace addon */ | ||
| 509 | } /* namespace kodi */ | ||
| 510 | |||
| 511 | #endif /* __cplusplus */ | ||
