Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <PVRChannelGroup.h>
Public Member Functions | |
CPVRChannelGroup (const CPVRChannelsPath &path, const std::shared_ptr< const CPVRChannelGroup > &allChannelsGroup) | |
Create a new channel group instance. | |
~CPVRChannelGroup () override | |
bool | operator== (const CPVRChannelGroup &right) const |
bool | operator!= (const CPVRChannelGroup &right) const |
CEventStream< PVREvent > & | Events () |
Query the events available for CEventStream. | |
bool | LoadFromDatabase (const std::map< std::pair< int, int >, std::shared_ptr< CPVRChannel > > &channels, const std::vector< std::shared_ptr< CPVRClient > > &clients) |
Load the channels from the database. | |
void | Unload () |
Clear all data. | |
size_t | Size () const |
virtual bool | UpdateFromClients (const std::vector< std::shared_ptr< CPVRClient > > &clients)=0 |
Update data with channel group members from the given clients, sync with local data. | |
int | GetClientID () const |
Get the identifier of the client that serves this channel group. | |
void | SetClientID (int clientID) |
Set the identifier of the client that serves this channel group. | |
const CPVRChannelsPath & | GetPath () const |
Get the path of this group. | |
void | SetPath (const CPVRChannelsPath &path) |
Set the path of this group. | |
virtual bool | RemoveFromGroup (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) |
Remove a channel group member from this container. | |
virtual bool | AppendToGroup (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) |
Append a channel group member to this container. | |
virtual bool | IsGroupMember (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) const |
Check whether a channel group member is in this container. | |
bool | SetGroupName (const std::string &strGroupName, bool isUserSetName=false) |
Change the name of this group. | |
void | SetClientGroupName (const std::string &groupName) |
Set the name this group has on the client. | |
bool | IsUserSetName () const |
Check whether the group name was set by the user. | |
bool | Persist () |
Persist changed or new data. | |
bool | IsRadio () const |
True if this group holds radio channels, false if it holds TV channels. | |
int | GroupID () const |
The database ID of this group. | |
void | SetGroupID (int iGroupId) |
Set the database ID of this group. | |
time_t | LastWatched () const |
void | SetLastWatched (time_t iLastWatched) |
Last time group has been watched. | |
uint64_t | LastOpened () const |
void | SetLastOpened (uint64_t iLastOpened) |
Set the time in milliseconds from epoch this group was last opened. | |
std::string | GroupName () const |
The name of this group. | |
std::string | ClientGroupName () const |
Get the name of this group on the client. | |
Public Member Functions inherited from PVR::IChannelGroupSettingsCallback | |
virtual | ~IChannelGroupSettingsCallback ()=default |
Static Public Attributes | |
static const int | INVALID_GROUP_ID = -1 |
Friends | |
class | CPVRDatabase |
Sort methods | |
enum class | Include { ALL , ONLY_HIDDEN , ONLY_VISIBLE } |
enum class | Origin { USER , SYSTEM , CLIENT } |
int | m_iGroupId = INVALID_GROUP_ID |
bool | m_bLoaded = false |
bool | m_bChanged |
time_t | m_iLastWatched = 0 |
uint64_t | m_iLastOpened = 0 |
bool | m_bHidden = false |
int | m_iPosition = 0 |
std::vector< std::shared_ptr< CPVRChannelGroupMember > > | m_sortedMembers |
std::map< std::pair< int, int >, std::shared_ptr< CPVRChannelGroupMember > > | m_members |
CCriticalSection | m_critSection |
std::vector< int > | m_failedClients |
CEventSource< PVREvent > | m_events |
std::shared_ptr< CPVRChannelGroupSettings > | m_settings |
static CCriticalSection | m_settingsSingletonCritSection |
static std::weak_ptr< CPVRChannelGroupSettings > | m_settingsSingleton |
void | Sort () |
Sort the group. | |
bool | SortAndRenumber () |
Sort the group and fix up channel numbers. | |
bool | Renumber (RenumberMode mode=NORMAL) |
Remove invalid channels and updates the channel numbers. | |
void | UseBackendChannelOrderChanged () override |
void | UseBackendChannelNumbersChanged () override |
void | StartGroupChannelNumbersFromOneChanged () override |
std::shared_ptr< CPVRChannelGroupMember > | GetLastPlayedChannelGroupMember (int iCurrentChannel=-1) const |
Get the channel group member that was played last. | |
GroupMemberPair | GetLastAndPreviousToLastPlayedChannelGroupMember () const |
Get the last and previous to last played channel group members. | |
std::shared_ptr< CPVRChannelGroupMember > | GetByChannelNumber (const CPVRChannelNumber &channelNumber) const |
Get a channel group member given it's active channel number. | |
CPVRChannelNumber | GetChannelNumber (const std::shared_ptr< const CPVRChannel > &channel) const |
Get the channel number in this group of the given channel. | |
CPVRChannelNumber | GetClientChannelNumber (const std::shared_ptr< const CPVRChannel > &channel) const |
Get the client channel number in this group of the given channel. | |
std::shared_ptr< CPVRChannelGroupMember > | GetNextChannelGroupMember (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) const |
Get the next channel group member in this group. | |
std::shared_ptr< CPVRChannelGroupMember > | GetPreviousChannelGroupMember (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) const |
Get the previous channel group member in this group. | |
std::shared_ptr< CPVRChannel > | GetByChannelID (int iChannelID) const |
Get a channel given it's channel ID. | |
std::vector< std::shared_ptr< CPVRChannelGroupMember > > | GetMembers (Include eFilter=Include::ALL) const |
Get the current members of this group. | |
void | GetChannelNumbers (std::vector< std::string > &channelNumbers) const |
Get the list of active channel numbers in a group. | |
bool | HasChannels () const |
Check whether this container has any channels. | |
bool | HasNewChannels () const |
Check whether this container has any new channels. | |
bool | HasHiddenChannels () const |
Check whether this container has any hidden channels. | |
bool | HasChanges () const |
bool | IsNew () const |
std::shared_ptr< CPVRChannel > | GetByUniqueID (int iUniqueChannelId, int iClientID) const |
Get a channel given the channel number on the client. | |
std::shared_ptr< CPVRChannelGroupMember > | GetByUniqueID (const std::pair< int, int > &id) const |
Get a channel group member given its storage id. | |
bool | HasChannelForProvider (int clientId, int providerId) const |
Check whether at least one channel of this group is offered by the given provider. | |
unsigned int | GetChannelCountByProvider (int clientId, int providerId) const |
Get the total count of channels of this group offered by the given provider. | |
bool | SetHidden (bool bHidden) |
Set the hidden state of this group. | |
bool | IsHidden () const |
Check whether this group is hidden. | |
int | GetPosition () const |
Get the local position of this group. | |
bool | SetPosition (int iPosition) |
Set the local position of this group. | |
int | GetClientPosition () const |
Get the position of this group as supplied by the PVR client. | |
void | SetClientPosition (int iPosition) |
Set the client-supplied position of this group. | |
bool | HasValidDataForClient (int iClientId) const |
Check, whether data for a given pvr client are currently valid. For instance, data can be invalid because the client's backend was offline when data was last queried. | |
bool | HasValidDataForClients (const std::vector< std::shared_ptr< CPVRClient > > &clients) const |
Check, whether data for given pvr clients are currently valid. For instance, data can be invalid because the client's backend was offline when data was last queried. | |
bool | UpdateChannelNumbersFromAllChannelsGroup () |
Update the channel numbers according to the all channels group and publish event. | |
void | Delete () |
Remove this group from database. | |
bool | IsDeleted () const |
Whether this group is deleted. | |
int | CleanupCachedImages () |
Erase stale texture db entries and image files. | |
int | GetClientPriority () const |
Get the priority of the client that provides this group. | |
void | UpdateClientPriorities () |
Update the client priority for this group and all members of this group. | |
virtual Origin | GetOrigin () const =0 |
Get the group's origin. | |
virtual int | GroupType () const =0 |
Return the type of this group. | |
virtual bool | SupportsDelete () const =0 |
Check whether this group could be deleted by the user. | |
virtual bool | SupportsMemberAdd () const =0 |
Check whether members could be added to this group by the user. | |
virtual bool | SupportsMemberRemove () const =0 |
Check whether members could be removed from this group by the user. | |
virtual bool | IsChannelsOwner () const =0 |
Check whether this group is owner of the channel instances it contains. | |
virtual bool | ShouldBeIgnored (const std::vector< std::shared_ptr< CPVRChannelGroup > > &allChannelGroups) const |
Check whether this group should be ignored, e.g. not presented to the user and API. | |
virtual bool | UpdateGroupMembers (const std::shared_ptr< CPVRChannelGroup > &allChannelsGroup, const std::vector< std::shared_ptr< CPVRChannelGroup > > &allChannelGroups) |
Update all group members. | |
virtual std::vector< std::shared_ptr< CPVRChannelGroupMember > > | RemoveDeletedGroupMembers (const std::vector< std::shared_ptr< CPVRChannelGroupMember > > &groupMembers) |
Remove deleted group members from this group. | |
bool | UpdateGroupEntries (const std::vector< std::shared_ptr< CPVRChannelGroupMember > > &groupMembers) |
Update the current channel group members with the given list. | |
void | SortByClientChannelNumber () |
Sort the current channel list by client channel number. | |
void | SortByChannelNumber () |
Sort the current channel list by channel number. | |
bool | UpdateMembersClientPriority () |
Update the client priority for all members of this group. | |
std::shared_ptr< CPVRChannelGroupSettings > | GetSettings () const |
|
strong |
|
strong |
CPVRChannelGroup::CPVRChannelGroup | ( | const CPVRChannelsPath & | path, |
const std::shared_ptr< const CPVRChannelGroup > & | allChannelsGroup ) |
Create a new channel group instance.
path | The channel group path. |
allChannelsGroup | The channel group containing all TV or radio channels. |
|
override |
|
virtual |
Append a channel group member to this container.
groupMember | The channel group member to append. |
Reimplemented in PVR::CPVRChannelGroupAllChannels.
int CPVRChannelGroup::CleanupCachedImages | ( | ) |
Erase stale texture db entries and image files.
std::string CPVRChannelGroup::ClientGroupName | ( | ) | const |
Get the name of this group on the client.
void CPVRChannelGroup::Delete | ( | ) |
Remove this group from database.
|
inline |
Query the events available for CEventStream.
std::shared_ptr< CPVRChannel > CPVRChannelGroup::GetByChannelID | ( | int | iChannelID | ) | const |
Get a channel given it's channel ID.
iChannelID | The channel ID. |
std::shared_ptr< CPVRChannelGroupMember > CPVRChannelGroup::GetByChannelNumber | ( | const CPVRChannelNumber & | channelNumber | ) | const |
Get a channel group member given it's active channel number.
channelNumber | The channel number. |
std::shared_ptr< CPVRChannelGroupMember > CPVRChannelGroup::GetByUniqueID | ( | const std::pair< int, int > & | id | ) | const |
Get a channel group member given its storage id.
id | The storage id (a pair of client id and unique channel id). |
std::shared_ptr< CPVRChannel > CPVRChannelGroup::GetByUniqueID | ( | int | iUniqueChannelId, |
int | iClientID ) const |
Get a channel given the channel number on the client.
iUniqueChannelId | The unique channel id on the client. |
iClientID | The ID of the client. |
Get the total count of channels of this group offered by the given provider.
clientId | The clientId of the provider. |
providerId | The providerId. |
CPVRChannelNumber CPVRChannelGroup::GetChannelNumber | ( | const std::shared_ptr< const CPVRChannel > & | channel | ) | const |
Get the channel number in this group of the given channel.
channel | The channel to get the channel number for. |
void CPVRChannelGroup::GetChannelNumbers | ( | std::vector< std::string > & | channelNumbers | ) | const |
Get the list of active channel numbers in a group.
channelNumbers | The list to store the numbers in. |
CPVRChannelNumber CPVRChannelGroup::GetClientChannelNumber | ( | const std::shared_ptr< const CPVRChannel > & | channel | ) | const |
Get the client channel number in this group of the given channel.
channel | The channel to get the channel number for. |
int CPVRChannelGroup::GetClientID | ( | ) | const |
Get the identifier of the client that serves this channel group.
int CPVRChannelGroup::GetClientPosition | ( | ) | const |
Get the position of this group as supplied by the PVR client.
int CPVRChannelGroup::GetClientPriority | ( | ) | const |
Get the priority of the client that provides this group.
GroupMemberPair CPVRChannelGroup::GetLastAndPreviousToLastPlayedChannelGroupMember | ( | ) | const |
Get the last and previous to last played channel group members.
std::shared_ptr< CPVRChannelGroupMember > CPVRChannelGroup::GetLastPlayedChannelGroupMember | ( | int | iCurrentChannel = -1 | ) | const |
Get the channel group member that was played last.
iCurrentChannel | The channelid of the current channel that is playing, or -1 if none |
std::vector< std::shared_ptr< CPVRChannelGroupMember > > CPVRChannelGroup::GetMembers | ( | Include | eFilter = Include::ALL | ) | const |
Get the current members of this group.
eFilter | A filter to apply. |
std::shared_ptr< CPVRChannelGroupMember > CPVRChannelGroup::GetNextChannelGroupMember | ( | const std::shared_ptr< const CPVRChannelGroupMember > & | groupMember | ) | const |
Get the next channel group member in this group.
groupMember | The current channel group member. |
|
pure virtual |
Get the group's origin.
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
const CPVRChannelsPath & CPVRChannelGroup::GetPath | ( | ) | const |
Get the path of this group.
int CPVRChannelGroup::GetPosition | ( | ) | const |
Get the local position of this group.
std::shared_ptr< CPVRChannelGroupMember > CPVRChannelGroup::GetPreviousChannelGroupMember | ( | const std::shared_ptr< const CPVRChannelGroupMember > & | groupMember | ) | const |
Get the previous channel group member in this group.
groupMember | The current channel group member. |
|
protected |
int CPVRChannelGroup::GroupID | ( | ) | const |
The database ID of this group.
std::string CPVRChannelGroup::GroupName | ( | ) | const |
The name of this group.
|
pure virtual |
Return the type of this group.
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
bool CPVRChannelGroup::HasChanges | ( | ) | const |
Check whether at least one channel of this group is offered by the given provider.
clientId | The clientId to check. |
providerId | The providerId to check. |
bool CPVRChannelGroup::HasChannels | ( | ) | const |
Check whether this container has any channels.
bool CPVRChannelGroup::HasHiddenChannels | ( | ) | const |
Check whether this container has any hidden channels.
bool CPVRChannelGroup::HasNewChannels | ( | ) | const |
Check whether this container has any new channels.
Check, whether data for a given pvr client are currently valid. For instance, data can be invalid because the client's backend was offline when data was last queried.
iClientId | The id of the client. |
bool CPVRChannelGroup::HasValidDataForClients | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients | ) | const |
Check, whether data for given pvr clients are currently valid. For instance, data can be invalid because the client's backend was offline when data was last queried.
clients | The clients to check. Check all active clients if vector is empty. |
|
pure virtual |
Check whether this group is owner of the channel instances it contains.
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
|
inline |
Whether this group is deleted.
|
virtual |
Check whether a channel group member is in this container.
groupMember | The channel group member to check. |
Reimplemented in PVR::CPVRChannelGroupAllChannels.
bool CPVRChannelGroup::IsHidden | ( | ) | const |
Check whether this group is hidden.
bool CPVRChannelGroup::IsNew | ( | ) | const |
bool CPVRChannelGroup::IsRadio | ( | ) | const |
True if this group holds radio channels, false if it holds TV channels.
|
inline |
Check whether the group name was set by the user.
uint64_t CPVRChannelGroup::LastOpened | ( | ) | const |
time_t CPVRChannelGroup::LastWatched | ( | ) | const |
bool CPVRChannelGroup::LoadFromDatabase | ( | const std::map< std::pair< int, int >, std::shared_ptr< CPVRChannel > > & | channels, |
const std::vector< std::shared_ptr< CPVRClient > > & | clients ) |
Load the channels from the database.
channels | All available channels. |
clients | The PVR clients data should be loaded for. Leave empty for all clients. |
bool CPVRChannelGroup::operator!= | ( | const CPVRChannelGroup & | right | ) | const |
bool CPVRChannelGroup::operator== | ( | const CPVRChannelGroup & | right | ) | const |
bool CPVRChannelGroup::Persist | ( | ) |
Persist changed or new data.
|
protectedvirtual |
Remove deleted group members from this group.
groupMembers | The group members to use to update this list. |
Reimplemented in PVR::CPVRChannelGroupAllChannels.
|
virtual |
Remove a channel group member from this container.
groupMember | The channel group member to remove. |
Reimplemented in PVR::CPVRChannelGroupAllChannels.
bool CPVRChannelGroup::Renumber | ( | RenumberMode | mode = NORMAL | ) |
Remove invalid channels and updates the channel numbers.
mode | the numbering mode to use |
void CPVRChannelGroup::SetClientGroupName | ( | const std::string & | groupName | ) |
Set the name this group has on the client.
groupName | The client group name. |
Set the identifier of the client that serves this channel group.
clientID | The identifier; must be PVR_GROUP_CLIENT_ID_LOCAL for local groups. |
Set the client-supplied position of this group.
iPosition | The new client-supplied group position. |
Set the database ID of this group.
iGroupId | The new database ID. |
bool CPVRChannelGroup::SetGroupName | ( | const std::string & | strGroupName, |
bool | isUserSetName = false ) |
Change the name of this group.
strGroupName | The new group name. |
isUserSetName | Whether the name was set by the user. |
Set the hidden state of this group.
bHidden | True to set hidden state, false to unhide the group. |
void CPVRChannelGroup::SetLastOpened | ( | uint64_t | iLastOpened | ) |
Set the time in milliseconds from epoch this group was last opened.
iLastOpened | The new value. |
void CPVRChannelGroup::SetLastWatched | ( | time_t | iLastWatched | ) |
Last time group has been watched.
iLastWatched | The new value. |
void CPVRChannelGroup::SetPath | ( | const CPVRChannelsPath & | path | ) |
Set the local position of this group.
iPosition | The new local group position. |
|
virtual |
Check whether this group should be ignored, e.g. not presented to the user and API.
allChannelGroups | All available channel groups. This information might be needed by implementations to calculate the ignore state. |
Reimplemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
size_t CPVRChannelGroup::Size | ( | ) | const |
void CPVRChannelGroup::Sort | ( | ) |
Sort the group.
bool CPVRChannelGroup::SortAndRenumber | ( | ) |
Sort the group and fix up channel numbers.
|
protected |
Sort the current channel list by channel number.
|
protected |
Sort the current channel list by client channel number.
|
overridevirtual |
Reimplemented from PVR::IChannelGroupSettingsCallback.
|
pure virtual |
Check whether this group could be deleted by the user.
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
|
pure virtual |
Check whether members could be added to this group by the user.
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
|
pure virtual |
Check whether members could be removed from this group by the user.
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
void CPVRChannelGroup::Unload | ( | ) |
Clear all data.
bool CPVRChannelGroup::UpdateChannelNumbersFromAllChannelsGroup | ( | ) |
Update the channel numbers according to the all channels group and publish event.
void CPVRChannelGroup::UpdateClientPriorities | ( | ) |
Update the client priority for this group and all members of this group.
|
pure virtual |
Update data with channel group members from the given clients, sync with local data.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
Implemented in PVR::CPVRChannelGroupAllChannels, PVR::CPVRChannelGroupAllChannelsSingleClient, PVR::CPVRChannelGroupFromClient, PVR::CPVRChannelGroupFromUser, and PVR::CPVRChannelGroupMergedByName.
|
protected |
Update the current channel group members with the given list.
groupMembers | The group members to use to update this list. |
|
inlinevirtual |
Update all group members.
allChannelsGroup | The all channels group. |
allChannelGroups | All available channel groups. |
Reimplemented in PVR::CPVRChannelGroupAllChannelsSingleClient, and PVR::CPVRChannelGroupMergedByName.
|
protected |
Update the client priority for all members of this group.
|
overridevirtual |
Reimplemented from PVR::IChannelGroupSettingsCallback.
|
overridevirtual |
Reimplemented from PVR::IChannelGroupSettingsCallback.
|
friend |
|
static |
|
protected |
true if anything changed in this group that hasn't been persisted, false otherwise
|
protected |
true if this group is hidden, false otherwise
|
protected |
True if this container is loaded, false otherwise
|
mutableprotected |
|
protected |
|
protected |
|
protected |
The ID of this group in the database
|
protected |
time in milliseconds from epoch this group was last opened
|
protected |
last time group has been watched
|
protected |
the local position of this group within the group list
|
protected |
members with key clientid+uniqueid
|
mutableprotected |
|
staticprotected |
|
staticprotected |
|
protected |
members sorted by channel number