 |
Kodi Development
19.0
for Binary and Script based Add-Ons
|
|
Bring in this functions if you have set supportsChannelGroups to true
This is used to divide available addon channels into groups, which can then be selected by the user.
Channel group parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
◆ GetChannelGroupsAmount()
virtual PVR_ERROR GetChannelGroupsAmount |
( |
int & |
amount | ) |
|
|
inlinevirtual |
Get the total amount of channel groups on the backend if it supports channel groups.
- Parameters
-
[out] | amount | The total amount of channel groups on the backend |
- Returns
- PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
◆ GetChannelGroups()
Get a list of available channel groups on addon.
Request the list of all channel groups from the backend if it supports channel groups.
- Parameters
-
- Returns
- PVR_ERROR_NO_ERROR if the list has been fetched successfully.
The following table contains values that can be set with class PVRChannelGroup :
Example:
◆ GetChannelGroupMembers()
Get a list of members on a group.
Request the list of all group members of a group from the backend if it supports channel groups.
- Parameters
-
- Returns
- PVR_ERROR_NO_ERROR if the list has been fetched successfully.
The following table contains values that can be set with class PVRChannelGroupMember :
Example:
...
{
for (const auto& myGroup : m_myGroups)
{
{
for (unsigned int iChannelPtr = 0; iChannelPtr < myGroup.members.size(); iChannelPtr++)
{
int iId = myGroup.members.at(iChannelPtr) - 1;
if (iId < 0 || iId > (int)m_channels.size() - 1)
continue;
PVRDemoChannel &channel = m_channels.at(iId);
results.
Add(kodiGroupMember);
}
}
}
}
...
◆ TriggerChannelGroupsUpdate()
void TriggerChannelGroupsUpdate |
( |
| ) |
|
|
inline |
Callback to Kodi Function
Request Kodi to update it's list of channel groups.
void SetChannelNumber(unsigned int channelNumber)
optional Channel number within the group.
Definition: ChannelGroups.h:196
@ PVR_ERROR_NO_ERROR
0 : No error occurred.
Definition: pvr_general.h:44
std::string GetGroupName() const
To get with SetGroupName changed values.
Definition: ChannelGroups.h:69
Definition: ChannelGroups.h:149
Definition: ChannelGroups.h:103
void SetGroupName(const std::string &groupName)
required Name of the channel group to add the channel to.
Definition: ChannelGroups.h:176
Definition: ChannelGroups.h:38
void SetSubChannelNumber(unsigned int subChannelNumber)
optional Sub channel number within the group (ATSC).
Definition: ChannelGroups.h:206
void SetChannelUniqueId(unsigned int channelUniqueId)
required Unique id of the member.
Definition: ChannelGroups.h:186
void SetGroupName(const std::string &groupName)
required Name of this channel group.
Definition: ChannelGroups.h:63
Definition: ChannelGroups.h:238
void Add(const kodi::addon::PVRChannelGroupMember &tag)
To add and give content from addon to Kodi on related call.
Definition: ChannelGroups.h:254
void SetIsRadio(bool isRadio)
required true If this is a radio channel group, false otherwise.
Definition: ChannelGroups.h:73
void SetPosition(unsigned int position)
optional Sort position of the group (0 indicates that the backend doesn't support sorting of groups).
Definition: ChannelGroups.h:81
void Add(const kodi::addon::PVRChannel &tag)
To add and give content from addon to Kodi on related call.
Definition: Channels.h:207