diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Channels.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Channels.h | 518 |
1 files changed, 518 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Channels.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Channels.h new file mode 100644 index 0000000..9c2f5d2 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Channels.h | |||
| @@ -0,0 +1,518 @@ | |||
| 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.h" | ||
| 13 | |||
| 14 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ | ||
| 15 | // "C++" Definitions group 2 - PVR channel | ||
| 16 | #ifdef __cplusplus | ||
| 17 | |||
| 18 | namespace kodi | ||
| 19 | { | ||
| 20 | namespace addon | ||
| 21 | { | ||
| 22 | |||
| 23 | //============================================================================== | ||
| 24 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannel class PVRChannel | ||
| 25 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel | ||
| 26 | /// @brief **Channel data structure**\n | ||
| 27 | /// Representation of a TV or radio channel. | ||
| 28 | /// | ||
| 29 | /// This is used to store all the necessary TV or radio channel data and can | ||
| 30 | /// either provide the necessary data from / to Kodi for the associated | ||
| 31 | /// functions or can also be used in the addon to store its data. | ||
| 32 | /// | ||
| 33 | /// ---------------------------------------------------------------------------- | ||
| 34 | /// | ||
| 35 | /// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRChannel_Help | ||
| 36 | /// | ||
| 37 | ///@{ | ||
| 38 | class PVRChannel : public CStructHdl<PVRChannel, PVR_CHANNEL> | ||
| 39 | { | ||
| 40 | friend class CInstancePVRClient; | ||
| 41 | |||
| 42 | public: | ||
| 43 | /*! \cond PRIVATE */ | ||
| 44 | PVRChannel() { memset(m_cStructure, 0, sizeof(PVR_CHANNEL)); } | ||
| 45 | PVRChannel(const PVRChannel& channel) : CStructHdl(channel) {} | ||
| 46 | /*! \endcond */ | ||
| 47 | |||
| 48 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannel_Help Value Help | ||
| 49 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannel | ||
| 50 | /// | ||
| 51 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Channel_PVRChannel :</b> | ||
| 52 | /// | Name | Type | Set call | Get call | Usage | ||
| 53 | /// |------|------|----------|----------|----------- | ||
| 54 | /// | **Unique id** | `unsigned int` | @ref PVRChannel::SetUniqueId "SetUniqueId" | @ref PVRChannel::GetUniqueId "GetUniqueId" | *required to set* | ||
| 55 | /// | **Is radio** | `bool` | @ref PVRChannel::SetIsRadio "SetIsRadio" | @ref PVRChannel::GetIsRadio "GetIsRadio" | *required to set* | ||
| 56 | /// | **Channel number** | `unsigned int` | @ref PVRChannel::SetChannelNumber "SetChannelNumber" | @ref PVRChannel::GetChannelNumber "GetChannelNumber" | *optional* | ||
| 57 | /// | **Sub channel number** | `unsigned int` | @ref PVRChannel::SetSubChannelNumber "SetSubChannelNumber" | @ref PVRChannel::GetSubChannelNumber "GetSubChannelNumber" | *optional* | ||
| 58 | /// | **Channel name** | `std::string` | @ref PVRChannel::SetChannelName "SetChannelName" | @ref PVRChannel::GetChannelName "GetChannelName" | *optional* | ||
| 59 | /// | **Mime type** | `std::string` | @ref PVRChannel::SetMimeType "SetMimeType" | @ref PVRChannel::GetMimeType "GetMimeType" | *optional* | ||
| 60 | /// | **Encryption system** | `unsigned int` | @ref PVRChannel::SetEncryptionSystem "SetEncryptionSystem" | @ref PVRChannel::GetEncryptionSystem "GetEncryptionSystem" | *optional* | ||
| 61 | /// | **Icon path** | `std::string` | @ref PVRChannel::SetIconPath "SetIconPath" | @ref PVRChannel::GetIconPath "GetIconPath" | *optional* | ||
| 62 | /// | **Is hidden** | `bool` | @ref PVRChannel::SetIsHidden "SetIsHidden" | @ref PVRChannel::GetIsHidden "GetIsHidden" | *optional* | ||
| 63 | /// | **Has archive** | `bool` | @ref PVRChannel::SetHasArchive "SetHasArchive" | @ref PVRChannel::GetHasArchive "GetHasArchive" | *optional* | ||
| 64 | /// | **Order** | `int` | @ref PVRChannel::SetOrder "SetOrder" | @ref PVRChannel::GetOrder "GetOrder" | *optional* | ||
| 65 | /// | ||
| 66 | |||
| 67 | /// @addtogroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannel | ||
| 68 | ///@{ | ||
| 69 | |||
| 70 | /// @brief **required**\n | ||
| 71 | /// Unique identifier for this channel. | ||
| 72 | void SetUniqueId(unsigned int uniqueId) { m_cStructure->iUniqueId = uniqueId; } | ||
| 73 | |||
| 74 | /// @brief To get with @ref SetUniqueId changed values. | ||
| 75 | unsigned int GetUniqueId() const { return m_cStructure->iUniqueId; } | ||
| 76 | |||
| 77 | /// @brief **required**\n | ||
| 78 | /// **true** if this is a radio channel, **false** if it's a TV channel. | ||
| 79 | void SetIsRadio(bool isRadio) { m_cStructure->bIsRadio = isRadio; } | ||
| 80 | |||
| 81 | /// @brief To get with @ref SetIsRadio changed values. | ||
| 82 | bool GetIsRadio() const { return m_cStructure->bIsRadio; } | ||
| 83 | |||
| 84 | /// @brief **optional**\n | ||
| 85 | /// Channel number of this channel on the backend. | ||
| 86 | void SetChannelNumber(unsigned int channelNumber) | ||
| 87 | { | ||
| 88 | m_cStructure->iChannelNumber = channelNumber; | ||
| 89 | } | ||
| 90 | |||
| 91 | /// @brief To get with @ref SetChannelNumber changed values. | ||
| 92 | unsigned int GetChannelNumber() const { return m_cStructure->iChannelNumber; } | ||
| 93 | |||
| 94 | /// @brief **optional**\n | ||
| 95 | /// Sub channel number of this channel on the backend (ATSC). | ||
| 96 | void SetSubChannelNumber(unsigned int subChannelNumber) | ||
| 97 | { | ||
| 98 | m_cStructure->iSubChannelNumber = subChannelNumber; | ||
| 99 | } | ||
| 100 | |||
| 101 | /// @brief To get with @ref SetSubChannelNumber changed values. | ||
| 102 | unsigned int GetSubChannelNumber() const { return m_cStructure->iSubChannelNumber; } | ||
| 103 | |||
| 104 | /// @brief **optional**\n | ||
| 105 | /// Channel name given to this channel. | ||
| 106 | void SetChannelName(const std::string& channelName) | ||
| 107 | { | ||
| 108 | strncpy(m_cStructure->strChannelName, channelName.c_str(), | ||
| 109 | sizeof(m_cStructure->strChannelName) - 1); | ||
| 110 | } | ||
| 111 | |||
| 112 | /// @brief To get with @ref SetChannelName changed values. | ||
| 113 | std::string GetChannelName() const { return m_cStructure->strChannelName; } | ||
| 114 | |||
| 115 | /// @brief **optional**\n | ||
| 116 | /// Input format mime type. | ||
| 117 | /// | ||
| 118 | /// Available types can be found in https://www.iana.org/assignments/media-types/media-types.xhtml | ||
| 119 | /// on "application" and "video" or leave empty if unknown. | ||
| 120 | /// | ||
| 121 | void SetMimeType(const std::string& inputFormat) | ||
| 122 | { | ||
| 123 | strncpy(m_cStructure->strMimeType, inputFormat.c_str(), sizeof(m_cStructure->strMimeType) - 1); | ||
| 124 | } | ||
| 125 | |||
| 126 | /// @brief To get with @ref SetMimeType changed values. | ||
| 127 | std::string GetMimeType() const { return m_cStructure->strMimeType; } | ||
| 128 | |||
| 129 | /// @brief **optional**\n | ||
| 130 | /// The encryption ID or CaID of this channel (Conditional access systems). | ||
| 131 | /// | ||
| 132 | /// Lists about available ID's: | ||
| 133 | /// - http://www.dvb.org/index.php?id=174 | ||
| 134 | /// - http://en.wikipedia.org/wiki/Conditional_access_system | ||
| 135 | /// | ||
| 136 | void SetEncryptionSystem(unsigned int encryptionSystem) | ||
| 137 | { | ||
| 138 | m_cStructure->iEncryptionSystem = encryptionSystem; | ||
| 139 | } | ||
| 140 | |||
| 141 | /// @brief To get with @ref SetEncryptionSystem changed values. | ||
| 142 | unsigned int GetEncryptionSystem() const { return m_cStructure->iEncryptionSystem; } | ||
| 143 | |||
| 144 | /// @brief **optional**\n | ||
| 145 | /// Path to the channel icon (if present). | ||
| 146 | void SetIconPath(const std::string& iconPath) | ||
| 147 | { | ||
| 148 | strncpy(m_cStructure->strIconPath, iconPath.c_str(), sizeof(m_cStructure->strIconPath) - 1); | ||
| 149 | } | ||
| 150 | |||
| 151 | /// @brief To get with @ref SetIconPath changed values. | ||
| 152 | std::string GetIconPath() const { return m_cStructure->strIconPath; } | ||
| 153 | |||
| 154 | /// @brief **optional**\n | ||
| 155 | /// **true** if this channel is marked as hidden. | ||
| 156 | void SetIsHidden(bool isHidden) { m_cStructure->bIsHidden = isHidden; } | ||
| 157 | |||
| 158 | /// @brief To get with @ref GetIsRadio changed values. | ||
| 159 | bool GetIsHidden() const { return m_cStructure->bIsHidden; } | ||
| 160 | |||
| 161 | /// @brief **optional**\n | ||
| 162 | /// **true** if this channel has a server-side back buffer. | ||
| 163 | void SetHasArchive(bool hasArchive) { m_cStructure->bHasArchive = hasArchive; } | ||
| 164 | |||
| 165 | /// @brief To get with @ref GetIsRadio changed values. | ||
| 166 | bool GetHasArchive() const { return m_cStructure->bHasArchive; } | ||
| 167 | |||
| 168 | /// @brief **optional**\n | ||
| 169 | /// The value denoting the order of this channel in the 'All channels' group. | ||
| 170 | void SetOrder(bool order) { m_cStructure->iOrder = order; } | ||
| 171 | |||
| 172 | /// @brief To get with @ref SetOrder changed values. | ||
| 173 | bool GetOrder() const { return m_cStructure->iOrder; } | ||
| 174 | ///@} | ||
| 175 | |||
| 176 | private: | ||
| 177 | PVRChannel(const PVR_CHANNEL* channel) : CStructHdl(channel) {} | ||
| 178 | PVRChannel(PVR_CHANNEL* channel) : CStructHdl(channel) {} | ||
| 179 | }; | ||
| 180 | ///@} | ||
| 181 | //------------------------------------------------------------------------------ | ||
| 182 | |||
| 183 | //============================================================================== | ||
| 184 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannelsResultSet class PVRChannelsResultSet | ||
| 185 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannel | ||
| 186 | /// @brief **PVR add-on channel transfer class**\n | ||
| 187 | /// To transfer the content of @ref kodi::addon::CInstancePVRClient::GetChannels(). | ||
| 188 | /// | ||
| 189 | ///@{ | ||
| 190 | class PVRChannelsResultSet | ||
| 191 | { | ||
| 192 | public: | ||
| 193 | /*! \cond PRIVATE */ | ||
| 194 | PVRChannelsResultSet() = delete; | ||
| 195 | PVRChannelsResultSet(const AddonInstance_PVR* instance, ADDON_HANDLE handle) | ||
| 196 | : m_instance(instance), m_handle(handle) | ||
| 197 | { | ||
| 198 | } | ||
| 199 | /*! \endcond */ | ||
| 200 | |||
| 201 | /// @addtogroup cpp_kodi_addon_pvr_Defs_Channel_PVRChannelsResultSet | ||
| 202 | ///@{ | ||
| 203 | |||
| 204 | /// @brief To add and give content from addon to Kodi on related call. | ||
| 205 | /// | ||
| 206 | /// @param[in] tag The to transferred data. | ||
| 207 | void Add(const kodi::addon::PVRChannel& tag) | ||
| 208 | { | ||
| 209 | m_instance->toKodi->TransferChannelEntry(m_instance->toKodi->kodiInstance, m_handle, tag); | ||
| 210 | } | ||
| 211 | |||
| 212 | ///@} | ||
| 213 | |||
| 214 | private: | ||
| 215 | const AddonInstance_PVR* m_instance = nullptr; | ||
| 216 | const ADDON_HANDLE m_handle; | ||
| 217 | }; | ||
| 218 | ///@} | ||
| 219 | //------------------------------------------------------------------------------ | ||
| 220 | |||
| 221 | //============================================================================== | ||
| 222 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus class PVRSignalStatus | ||
| 223 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel | ||
| 224 | /// @brief **PVR Signal status information**\n | ||
| 225 | /// This class gives current status information from stream to Kodi. | ||
| 226 | /// | ||
| 227 | /// Used to get information for user by call of @ref kodi::addon::CInstancePVRClient::GetSignalStatus() | ||
| 228 | /// to see current quality and source. | ||
| 229 | /// | ||
| 230 | /// ---------------------------------------------------------------------------- | ||
| 231 | /// | ||
| 232 | /// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus_Help | ||
| 233 | /// | ||
| 234 | ///@{ | ||
| 235 | class PVRSignalStatus : public CStructHdl<PVRSignalStatus, PVR_SIGNAL_STATUS> | ||
| 236 | { | ||
| 237 | friend class CInstancePVRClient; | ||
| 238 | |||
| 239 | public: | ||
| 240 | /*! \cond PRIVATE */ | ||
| 241 | PVRSignalStatus() = default; | ||
| 242 | PVRSignalStatus(const PVRSignalStatus& type) : CStructHdl(type) {} | ||
| 243 | /*! \endcond */ | ||
| 244 | |||
| 245 | |||
| 246 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus_Help Value Help | ||
| 247 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus | ||
| 248 | /// | ||
| 249 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus :</b> | ||
| 250 | /// | Name | Type | Set call | Get call | Usage | ||
| 251 | /// |------|------|----------|----------|----------- | ||
| 252 | /// | **Adapter name** | `std::string` | @ref PVRSignalStatus::SetAdapterName "SetAdapterName" | @ref PVRSignalStatus::GetAdapterName "GetAdapterName" | *optional* | ||
| 253 | /// | **Adapter status** | `std::string` | @ref PVRSignalStatus::SetAdapterStatus "SetAdapterStatus" | @ref PVRSignalStatus::GetAdapterStatus "GetAdapterStatus" | *optional* | ||
| 254 | /// | **Service name** | `std::string` | @ref PVRSignalStatus::SetServiceName "SetServiceName" | @ref PVRSignalStatus::GetServiceName "GetServiceName" | *optional* | ||
| 255 | /// | **Provider name** | `std::string` | @ref PVRSignalStatus::SetProviderName "SetProviderName" | @ref PVRSignalStatus::GetProviderName "GetProviderName" | *optional* | ||
| 256 | /// | **Mux name** | `std::string` | @ref PVRSignalStatus::SetMuxName "SetMuxName" | @ref PVRSignalStatus::GetMuxName "GetMuxName" | *optional* | ||
| 257 | /// | **Signal/noise ratio** | `int` | @ref PVRSignalStatus::SetSNR "SetSNR" | @ref PVRSignalStatus::GetSNR "GetSNR" | *optional* | ||
| 258 | /// | **Signal strength** | `int` | @ref PVRSignalStatus::SetSignal "SetSignal" | @ref PVRSignalStatus::GetSignal "GetSignal" | *optional* | ||
| 259 | /// | **Bit error rate** | `long` | @ref PVRSignalStatus::SetBER "SetBER" | @ref PVRSignalStatus::GetBER "GetBER" | *optional* | ||
| 260 | /// | **Uncorrected blocks** | `long` | @ref PVRSignalStatus::SetUNC "SetUNC" | @ref PVRSignalStatus::GetUNC "GetUNC" | *optional* | ||
| 261 | /// | ||
| 262 | |||
| 263 | /// @addtogroup cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus | ||
| 264 | ///@{ | ||
| 265 | |||
| 266 | /// @brief **optional**\n | ||
| 267 | /// Name of the adapter that's being used. | ||
| 268 | void SetAdapterName(const std::string& adapterName) | ||
| 269 | { | ||
| 270 | strncpy(m_cStructure->strAdapterName, adapterName.c_str(), | ||
| 271 | sizeof(m_cStructure->strAdapterName) - 1); | ||
| 272 | } | ||
| 273 | |||
| 274 | /// @brief To get with @ref SetAdapterName changed values. | ||
| 275 | std::string GetAdapterName() const { return m_cStructure->strAdapterName; } | ||
| 276 | |||
| 277 | /// @brief **optional**\n | ||
| 278 | /// Status of the adapter that's being used. | ||
| 279 | void SetAdapterStatus(const std::string& adapterStatus) | ||
| 280 | { | ||
| 281 | strncpy(m_cStructure->strAdapterStatus, adapterStatus.c_str(), | ||
| 282 | sizeof(m_cStructure->strAdapterStatus) - 1); | ||
| 283 | } | ||
| 284 | |||
| 285 | /// @brief To get with @ref SetAdapterStatus changed values. | ||
| 286 | std::string GetAdapterStatus() const { return m_cStructure->strAdapterStatus; } | ||
| 287 | |||
| 288 | /// @brief **optional**\n | ||
| 289 | /// Name of the current service. | ||
| 290 | void SetServiceName(const std::string& serviceName) | ||
| 291 | { | ||
| 292 | strncpy(m_cStructure->strServiceName, serviceName.c_str(), | ||
| 293 | sizeof(m_cStructure->strServiceName) - 1); | ||
| 294 | } | ||
| 295 | |||
| 296 | /// @brief To get with @ref SetServiceName changed values. | ||
| 297 | std::string GetServiceName() const { return m_cStructure->strServiceName; } | ||
| 298 | |||
| 299 | /// @brief **optional**\n | ||
| 300 | /// Name of the current service's provider. | ||
| 301 | void SetProviderName(const std::string& providerName) | ||
| 302 | { | ||
| 303 | strncpy(m_cStructure->strProviderName, providerName.c_str(), | ||
| 304 | sizeof(m_cStructure->strProviderName) - 1); | ||
| 305 | } | ||
| 306 | |||
| 307 | /// @brief To get with @ref SetProviderName changed values. | ||
| 308 | std::string GetProviderName() const { return m_cStructure->strProviderName; } | ||
| 309 | |||
| 310 | /// @brief **optional**\n | ||
| 311 | /// Name of the current mux. | ||
| 312 | void SetMuxName(const std::string& muxName) | ||
| 313 | { | ||
| 314 | strncpy(m_cStructure->strMuxName, muxName.c_str(), sizeof(m_cStructure->strMuxName) - 1); | ||
| 315 | } | ||
| 316 | |||
| 317 | /// @brief To get with @ref SetMuxName changed values. | ||
| 318 | std::string GetMuxName() const { return m_cStructure->strMuxName; } | ||
| 319 | |||
| 320 | /// @brief **optional**\n | ||
| 321 | /// Signal/noise ratio. | ||
| 322 | /// | ||
| 323 | /// @note 100% is 0xFFFF 65535 | ||
| 324 | void SetSNR(int snr) { m_cStructure->iSNR = snr; } | ||
| 325 | |||
| 326 | /// @brief To get with @ref SetSNR changed values. | ||
| 327 | int GetSNR() const { return m_cStructure->iSNR; } | ||
| 328 | |||
| 329 | /// @brief **optional**\n | ||
| 330 | /// Signal strength. | ||
| 331 | /// | ||
| 332 | /// @note 100% is 0xFFFF 65535 | ||
| 333 | void SetSignal(int signal) { m_cStructure->iSignal = signal; } | ||
| 334 | |||
| 335 | /// @brief To get with @ref SetSignal changed values. | ||
| 336 | int GetSignal() const { return m_cStructure->iSignal; } | ||
| 337 | |||
| 338 | /// @brief **optional**\n | ||
| 339 | /// Bit error rate. | ||
| 340 | void SetBER(long ber) { m_cStructure->iBER = ber; } | ||
| 341 | |||
| 342 | /// @brief To get with @ref SetBER changed values. | ||
| 343 | long GetBER() const { return m_cStructure->iBER; } | ||
| 344 | |||
| 345 | /// @brief **optional**\n | ||
| 346 | /// Uncorrected blocks: | ||
| 347 | void SetUNC(long unc) { m_cStructure->iUNC = unc; } | ||
| 348 | |||
| 349 | /// @brief To get with @ref SetBER changed values. | ||
| 350 | long GetUNC() const { return m_cStructure->iUNC; } | ||
| 351 | ///@} | ||
| 352 | |||
| 353 | private: | ||
| 354 | PVRSignalStatus(const PVR_SIGNAL_STATUS* type) : CStructHdl(type) {} | ||
| 355 | PVRSignalStatus(PVR_SIGNAL_STATUS* type) : CStructHdl(type) {} | ||
| 356 | }; | ||
| 357 | ///@} | ||
| 358 | //------------------------------------------------------------------------------ | ||
| 359 | |||
| 360 | //============================================================================== | ||
| 361 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo class PVRDescrambleInfo | ||
| 362 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel | ||
| 363 | /// @brief **Data structure for descrample info**\n | ||
| 364 | /// Information data to give via this to Kodi. | ||
| 365 | /// | ||
| 366 | /// As description see also here https://en.wikipedia.org/wiki/Conditional_access. | ||
| 367 | /// | ||
| 368 | /// Used on @ref kodi::addon::CInstancePVRClient::GetDescrambleInfo(). | ||
| 369 | /// | ||
| 370 | /// ---------------------------------------------------------------------------- | ||
| 371 | /// | ||
| 372 | /// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo_Help | ||
| 373 | /// | ||
| 374 | ///@{ | ||
| 375 | class PVRDescrambleInfo : public CStructHdl<PVRDescrambleInfo, PVR_DESCRAMBLE_INFO> | ||
| 376 | { | ||
| 377 | friend class CInstancePVRClient; | ||
| 378 | |||
| 379 | public: | ||
| 380 | /*! \cond PRIVATE */ | ||
| 381 | PVRDescrambleInfo() | ||
| 382 | { | ||
| 383 | m_cStructure->iPid = PVR_DESCRAMBLE_INFO_NOT_AVAILABLE; | ||
| 384 | m_cStructure->iCaid = PVR_DESCRAMBLE_INFO_NOT_AVAILABLE; | ||
| 385 | m_cStructure->iProvid = PVR_DESCRAMBLE_INFO_NOT_AVAILABLE; | ||
| 386 | m_cStructure->iEcmTime = PVR_DESCRAMBLE_INFO_NOT_AVAILABLE; | ||
| 387 | m_cStructure->iHops = PVR_DESCRAMBLE_INFO_NOT_AVAILABLE; | ||
| 388 | } | ||
| 389 | PVRDescrambleInfo(const PVRDescrambleInfo& type) : CStructHdl(type) {} | ||
| 390 | /*! \endcond */ | ||
| 391 | |||
| 392 | /// @defgroup cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo_Help Value Help | ||
| 393 | /// @ingroup cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo | ||
| 394 | /// | ||
| 395 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo :</b> | ||
| 396 | /// | Name | Type | Set call | Get call | Usage | ||
| 397 | /// |------|------|----------|----------|----------- | ||
| 398 | /// | **Packet identifier** | `int` | @ref PVRDescrambleInfo::SetPID "SetPID" | @ref PVRDescrambleInfo::GetPID "GetPID" | *optional* | ||
| 399 | /// | **Conditional access identifier** | `int` | @ref PVRDescrambleInfo::SetCAID "SetCAID" | @ref PVRDescrambleInfo::GetCAID "GetCAID" | *optional* | ||
| 400 | /// | **Provider-ID** | `int` | @ref PVRDescrambleInfo::SetProviderID "SetProviderID" | @ref PVRDescrambleInfo::GetProviderID "GetProviderID" | *optional* | ||
| 401 | /// | **ECM time** | `int` | @ref PVRDescrambleInfo::SetECMTime "SetECMTime" | @ref PVRDescrambleInfo::GetECMTime "GetECMTime" | *optional* | ||
| 402 | /// | **Hops** | `int` | @ref PVRDescrambleInfo::SetHops "SetHops" | @ref PVRDescrambleInfo::GetHops "GetHops" | *optional* | ||
| 403 | /// | **Descramble card system** | `std::string` | @ref PVRDescrambleInfo::SetHops "SetHops" | @ref PVRDescrambleInfo::GetHops "GetHops" | *optional* | ||
| 404 | /// | **Reader** | `std::string` | @ref PVRDescrambleInfo::SetReader "SetReader" | @ref PVRDescrambleInfo::GetReader "GetReader" | *optional* | ||
| 405 | /// | **From** | `std::string` | @ref PVRDescrambleInfo::SetFrom "SetFrom" | @ref PVRDescrambleInfo::GetFrom "GetFrom" | *optional* | ||
| 406 | /// | **Protocol** | `std::string` | @ref PVRDescrambleInfo::SetProtocol "SetProtocol" | @ref PVRDescrambleInfo::GetProtocol "GetProtocol" | *optional* | ||
| 407 | /// | ||
| 408 | |||
| 409 | /// @addtogroup cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo | ||
| 410 | ///@{ | ||
| 411 | |||
| 412 | /// @brief **optional**\n | ||
| 413 | /// Packet identifier. | ||
| 414 | /// | ||
| 415 | /// Each table or elementary stream in a transport stream is identified by | ||
| 416 | /// a 13-bit packet identifier (PID). | ||
| 417 | /// | ||
| 418 | /// Is @ref PVR_DESCRAMBLE_INFO_NOT_AVAILABLE as default, if not available | ||
| 419 | void SetPID(int pid) { m_cStructure->iPid = pid; } | ||
| 420 | |||
| 421 | /// @brief To get with @ref SetPID changed values | ||
| 422 | int GetPID() const { return m_cStructure->iPid; } | ||
| 423 | |||
| 424 | /// @brief **optional**\n | ||
| 425 | /// Conditional access identifier. | ||
| 426 | /// | ||
| 427 | /// Conditional access (abbreviated CA) or conditional access system (abbreviated CAS) | ||
| 428 | /// is the protection of content by requiring certain criteria to be met before granting | ||
| 429 | /// access to the content. | ||
| 430 | /// | ||
| 431 | /// Available CA system ID's listed here https://www.dvbservices.com/identifiers/ca_system_id. | ||
| 432 | /// | ||
| 433 | /// @ref PVR_DESCRAMBLE_INFO_NOT_AVAILABLE if not available. | ||
| 434 | void SetCAID(int iCaid) { m_cStructure->iCaid = iCaid; } | ||
| 435 | |||
| 436 | /// @brief To get with @ref SetCAID changed values. | ||
| 437 | int GetCAID() const { return m_cStructure->iCaid; } | ||
| 438 | |||
| 439 | /// @brief **optional**\n | ||
| 440 | /// Provider-ID. | ||
| 441 | /// | ||
| 442 | /// Is @ref PVR_DESCRAMBLE_INFO_NOT_AVAILABLE as default, if not available. | ||
| 443 | void SetProviderID(int provid) { m_cStructure->iProvid = provid; } | ||
| 444 | |||
| 445 | /// @brief To get with @ref SetProviderID changed values | ||
| 446 | int GetProviderID() const { return m_cStructure->iProvid; } | ||
| 447 | |||
| 448 | /// @brief **optional**\n | ||
| 449 | /// ECM time. | ||
| 450 | /// | ||
| 451 | /// Is @ref PVR_DESCRAMBLE_INFO_NOT_AVAILABLE as default, if not available. | ||
| 452 | void SetECMTime(int ecmTime) { m_cStructure->iEcmTime = ecmTime; } | ||
| 453 | |||
| 454 | /// @brief To get with @ref SetECMTime changed values. | ||
| 455 | int GetECMTime() const { return m_cStructure->iEcmTime; } | ||
| 456 | |||
| 457 | /// @brief **optional**\n | ||
| 458 | /// Hops. | ||
| 459 | /// | ||
| 460 | /// Is @ref PVR_DESCRAMBLE_INFO_NOT_AVAILABLE as default, if not available. | ||
| 461 | void SetHops(int hops) { m_cStructure->iHops = hops; } | ||
| 462 | |||
| 463 | /// @brief To get with @ref SetHops changed values. | ||
| 464 | int GetHops() const { return m_cStructure->iHops; } | ||
| 465 | |||
| 466 | /// @brief **optional**\n | ||
| 467 | /// Empty string if not available. | ||
| 468 | void SetCardSystem(const std::string& cardSystem) | ||
| 469 | { | ||
| 470 | strncpy(m_cStructure->strCardSystem, cardSystem.c_str(), | ||
| 471 | sizeof(m_cStructure->strCardSystem) - 1); | ||
| 472 | } | ||
| 473 | |||
| 474 | /// @brief To get with @ref SetCardSystem changed values. | ||
| 475 | std::string GetCardSystem() const { return m_cStructure->strCardSystem; } | ||
| 476 | |||
| 477 | /// @brief **optional**\n | ||
| 478 | /// Empty string if not available. | ||
| 479 | void SetReader(const std::string& reader) | ||
| 480 | { | ||
| 481 | strncpy(m_cStructure->strReader, reader.c_str(), sizeof(m_cStructure->strReader) - 1); | ||
| 482 | } | ||
| 483 | |||
| 484 | /// @brief To get with @ref SetReader changed values. | ||
| 485 | std::string GetReader() const { return m_cStructure->strReader; } | ||
| 486 | |||
| 487 | /// @brief **optional**\n | ||
| 488 | /// Empty string if not available. | ||
| 489 | void SetFrom(const std::string& from) | ||
| 490 | { | ||
| 491 | strncpy(m_cStructure->strFrom, from.c_str(), sizeof(m_cStructure->strFrom) - 1); | ||
| 492 | } | ||
| 493 | |||
| 494 | /// @brief To get with @ref SetFrom changed values. | ||
| 495 | std::string GetFrom() const { return m_cStructure->strFrom; } | ||
| 496 | |||
| 497 | /// @brief **optional**\n | ||
| 498 | /// Empty string if not available. | ||
| 499 | void SetProtocol(const std::string& protocol) | ||
| 500 | { | ||
| 501 | strncpy(m_cStructure->strProtocol, protocol.c_str(), sizeof(m_cStructure->strProtocol) - 1); | ||
| 502 | } | ||
| 503 | |||
| 504 | /// @brief To get with @ref SetProtocol changed values. | ||
| 505 | std::string GetProtocol() const { return m_cStructure->strProtocol; } | ||
| 506 | ///@} | ||
| 507 | |||
| 508 | private: | ||
| 509 | PVRDescrambleInfo(const PVR_DESCRAMBLE_INFO* type) : CStructHdl(type) {} | ||
| 510 | PVRDescrambleInfo(PVR_DESCRAMBLE_INFO* type) : CStructHdl(type) {} | ||
| 511 | }; | ||
| 512 | ///@} | ||
| 513 | //------------------------------------------------------------------------------ | ||
| 514 | |||
| 515 | } /* namespace addon */ | ||
| 516 | } /* namespace kodi */ | ||
| 517 | |||
| 518 | #endif /* __cplusplus */ | ||
