![]() |
Kodi Documentation
18.0
Kodi is an open source media player and entertainment hub.
|
#include <PVRChannelGroup.h>
Public Types | |
enum | Include { Include::ALL, Include::ONLY_HIDDEN, Include::ONLY_VISIBLE } |
Public Member Functions | |
CPVRChannelGroup (void) | |
CPVRChannelGroup (bool bRadio, unsigned int iGroupId, const std::string &strGroupName) | |
Create a new channel group instance. More... | |
CPVRChannelGroup (const PVR_CHANNEL_GROUP &group) | |
Create a new channel group instance from a channel group provided by an add-on. More... | |
CPVRChannelGroup (const CPVRChannelGroup &group) | |
Copy constructor. More... | |
~CPVRChannelGroup (void) override | |
bool | operator== (const CPVRChannelGroup &right) const |
bool | operator!= (const CPVRChannelGroup &right) const |
virtual bool | Load (void) |
Load the channels from the database. More... | |
size_t | Size (void) const |
virtual bool | Update (void) |
Refresh the channel list from the clients. More... | |
std::string | GetPath () const |
Get the path of this group. More... | |
bool | SetChannelNumber (const CPVRChannelPtr &channel, const CPVRChannelNumber &channelNumber) |
Change the channelnumber of a group. Used by CGUIDialogPVRChannelManager. Call SortByChannelNumber() and Renumber() after all changes are done. More... | |
void | SearchAndSetChannelIcons (bool bUpdateDb=false) |
Search missing channel icons for all known channels. More... | |
virtual bool | RemoveFromGroup (const CPVRChannelPtr &channel) |
Remove a channel from this container. More... | |
virtual bool | AddToGroup (const CPVRChannelPtr &channel, const CPVRChannelNumber &channelNumber, bool bUseBackendChannelNumbers) |
Add a channel to this container. More... | |
bool | SetGroupName (const std::string &strGroupName, bool bSaveInDb=false) |
Change the name of this group. More... | |
bool | Persist (void) |
Persist changed or new data. More... | |
virtual bool | IsGroupMember (const CPVRChannelPtr &channel) const |
Check whether a channel is in this container. More... | |
virtual bool | IsGroupMember (int iChannelId) const |
Check whether a channel is in this container. More... | |
virtual bool | IsInternalGroup (void) const |
Check if this group is the internal group containing all channels. More... | |
bool | IsRadio (void) const |
True if this group holds radio channels, false if it holds TV channels. More... | |
void | SetRadio (bool bIsRadio) |
Set 'radio' property of this group. More... | |
bool | PreventSortAndRenumber (void) const |
True if sorting should be prevented when adding/updating channels to the group. More... | |
int | GroupID (void) 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 (void) const |
Return the type of this group. More... | |
time_t | LastWatched () const |
bool | SetLastWatched (time_t iLastWatched) |
Last time group has been watched. More... | |
void | SetPreventSortAndRenumber (bool bPreventSortAndRenumber=true) |
Set if sorting and renumbering should happen after adding/updating channels to group. More... | |
std::string | GroupName (void) const |
The name of this group. More... | |
void | OnSettingChanged (std::shared_ptr< const CSetting > setting) override |
The value of the given setting has changed. More... | |
CPVRChannelPtr | GetByChannelEpgID (int iEpgID) const |
Get a channel given it's EPG ID. More... | |
CFileItemPtr | GetLastPlayedChannel (int iCurrentChannel=-1) const |
The channel that was played last that has a valid client or NULL if there was none. More... | |
CFileItemPtr | GetByChannelNumber (const CPVRChannelNumber &channelNumber) const |
Get a channel given it's channel number. More... | |
CPVRChannelNumber | GetChannelNumber (const CPVRChannelPtr &channel) const |
Get the channel number in this group of the given channel. More... | |
CFileItemPtr | GetNextChannel (const CPVRChannelPtr &channel) const |
Get the next channel in this group. More... | |
CFileItemPtr | GetPreviousChannel (const CPVRChannelPtr &channel) const |
Get the previous channel in this group. More... | |
CPVRChannelPtr | GetByChannelID (int iChannelID) const |
Get a channel given it's channel ID. More... | |
PVR_CHANNEL_GROUP_SORTED_MEMBERS | GetMembers (void) const |
int | GetMembers (CFileItemList &results, Include eFilter=Include::ONLY_VISIBLE) const |
Get a filtered list of channels in this group. More... | |
void | GetChannelNumbers (std::vector< std::string > &channelNumbers) const |
Get the list of channel numbers in a group. More... | |
CPVRChannelGroupPtr | GetNextGroup (void) const |
CPVRChannelGroupPtr | GetPreviousGroup (void) const |
virtual size_t | GetNumHiddenChannels (void) const |
The amount of hidden channels in this container. More... | |
bool | HasChannels (void) const |
Does this container holds channels. More... | |
bool | HasChangedChannels (void) const |
bool | HasNewChannels (void) const |
bool | HasChanges (void) const |
virtual bool | CreateChannelEpgs (bool bForce=false) |
Create an EPG table for each channel. More... | |
int | GetEPGAll (CFileItemList &results, bool bIncludeChannelsWithoutEPG=false) const |
Get all EPG tables. More... | |
CDateTime | GetFirstEPGDate (void) const |
Get the start time of the first entry. More... | |
CDateTime | GetLastEPGDate (void) const |
Get the end time of the last entry. More... | |
bool | UpdateChannel (const CFileItem &channel, bool bHidden, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const std::string &strChannelName, const std::string &strIconPath, bool bUserSetIcon=false) |
CPVRChannelPtr | GetByUniqueID (int iUniqueChannelId, int iClientID) const |
Get a channel given the channel number on the client. More... | |
PVRChannelGroupMember & | GetByUniqueID (const std::pair< int, int > &id) |
Get a channel group member given its storage id. More... | |
const PVRChannelGroupMember & | GetByUniqueID (const std::pair< int, int > &id) const |
void | SetHidden (bool bHidden) |
bool | IsHidden (void) const |
int | GetPosition (void) const |
void | SetPosition (int iPosition) |
bool | IsMissingChannelGroupMembersFromClient (int iClientId) const |
Check, whether channel group member data for a given pvr client are currently missing, for instance, because the client was offline when data was last queried. More... | |
bool | IsMissingChannelsFromClient (int iClientId) const |
Check, whether channel data for a given pvr client are currently missing, for instance, because the client was offline when data was last queried. More... | |
Sort methods | |
bool | SortAndRenumber (void) |
Sort the group and fix up channel numbers. More... | |
bool | Renumber (void) |
Remove invalid channels and updates the channel numbers. More... | |
![]() | |
Observable ()=default | |
virtual | ~Observable ()=default |
virtual Observable & | operator= (const Observable &observable) |
virtual void | RegisterObserver (Observer *obs) |
Register an observer. More... | |
virtual void | UnregisterObserver (Observer *obs) |
Unregister an observer. More... | |
virtual void | NotifyObservers (const ObservableMessage message=ObservableMessageNone) |
Send a message to all observers when m_bObservableChanged is true. More... | |
virtual void | SetChanged (bool bSetTo=true) |
Mark an observable changed. More... | |
virtual bool | IsObserving (const Observer &obs) const |
Check whether this observable is being observed by an observer. More... | |
![]() | |
virtual | ~ISettingCallback ()=default |
virtual bool | OnSettingChanging (std::shared_ptr< const CSetting > setting) |
The value of the given setting is being changed. More... | |
virtual void | OnSettingAction (std::shared_ptr< const CSetting > setting) |
The given setting has been activated. More... | |
virtual bool | OnSettingUpdate (std::shared_ptr< CSetting > setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) |
The given setting needs to be updated. More... | |
virtual void | OnSettingPropertyChanged (std::shared_ptr< const CSetting > setting, const char *propertyName) |
The given property of the given setting has changed. More... | |
Static Public Attributes | |
static PVRChannelGroupMember | EmptyMember |
Protected Member Functions | |
virtual void | OnInit (void) |
Init class. More... | |
virtual int | LoadFromDb (bool bCompress=false) |
Load the channels stored in the database. More... | |
virtual bool | UpdateGroupEntries (const CPVRChannelGroup &channels) |
Update the current channel list with the given list. More... | |
virtual bool | AddAndUpdateChannels (const CPVRChannelGroup &channels, bool bUseBackendChannelNumbers) |
Add new channels to this group; updtae data. More... | |
virtual std::vector< CPVRChannelPtr > | RemoveDeletedChannels (const CPVRChannelGroup &channels) |
Remove deleted channels from this group. More... | |
virtual void | Unload (void) |
Clear this channel list. More... | |
virtual bool | LoadFromClients (void) |
Load the channels from the clients. More... | |
void | SortByClientChannelNumber (void) |
Sort the current channel list by client channel number. More... | |
void | SortByChannelNumber (void) |
Sort the current channel list by channel number. More... | |
bool | UpdateClientPriorities () |
Update the priority for all members of all channel groups. More... | |
![]() | |
void | SendMessage (const ObservableMessage message) |
Send a message to all observer when m_bObservableChanged is true. More... | |
Protected Attributes | |
bool | m_bRadio = false |
int | m_iGroupType = PVR_GROUP_TYPE_DEFAULT |
int | m_iGroupId = -1 |
std::string | m_strGroupName |
bool | m_bLoaded = false |
bool | m_bChanged = false |
bool | m_bUsingBackendChannelOrder = false |
bool | m_bUsingBackendChannelNumbers = false |
bool | m_bPreventSortAndRenumber = false |
time_t | m_iLastWatched = 0 |
bool | m_bHidden = false |
int | m_iPosition = 0 |
PVR_CHANNEL_GROUP_SORTED_MEMBERS | m_sortedMembers |
PVR_CHANNEL_GROUP_MEMBERS | m_members |
CCriticalSection | m_critSection |
std::vector< int > | m_failedClientsForChannels |
std::vector< int > | m_failedClientsForChannelGroupMembers |
![]() | |
std::atomic< bool > | m_bObservableChanged {false} |
std::vector< Observer * > | m_observers |
CCriticalSection | m_obsCritSection |
Friends | |
class | CPVRChannelGroupInternal |
class | CPVRDatabase |
A group of channels
|
strong |
CPVRChannelGroup::CPVRChannelGroup | ( | void | ) |
CPVRChannelGroup::CPVRChannelGroup | ( | bool | bRadio, |
unsigned int | iGroupId, | ||
const std::string & | strGroupName | ||
) |
Create a new channel group instance.
bRadio | True if this group holds radio channels. |
iGroupId | The database ID of this group. |
strGroupName | The name of this group. |
|
explicit |
Create a new channel group instance from a channel group provided by an add-on.
group | The channel group provided by the add-on. |
CPVRChannelGroup::CPVRChannelGroup | ( | const CPVRChannelGroup & | group | ) |
Copy constructor.
group | Source group |
|
override |
|
protectedvirtual |
Add new channels to this group; updtae data.
channels | The new channels to use for this group. |
bUseBackendChannelNumbers | True, if channel numbers from backends shall be used. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
virtual |
Add a channel to this container.
channel | The channel to add. |
channelNumber | The channel number of the channel to add. Use empty channel number to add it at the end. |
bUseBackendChannelNumbers | True, if channelNumber contains a backend channel number. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
virtual |
Create an EPG table for each channel.
bForce Create the tables, even if they already have been created before.
Reimplemented in PVR::CPVRChannelGroupInternal.
CPVRChannelPtr CPVRChannelGroup::GetByChannelEpgID | ( | int | iEpgID | ) | const |
Get a channel given it's EPG ID.
iEpgID | The channel EPG ID. |
CPVRChannelPtr CPVRChannelGroup::GetByChannelID | ( | int | iChannelID | ) | const |
Get a channel given it's channel ID.
iChannelID | The channel ID. |
CFileItemPtr CPVRChannelGroup::GetByChannelNumber | ( | const CPVRChannelNumber & | channelNumber | ) | const |
Get a channel given it's channel number.
channelNumber | The channel number. |
CPVRChannelPtr 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. |
PVRChannelGroupMember & CPVRChannelGroup::GetByUniqueID | ( | const std::pair< int, int > & | id | ) |
Get a channel group member given its storage id.
id | The storage id (a pair of client id and unique channel id). |
const PVRChannelGroupMember & CPVRChannelGroup::GetByUniqueID | ( | const std::pair< int, int > & | id | ) | const |
CPVRChannelNumber CPVRChannelGroup::GetChannelNumber | ( | const CPVRChannelPtr & | 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 channel numbers in a group.
channelNumbers | The list to store the numbers in. |
int CPVRChannelGroup::GetEPGAll | ( | CFileItemList & | results, |
bool | bIncludeChannelsWithoutEPG = false |
||
) | const |
Get all EPG tables.
results | The fileitem list to store the results in. |
bIncludeChannelsWithoutEPG,for | channels without EPG data, put an empty EPG tag associated with the channel into results |
Get the start time of the first entry.
Get the end time of the last entry.
CFileItemPtr CPVRChannelGroup::GetLastPlayedChannel | ( | int | iCurrentChannel = -1 | ) | const |
The channel that was played last that has a valid client or NULL if there was none.
iCurrentChannel | The channelid of the current channel that is playing, or -1 if none |
PVR_CHANNEL_GROUP_SORTED_MEMBERS CPVRChannelGroup::GetMembers | ( | void | ) | const |
Get the current members of this group
int CPVRChannelGroup::GetMembers | ( | CFileItemList & | results, |
Include | eFilter = Include::ONLY_VISIBLE |
||
) | const |
Get a filtered list of channels in this group.
results | The file list to store the results in. |
eFilter | A filter to apply to the list. |
CFileItemPtr CPVRChannelGroup::GetNextChannel | ( | const CPVRChannelPtr & | channel | ) | const |
Get the next channel in this group.
channel | The current channel. |
CPVRChannelGroupPtr CPVRChannelGroup::GetNextGroup | ( | void | ) | const |
|
inlinevirtual |
The amount of hidden channels in this container.
Reimplemented in PVR::CPVRChannelGroupInternal.
std::string CPVRChannelGroup::GetPath | ( | ) | const |
Get the path of this group.
int CPVRChannelGroup::GetPosition | ( | void | ) | const |
CFileItemPtr CPVRChannelGroup::GetPreviousChannel | ( | const CPVRChannelPtr & | channel | ) | const |
Get the previous channel in this group.
channel | The current channel. |
CPVRChannelGroupPtr CPVRChannelGroup::GetPreviousGroup | ( | void | ) | const |
int CPVRChannelGroup::GroupID | ( | void | ) | const |
The database ID of this group.
std::string CPVRChannelGroup::GroupName | ( | void | ) | const |
The name of this group.
int CPVRChannelGroup::GroupType | ( | void | ) | const |
Return the type of this group.
bool CPVRChannelGroup::HasChangedChannels | ( | void | ) | const |
bool CPVRChannelGroup::HasChanges | ( | void | ) | const |
bool CPVRChannelGroup::HasChannels | ( | void | ) | const |
Does this container holds channels.
bool CPVRChannelGroup::HasNewChannels | ( | void | ) | const |
|
virtual |
Check whether a channel is in this container.
channel | The channel to find. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
virtual |
Check whether a channel is in this container.
iChannelId | The db id of the channel to find. |
bool CPVRChannelGroup::IsHidden | ( | void | ) | const |
|
inlinevirtual |
Check if this group is the internal group containing all channels.
Reimplemented in PVR::CPVRChannelGroupInternal.
bool CPVRChannelGroup::IsMissingChannelGroupMembersFromClient | ( | int | iClientId | ) | const |
Check, whether channel group member data for a given pvr client are currently missing, for instance, because the client was offline when data was last queried.
iClientId | The id of the client. |
bool CPVRChannelGroup::IsMissingChannelsFromClient | ( | int | iClientId | ) | const |
Check, whether channel data for a given pvr client are currently missing, for instance, because the client was offline when data was last queried.
iClientId | The id of the client. |
|
inline |
True if this group holds radio channels, false if it holds TV channels.
time_t CPVRChannelGroup::LastWatched | ( | void | ) | const |
|
virtual |
Load the channels from the database.
Reimplemented in PVR::CPVRChannelGroupInternal.
|
protectedvirtual |
Load the channels from the clients.
Reimplemented in PVR::CPVRChannelGroupInternal.
|
protectedvirtual |
Load the channels stored in the database.
bCompress | If true, compress the database after storing the channels. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
overridevirtual |
The value of the given setting has changed.
This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.
setting | The setting whose value has been changed |
Reimplemented from ISettingCallback.
bool CPVRChannelGroup::operator!= | ( | const CPVRChannelGroup & | right | ) | const |
bool CPVRChannelGroup::operator== | ( | const CPVRChannelGroup & | right | ) | const |
bool CPVRChannelGroup::Persist | ( | void | ) |
Persist changed or new data.
bool CPVRChannelGroup::PreventSortAndRenumber | ( | void | ) | const |
True if sorting should be prevented when adding/updating channels to the group.
|
protectedvirtual |
Remove deleted channels from this group.
channels | The new channels to use for this group. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
virtual |
Remove a channel from this container.
channel | The channel to remove. |
Reimplemented in PVR::CPVRChannelGroupInternal.
bool CPVRChannelGroup::Renumber | ( | void | ) |
Remove invalid channels and updates the channel numbers.
void CPVRChannelGroup::SearchAndSetChannelIcons | ( | bool | bUpdateDb = false | ) |
Search missing channel icons for all known channels.
bUpdateDb | If true, update the changed values in the database. |
bool CPVRChannelGroup::SetChannelNumber | ( | const CPVRChannelPtr & | 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. |
bool CPVRChannelGroup::SetGroupName | ( | const std::string & | strGroupName, |
bool | bSaveInDb = false |
||
) |
Change the name of this group.
strGroupName | The new group name. |
bSaveInDb | Save in the database or not. |
void CPVRChannelGroup::SetGroupType | ( | int | iGroupType | ) |
Set the type of this group.
the | new type for this group. |
void CPVRChannelGroup::SetHidden | ( | bool | bHidden | ) |
bool CPVRChannelGroup::SetLastWatched | ( | time_t | iLastWatched | ) |
Last time group has been watched.
iLastWatched | The new value. |
void CPVRChannelGroup::SetPosition | ( | int | iPosition | ) |
void CPVRChannelGroup::SetPreventSortAndRenumber | ( | bool | bPreventSortAndRenumber = true | ) |
Set if sorting and renumbering should happen after adding/updating channels to group.
bPreventSortAndRenumber | The new sorting and renumbering prevention value for this group. |
|
inline |
Set 'radio' property of this group.
bIsRadio | The new value for the 'radio' property. |
size_t CPVRChannelGroup::Size | ( | void | ) | const |
bool CPVRChannelGroup::SortAndRenumber | ( | void | ) |
Sort the group and fix up channel numbers.
Sort the current channel list by channel number.
Sort the current channel list by client channel number.
|
virtual |
Refresh the channel list from the clients.
Reimplemented in PVR::CPVRChannelGroupInternal.
bool CPVRChannelGroup::UpdateChannel | ( | const CFileItem & | channel, |
bool | bHidden, | ||
bool | bEPGEnabled, | ||
bool | bParentalLocked, | ||
int | iEPGSource, | ||
int | iChannelNumber, | ||
const std::string & | strChannelName, | ||
const std::string & | strIconPath, | ||
bool | bUserSetIcon = false |
||
) |
|
protected |
Update the priority for all members of all channel groups.
|
protectedvirtual |
Update the current channel list with the given list.
Update the current channel list with the given list. Only the new channels will be present in the passed list after this call.
channels | The channels to use to update this list. |
Reimplemented in PVR::CPVRChannelGroupInternal.
|
friend |
|
friend |
|
static |
Empty group member
|
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 |
true when sorting and renumbering should not be done after adding/updating channels to the group
|
protected |
true if this container holds radio channels, false if it holds TV channels
|
protected |
true to use the channel numbers from 1 backend, false otherwise
|
protected |
true to use the channel order from backends, false otherwise
|
mutableprotected |
|
protected |
|
protected |
|
protected |
The ID of this group in the database
|
protected |
The type of this group
|
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
|
protected |
The name of this group