Functions to get available TV or Radio channels
These are mandatory functions for using this addon to get the available channels.
Channel parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
Header parts:
Definition: Channels.h:39
Definition: Channels.h:208
Definition: Channels.h:393
Definition: Providers.h:162
Definition: Channels.h:253
virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus &signalStatus)
Get the signal status of the stream that's currently open.
Definition: PVR.h:1067
virtual PVR_ERROR GetChannelStreamProperties(const kodi::addon::PVRChannel &channel, std::vector< kodi::addon::PVRStreamProperty > &properties)
Get the stream properties for a channel from the backend.
Definition: PVR.h:1018
virtual PVR_ERROR GetDescrambleInfo(int channelUid, kodi::addon::PVRDescrambleInfo &descrambleInfo)
Get the descramble information of the stream that's currently open.
Definition: PVR.h:1087
virtual PVR_ERROR GetChannels(bool radio, kodi::addon::PVRChannelsResultSet &results)
Request the list of all channels from the backend.
Definition: PVR.h:976
virtual PVR_ERROR GetProviders(kodi::addon::PVRProvidersResultSet &results)
Request the list of all providers from the backend.
Definition: PVR.h:901
virtual PVR_ERROR GetProvidersAmount(int &amount)
The total amount of providers on the backend.
Definition: PVR.h:861
virtual PVR_ERROR GetChannelsAmount(int &amount)
The total amount of channels on the backend.
Definition: PVR.h:927
PVR_ERROR
Definition: pvr_general.h:35
Source parts:
PVR_ERROR CMyInstance::GetProvidersAmount(
int& amount)
{
}
{
}
PVR_ERROR CMyInstance::GetChannelsAmount(
int& amount)
{
}
{
}
{
}
{
}
{
}
@ PVR_ERROR_NOT_IMPLEMENTED
-2 : The method that Kodi called is not implemented by the add-on.
Definition: pvr_general.h:43
◆ GetProvidersAmount()
virtual PVR_ERROR GetProvidersAmount |
( |
int & |
amount | ) |
|
|
inlinevirtual |
The total amount of providers on the backend.
- Parameters
-
[out] | amount | The total amount of providers on the backend |
- Returns
- PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
◆ GetProviders()
Request the list of all providers from the backend.
- Parameters
-
- Returns
- PVR_ERROR_NO_ERROR if the list has been fetched successfully.
The following table contains values that can be set with class PVRProvider :
Example:
...
{
provider.SetProviderName("My provider name");
...
}
...
Definition: Providers.h:40
@ PVR_PROVIDER_TYPE_SATELLITE
2 : Satellite provider.
Definition: pvr_providers.h:55
@ PVR_ERROR_NO_ERROR
0 : No error occurred.
Definition: pvr_general.h:37
void SetUniqueId(unsigned int uniqueId)
required Unique identifier for this provider.
Definition: Providers.h:68
void Add(const kodi::addon::PVRProvider &provider)
To add and give content from addon to Kodi on related call.
Definition: Providers.h:178
◆ TriggerProvidersUpdate()
void TriggerProvidersUpdate |
( |
| ) |
|
|
inline |
Callback to Kodi Function
Request Kodi to update it's list of providers.
◆ GetChannelsAmount()
virtual PVR_ERROR GetChannelsAmount |
( |
int & |
amount | ) |
|
|
inlinevirtual |
The total amount of channels on the backend.
- Parameters
-
[out] | amount | The total amount of channels on the backend |
- Returns
- PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
◆ GetChannels()
Request the list of all channels from the backend.
- Parameters
-
- Returns
- PVR_ERROR_NO_ERROR if the list has been fetched successfully.
The following table contains values that can be set with class PVRChannel :
Example:
...
{
...
}
...
void SetChannelName(const std::string &channelName)
optional Channel name given to this channel.
Definition: Channels.h:111
void SetChannelNumber(unsigned int channelNumber)
optional Channel number of this channel on the backend.
Definition: Channels.h:91
void SetIsRadio(bool isRadio)
required true if this is a radio channel, false if it's a TV channel.
Definition: Channels.h:84
void SetUniqueId(unsigned int uniqueId)
required Unique identifier for this channel.
Definition: Channels.h:77
void Add(const kodi::addon::PVRChannel &tag)
To add and give content from addon to Kodi on related call.
Definition: Channels.h:224
◆ GetChannelStreamProperties()
Get the stream properties for a channel from the backend.
- Parameters
-
[in] | channel | The channel to get the stream properties for. |
[out] | properties | the properties required to play the stream. |
- Returns
- PVR_ERROR_NO_ERROR if the stream is available.
- Note
- The value directly related to inputstream must always begin with the name of the associated add-on, e.g.
"inputstream.adaptive.manifest_update_parameter"
.
Example:
...
std::vector<kodi::addon::PVRStreamProperty>& properties)
{
...
properties.emplace_back("inputstream.adaptive.manifest_type", "mpd");
properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
}
...
#define PVR_STREAM_PROPERTY_MIMETYPE
the MIME type of the stream that should be played.
Definition: pvr_general.h:237
#define PVR_STREAM_PROPERTY_INPUTSTREAM
To define in stream properties the name of the inputstream add-on that should be used.
Definition: pvr_general.h:162
◆ GetSignalStatus()
Get the signal status of the stream that's currently open.
- Parameters
-
[out] | signalStatus | The signal status. |
- Returns
- PVR_ERROR_NO_ERROR if the signal status has been read successfully, false otherwise.
The following table contains values that can be set with class PVRSignalStatus :
Here's example about the use of this:
#include <kodi/addon-instance/PVR.h>
...
class ATTRIBUTE_HIDDEN CPVRExample
{
public:
...
PVR_ERROR SignalStatus(PVRSignalStatus &signalStatus)
override
{
signalStatus.SetAapterName("Example adapter 1");
signalStatus.SetAdapterStatus("OK");
signalStatus.SetSignal(0xFFFF);
}
};
ADDONCREATOR(CPVRExample)
Definition: AddonBase.h:322
◆ GetDescrambleInfo()
Get the descramble information of the stream that's currently open.
- Parameters
-
[out] | descrambleInfo | The descramble information. |
- Returns
- PVR_ERROR_NO_ERROR if the descramble information has been read successfully, false otherwise.
The following table contains values that can be set with class PVRDescrambleInfo :
◆ TriggerChannelUpdate()
void TriggerChannelUpdate |
( |
| ) |
|
|
inline |
Callback to Kodi Function
Request Kodi to update it's list of channels.