xbmc
|
Public Types | |
enum | Include { ALL, ONLY_HIDDEN, ONLY_VISIBLE } |
Public Member Functions | |
CPVRChannelGroup (const CPVRChannelsPath &path, const std::shared_ptr< CPVRChannelGroup > &allChannelsGroup) | |
Create a new channel group instance. More... | |
CPVRChannelGroup (const PVR_CHANNEL_GROUP &group, const std::shared_ptr< CPVRChannelGroup > &allChannelsGroup) | |
Create a new channel group instance from a channel group provided by an add-on. More... | |
bool | operator== (const CPVRChannelGroup &right) const |
bool | operator!= (const CPVRChannelGroup &right) const |
void | FillAddonData (PVR_CHANNEL_GROUP &group) const |
Copy over data to the given PVR_CHANNEL_GROUP instance. More... | |
CEventStream< PVREvent > & | Events () |
Query the events available for CEventStream. | |
virtual 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. More... | |
virtual void | Unload () |
Clear all data. | |
size_t | Size () const |
virtual bool | UpdateFromClients (const std::vector< std::shared_ptr< CPVRClient >> &clients) |
Update data with channel group members from the given clients, sync with local data. More... | |
const CPVRChannelsPath & | GetPath () const |
Get the path of this group. More... | |
void | SetPath (const CPVRChannelsPath &path) |
Set the path of this group. More... | |
bool | SetChannelNumber (const std::shared_ptr< CPVRChannel > &channel, const CPVRChannelNumber &channelNumber) |
Change the channelnumber of a group. Used by CGUIDialogPVRChannelManager. Call SortByChannelNumber() and Renumber() after all changes are done. More... | |
virtual bool | RemoveFromGroup (const std::shared_ptr< CPVRChannel > &channel) |
Remove a channel from this container. More... | |
virtual bool | AppendToGroup (const std::shared_ptr< CPVRChannel > &channel) |
Append a channel to this container. More... | |
void | SetGroupName (const std::string &strGroupName) |
Change the name of this group. More... | |
bool | Persist () |
Persist changed or new data. More... | |
virtual bool | IsGroupMember (const std::shared_ptr< CPVRChannel > &channel) const |
Check whether a channel is in this container. More... | |
bool | IsInternalGroup () const |
Check if this group is the internal group containing all channels. More... | |
bool | IsRadio () const |
True if this group holds radio channels, false if it holds TV channels. More... | |
int | GroupID () const |
The database ID of this group. More... | |
void | SetGroupID (int iGroupId) |
Set the database ID of this group. More... | |
void | SetGroupType (int iGroupType) |
Set the type of this group. More... | |
int | GroupType () const |
Return the type of this group. | |
time_t | LastWatched () const |
void | SetLastWatched (time_t iLastWatched) |
Last time group has been watched. More... | |
uint64_t | LastOpened () const |
void | SetLastOpened (uint64_t iLastOpened) |
Set the time in milliseconds from epoch this group was last opened. More... | |
std::string | GroupName () const |
The name of this group. More... | |
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. More... | |
GroupMemberPair | GetLastAndPreviousToLastPlayedChannelGroupMember () const |
Get the last and previous to last played channel group members. More... | |
std::shared_ptr< CPVRChannelGroupMember > | GetByChannelNumber (const CPVRChannelNumber &channelNumber) const |
Get a channel group member given it's active channel number. More... | |
CPVRChannelNumber | GetChannelNumber (const std::shared_ptr< CPVRChannel > &channel) const |
Get the channel number in this group of the given channel. More... | |
CPVRChannelNumber | GetClientChannelNumber (const std::shared_ptr< CPVRChannel > &channel) const |
Get the client channel number in this group of the given channel. More... | |
std::shared_ptr< CPVRChannelGroupMember > | GetNextChannelGroupMember (const std::shared_ptr< CPVRChannelGroupMember > &groupMember) const |
Get the next channel group member in this group. More... | |
std::shared_ptr< CPVRChannelGroupMember > | GetPreviousChannelGroupMember (const std::shared_ptr< CPVRChannelGroupMember > &groupMember) const |
Get the previous channel group member in this group. More... | |
std::shared_ptr< CPVRChannel > | GetByChannelID (int iChannelID) const |
Get a channel given it's channel ID. More... | |
std::vector< std::shared_ptr< CPVRChannelGroupMember > > | GetMembers (Include eFilter=Include::ALL) const |
Get the current members of this group. More... | |
void | GetChannelNumbers (std::vector< std::string > &channelNumbers) const |
Get the list of active channel numbers in a group. More... | |
virtual size_t | GetNumHiddenChannels () const |
The amount of hidden channels in this container. More... | |
bool | HasChannels () const |
Does this container holds channels. More... | |
bool | HasNewChannels () const |
bool | HasChanges () const |
bool | IsNew () const |
virtual bool | CreateChannelEpgs (bool bForce=false) |
Create an EPG table for each channel. More... | |
bool | UpdateChannel (const std::pair< int, int > &storageId, const std::string &strChannelName, const std::string &strIconPath, int iEPGSource, int iChannelNumber, bool bHidden, bool bEPGEnabled, bool bParentalLocked, bool bUserSetIcon, bool bUserSetHidden) |
Update a channel group member with given data. More... | |
std::shared_ptr< CPVRChannel > | GetByUniqueID (int iUniqueChannelId, int iClientID) const |
Get a channel given the channel number on the client. More... | |
std::shared_ptr< CPVRChannelGroupMember > | GetByUniqueID (const std::pair< int, int > &id) const |
Get a channel group member given its storage id. More... | |
bool | SetHidden (bool bHidden) |
bool | IsHidden () const |
int | GetPosition () const |
void | SetPosition (int iPosition) |
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. More... | |
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. More... | |
bool | UpdateChannelNumbersFromAllChannelsGroup () |
Update the channel numbers according to the all channels group and publish event. More... | |
void | Delete () |
Remove this group from database. | |
bool | IsDeleted () const |
Whether this group is deleted. More... | |
int | CleanupCachedImages () |
Erase stale texture db entries and image files. More... | |
Sort methods | |
void | Sort () |
Sort the group. | |
bool | SortAndRenumber () |
Sort the group and fix up channel numbers. More... | |
bool | Renumber (RenumberMode mode=NORMAL) |
Remove invalid channels and updates the channel numbers. More... | |
![]() | |
virtual void | SyncChannelGroupsChanged () |
Static Public Attributes | |
static const int | INVALID_GROUP_ID = -1 |
Protected Member Functions | |
virtual std::vector< std::shared_ptr< CPVRChannelGroupMember > > | RemoveDeletedGroupMembers (const std::vector< std::shared_ptr< CPVRChannelGroupMember >> &groupMembers) |
Remove deleted group members from this group. More... | |
bool | UpdateGroupEntries (const std::vector< std::shared_ptr< CPVRChannelGroupMember >> &groupMembers) |
Update the current channel group members with the given list. More... | |
void | SortByClientChannelNumber () |
Sort the current channel list by client channel number. | |
void | SortByChannelNumber () |
Sort the current channel list by channel number. | |
bool | UpdateClientPriorities () |
Update the priority for all members of all channel groups. | |
std::shared_ptr< CPVRChannelGroupSettings > | GetSettings () const |
Protected Attributes | |
int | m_iGroupType = PVR_GROUP_TYPE_DEFAULT |
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 Protected Attributes | |
static CCriticalSection | m_settingsSingletonCritSection |
static std::weak_ptr< CPVRChannelGroupSettings > | m_settingsSingleton |
Friends | |
class | CPVRDatabase |
CPVRChannelGroup::CPVRChannelGroup | ( | const CPVRChannelsPath & | path, |
const std::shared_ptr< CPVRChannelGroup > & | allChannelsGroup | ||
) |
Create a new channel group instance.
path | The channel group path. |
allChannelsGroup | The channel group containing all TV or radio channels. |
CPVRChannelGroup::CPVRChannelGroup | ( | const PVR_CHANNEL_GROUP & | group, |
const std::shared_ptr< CPVRChannelGroup > & | allChannelsGroup | ||
) |
Create a new channel group instance from a channel group provided by an add-on.
group | The channel group provided by the add-on. |
allChannelsGroup | The channel group containing all TV or radio channels. |
|
virtual |
Append a channel to this container.
channel | The channel to append. |
Reimplemented in PVR::CPVRChannelGroupInternal.
int CPVRChannelGroup::CleanupCachedImages | ( | ) |
Erase stale texture db entries and image files.
|
virtual |
Create an EPG table for each channel.
bForce Create the tables, even if they already have been created before.
Reimplemented in PVR::CPVRChannelGroupInternal.
void CPVRChannelGroup::FillAddonData | ( | PVR_CHANNEL_GROUP & | group | ) | const |
Copy over data to the given PVR_CHANNEL_GROUP instance.
group | The group instance to fill. |
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< 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. |
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). |
CPVRChannelNumber CPVRChannelGroup::GetChannelNumber | ( | const std::shared_ptr< 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< CPVRChannel > & | channel | ) | const |
Get the client channel number in this group of the given channel.
channel | The channel to get the channel number for. |
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< CPVRChannelGroupMember > & | groupMember | ) | const |
Get the next channel group member in this group.
groupMember | The current channel group member. |
|
inlinevirtual |
The amount of hidden channels in this container.
Reimplemented in PVR::CPVRChannelGroupInternal.
const CPVRChannelsPath & CPVRChannelGroup::GetPath | ( | ) | const |
Get the path of this group.
std::shared_ptr< CPVRChannelGroupMember > CPVRChannelGroup::GetPreviousChannelGroupMember | ( | const std::shared_ptr< CPVRChannelGroupMember > & | groupMember | ) | const |
Get the previous channel group member in this group.
groupMember | The current channel group member. |
int CPVRChannelGroup::GroupID | ( | ) | const |
The database ID of this group.
std::string CPVRChannelGroup::GroupName | ( | ) | const |
The name of this group.
bool CPVRChannelGroup::HasChanges | ( | ) | const |
bool CPVRChannelGroup::HasChannels | ( | ) | const |
Does this container holds channels.
bool CPVRChannelGroup::HasNewChannels | ( | ) | const |
bool CPVRChannelGroup::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.
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. |
|
inline |
Whether this group is deleted.
|
virtual |
Check whether a channel is in this container.
channel | The channel to find. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
inline |
Check if this group is the internal group containing all channels.
bool CPVRChannelGroup::IsNew | ( | ) | const |
bool CPVRChannelGroup::IsRadio | ( | ) | const |
True if this group holds radio channels, false if it holds TV channels.
uint64_t CPVRChannelGroup::LastOpened | ( | ) | const |
time_t CPVRChannelGroup::LastWatched | ( | ) | const |
|
virtual |
Load the channels from the database.
channels | All available channels. |
clients | The PVR clients data should be loaded for. Leave empty for all clients. |
Reimplemented in PVR::CPVRChannelGroupInternal.
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::CPVRChannelGroupInternal.
|
virtual |
Remove a channel from this container.
channel | The channel to remove. |
Reimplemented in PVR::CPVRChannelGroupInternal.
bool CPVRChannelGroup::Renumber | ( | RenumberMode | mode = NORMAL | ) |
Remove invalid channels and updates the channel numbers.
mode | the numbering mode to use |
bool CPVRChannelGroup::SetChannelNumber | ( | const std::shared_ptr< CPVRChannel > & | channel, |
const CPVRChannelNumber & | channelNumber | ||
) |
Change the channelnumber of a group. Used by CGUIDialogPVRChannelManager. Call SortByChannelNumber() and Renumber() after all changes are done.
channel | The channel to change the channel number for. |
channelNumber | The new channel number. |
void CPVRChannelGroup::SetGroupID | ( | int | iGroupId | ) |
Set the database ID of this group.
iGroupId | The new database ID. |
void CPVRChannelGroup::SetGroupName | ( | const std::string & | strGroupName | ) |
Change the name of this group.
strGroupName | The new group name. |
void CPVRChannelGroup::SetGroupType | ( | int | iGroupType | ) |
Set the type of this group.
the | new type for this 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 | ) |
size_t CPVRChannelGroup::Size | ( | ) | const |
bool CPVRChannelGroup::SortAndRenumber | ( | ) |
Sort the group and fix up channel numbers.
bool CPVRChannelGroup::UpdateChannel | ( | const std::pair< int, int > & | storageId, |
const std::string & | strChannelName, | ||
const std::string & | strIconPath, | ||
int | iEPGSource, | ||
int | iChannelNumber, | ||
bool | bHidden, | ||
bool | bEPGEnabled, | ||
bool | bParentalLocked, | ||
bool | bUserSetIcon, | ||
bool | bUserSetHidden | ||
) |
Update a channel group member with given data.
storageId | The storage id of the channel. |
strChannelName | The channel name to set. |
strIconPath | The icon path to set. |
iEPGSource | The EPG id. |
iChannelNumber | The channel number to set. |
bHidden | Set/Remove hidden flag for the channel group member identified by storage id. |
bEPGEnabled | Set/Remove EPG enabled flag for the channel group member identified by storage id. |
bParentalLocked | Set/Remove parental locked flag for the channel group member identified by storage id. |
bUserSetIcon | Set/Remove user set icon flag for the channel group member identified by storage id. |
bUserSetHidden | Set/Remove user set hidden flag for the channel group member identified by storage id. |
bool CPVRChannelGroup::UpdateChannelNumbersFromAllChannelsGroup | ( | ) |
Update the channel numbers according to the all channels group and publish event.
|
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. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
protected |
Update the current channel group members with the given list.
groupMembers | The group members to use to update this list. |
|
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
|
protected |
The ID of this group in the database
|
protected |
The type of this group
|
protected |
time in milliseconds from epoch this group was last opened
|
protected |
last time group has been watched
|
protected |
the position of this group within the group list
|
protected |
members with key clientid+uniqueid
|
protected |
members sorted by channel number