Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
PVR::CPVRChannelGroup Class Reference

#include <PVRChannelGroup.h>

Inheritance diagram for PVR::CPVRChannelGroup:
Observable ISettingCallback PVR::CPVRChannelGroupInternal

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...
 
PVRChannelGroupMemberGetByUniqueID (const std::pair< int, int > &id)
 Get a channel group member given its storage id. More...
 
const PVRChannelGroupMemberGetByUniqueID (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...
 
- Public Member Functions inherited from Observable
 Observable ()=default
 
virtual ~Observable ()=default
 
virtual Observableoperator= (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...
 
- Public Member Functions inherited from ISettingCallback
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< CPVRChannelPtrRemoveDeletedChannels (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...
 
- Protected Member Functions inherited from Observable
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
 
- Protected Attributes inherited from Observable
std::atomic< bool > m_bObservableChanged {false}
 
std::vector< Observer * > m_observers
 
CCriticalSection m_obsCritSection
 

Friends

class CPVRChannelGroupInternal
 
class CPVRDatabase
 

Detailed Description

A group of channels

Member Enumeration Documentation

§ Include

Enumerator
ALL 
ONLY_HIDDEN 
ONLY_VISIBLE 

Constructor & Destructor Documentation

§ CPVRChannelGroup() [1/4]

CPVRChannelGroup::CPVRChannelGroup ( void  )

§ CPVRChannelGroup() [2/4]

CPVRChannelGroup::CPVRChannelGroup ( bool  bRadio,
unsigned int  iGroupId,
const std::string &  strGroupName 
)

Create a new channel group instance.

Parameters
bRadioTrue if this group holds radio channels.
iGroupIdThe database ID of this group.
strGroupNameThe name of this group.

§ CPVRChannelGroup() [3/4]

CPVRChannelGroup::CPVRChannelGroup ( const PVR_CHANNEL_GROUP group)
explicit

Create a new channel group instance from a channel group provided by an add-on.

Parameters
groupThe channel group provided by the add-on.

§ CPVRChannelGroup() [4/4]

CPVRChannelGroup::CPVRChannelGroup ( const CPVRChannelGroup group)

Copy constructor.

Parameters
groupSource group

§ ~CPVRChannelGroup()

CPVRChannelGroup::~CPVRChannelGroup ( void  )
override

Member Function Documentation

§ AddAndUpdateChannels()

bool CPVRChannelGroup::AddAndUpdateChannels ( const CPVRChannelGroup channels,
bool  bUseBackendChannelNumbers 
)
protectedvirtual

Add new channels to this group; updtae data.

Parameters
channelsThe new channels to use for this group.
bUseBackendChannelNumbersTrue, if channel numbers from backends shall be used.
Returns
True if everything went well, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ AddToGroup()

bool CPVRChannelGroup::AddToGroup ( const CPVRChannelPtr channel,
const CPVRChannelNumber channelNumber,
bool  bUseBackendChannelNumbers 
)
virtual

Add a channel to this container.

Parameters
channelThe channel to add.
channelNumberThe channel number of the channel to add. Use empty channel number to add it at the end.
bUseBackendChannelNumbersTrue, if channelNumber contains a backend channel number.
Returns
True if the channel was added, false otherwise.
Todo:
notify observers

Reimplemented in PVR::CPVRChannelGroupInternal.

§ CreateChannelEpgs()

bool CPVRChannelGroup::CreateChannelEpgs ( bool  bForce = false)
virtual

Create an EPG table for each channel.

bForce Create the tables, even if they already have been created before.

Returns
True if all tables were created successfully, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ GetByChannelEpgID()

CPVRChannelPtr CPVRChannelGroup::GetByChannelEpgID ( int  iEpgID) const

Get a channel given it's EPG ID.

Parameters
iEpgIDThe channel EPG ID.
Returns
The channel or NULL if it wasn't found.

§ GetByChannelID()

CPVRChannelPtr CPVRChannelGroup::GetByChannelID ( int  iChannelID) const

Get a channel given it's channel ID.

Parameters
iChannelIDThe channel ID.
Returns
The channel or NULL if it wasn't found.

§ GetByChannelNumber()

CFileItemPtr CPVRChannelGroup::GetByChannelNumber ( const CPVRChannelNumber channelNumber) const

Get a channel given it's channel number.

Parameters
channelNumberThe channel number.
Returns
The channel or NULL if it wasn't found.

§ GetByUniqueID() [1/3]

CPVRChannelPtr CPVRChannelGroup::GetByUniqueID ( int  iUniqueChannelId,
int  iClientID 
) const

Get a channel given the channel number on the client.

Parameters
iUniqueChannelIdThe unique channel id on the client.
iClientIDThe ID of the client.
Returns
The channel or NULL if it wasn't found.

§ GetByUniqueID() [2/3]

PVRChannelGroupMember & CPVRChannelGroup::GetByUniqueID ( const std::pair< int, int > &  id)

Get a channel group member given its storage id.

Parameters
idThe storage id (a pair of client id and unique channel id).
Returns
A reference to the group member or an empty group member if it wasn't found.

§ GetByUniqueID() [3/3]

const PVRChannelGroupMember & CPVRChannelGroup::GetByUniqueID ( const std::pair< int, int > &  id) const

§ GetChannelNumber()

CPVRChannelNumber CPVRChannelGroup::GetChannelNumber ( const CPVRChannelPtr channel) const

Get the channel number in this group of the given channel.

Parameters
channelThe channel to get the channel number for.
Returns
The channel number in this group.

§ GetChannelNumbers()

void CPVRChannelGroup::GetChannelNumbers ( std::vector< std::string > &  channelNumbers) const

Get the list of channel numbers in a group.

Parameters
channelNumbersThe list to store the numbers in.

§ GetEPGAll()

int CPVRChannelGroup::GetEPGAll ( CFileItemList results,
bool  bIncludeChannelsWithoutEPG = false 
) const

Get all EPG tables.

Parameters
resultsThe fileitem list to store the results in.
bIncludeChannelsWithoutEPG,forchannels without EPG data, put an empty EPG tag associated with the channel into results
Returns
The amount of entries that were added.

§ GetFirstEPGDate()

CDateTime CPVRChannelGroup::GetFirstEPGDate ( void  ) const

Get the start time of the first entry.

Returns
The start time.

§ GetLastEPGDate()

CDateTime CPVRChannelGroup::GetLastEPGDate ( void  ) const

Get the end time of the last entry.

Returns
The end time.

§ GetLastPlayedChannel()

CFileItemPtr CPVRChannelGroup::GetLastPlayedChannel ( int  iCurrentChannel = -1) const

The channel that was played last that has a valid client or NULL if there was none.

Parameters
iCurrentChannelThe channelid of the current channel that is playing, or -1 if none
Returns
The requested channel.

§ GetMembers() [1/2]

PVR_CHANNEL_GROUP_SORTED_MEMBERS CPVRChannelGroup::GetMembers ( void  ) const

Get the current members of this group

Returns
The group members

§ GetMembers() [2/2]

int CPVRChannelGroup::GetMembers ( CFileItemList results,
Include  eFilter = Include::ONLY_VISIBLE 
) const

Get a filtered list of channels in this group.

Parameters
resultsThe file list to store the results in.
eFilterA filter to apply to the list.
Returns
The amount of channels that were added to the list.

§ GetNextChannel()

CFileItemPtr CPVRChannelGroup::GetNextChannel ( const CPVRChannelPtr channel) const

Get the next channel in this group.

Parameters
channelThe current channel.
Returns
The channel or NULL if it wasn't found.

§ GetNextGroup()

CPVRChannelGroupPtr CPVRChannelGroup::GetNextGroup ( void  ) const
Returns
The next channel group.

§ GetNumHiddenChannels()

virtual size_t PVR::CPVRChannelGroup::GetNumHiddenChannels ( void  ) const
inlinevirtual

The amount of hidden channels in this container.

Returns
The amount of hidden channels in this container.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ GetPath()

std::string CPVRChannelGroup::GetPath ( ) const

Get the path of this group.

Returns
the path.

§ GetPosition()

int CPVRChannelGroup::GetPosition ( void  ) const

§ GetPreviousChannel()

CFileItemPtr CPVRChannelGroup::GetPreviousChannel ( const CPVRChannelPtr channel) const

Get the previous channel in this group.

Parameters
channelThe current channel.
Returns
The channel or NULL if it wasn't found.

§ GetPreviousGroup()

CPVRChannelGroupPtr CPVRChannelGroup::GetPreviousGroup ( void  ) const
Returns
The previous channel group.

§ GroupID()

int CPVRChannelGroup::GroupID ( void  ) const

The database ID of this group.

Returns
The database ID of this group.

§ GroupName()

std::string CPVRChannelGroup::GroupName ( void  ) const

The name of this group.

Returns
The name of this group.

§ GroupType()

int CPVRChannelGroup::GroupType ( void  ) const

Return the type of this group.

§ HasChangedChannels()

bool CPVRChannelGroup::HasChangedChannels ( void  ) const
Returns
True if there is at least one channel in this group with changes that haven't been persisted, false otherwise.

§ HasChanges()

bool CPVRChannelGroup::HasChanges ( void  ) const
Returns
True if anything changed in this group that hasn't been persisted, false otherwise.

§ HasChannels()

bool CPVRChannelGroup::HasChannels ( void  ) const

Does this container holds channels.

Returns
True if there is at least one channel in this container, otherwise false.

§ HasNewChannels()

bool CPVRChannelGroup::HasNewChannels ( void  ) const
Returns
True if there is at least one new channel in this group that hasn't been persisted, false otherwise.

§ IsGroupMember() [1/2]

bool CPVRChannelGroup::IsGroupMember ( const CPVRChannelPtr channel) const
virtual

Check whether a channel is in this container.

Parameters
channelThe channel to find.
Returns
True if the channel was found, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ IsGroupMember() [2/2]

bool CPVRChannelGroup::IsGroupMember ( int  iChannelId) const
virtual

Check whether a channel is in this container.

Parameters
iChannelIdThe db id of the channel to find.
Returns
True if the channel was found, false otherwise.

§ IsHidden()

bool CPVRChannelGroup::IsHidden ( void  ) const

§ IsInternalGroup()

virtual bool PVR::CPVRChannelGroup::IsInternalGroup ( void  ) const
inlinevirtual

Check if this group is the internal group containing all channels.

Returns
True if it's the internal group, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ IsMissingChannelGroupMembersFromClient()

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.

Parameters
iClientIdThe id of the client.
Returns
True, if data is currently missing, false otherwise.

§ IsMissingChannelsFromClient()

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.

Parameters
iClientIdThe id of the client.
Returns
True, if data is currently missing, false otherwise.

§ IsRadio()

bool PVR::CPVRChannelGroup::IsRadio ( void  ) const
inline

True if this group holds radio channels, false if it holds TV channels.

Returns
True if this group holds radio channels, false if it holds TV channels.

§ LastWatched()

time_t CPVRChannelGroup::LastWatched ( void  ) const
Returns
Time group has been watched last.

§ Load()

bool CPVRChannelGroup::Load ( void  )
virtual

Load the channels from the database.

Returns
True when loaded successfully, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ LoadFromClients()

bool CPVRChannelGroup::LoadFromClients ( void  )
protectedvirtual

Load the channels from the clients.

Returns
True when loaded successfully, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ LoadFromDb()

int CPVRChannelGroup::LoadFromDb ( bool  bCompress = false)
protectedvirtual

Load the channels stored in the database.

Parameters
bCompressIf true, compress the database after storing the channels.
Returns
The amount of channels that were added.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ OnInit()

void CPVRChannelGroup::OnInit ( void  )
protectedvirtual

Init class.

§ OnSettingChanged()

void CPVRChannelGroup::OnSettingChanged ( std::shared_ptr< const CSetting setting)
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.

Parameters
settingThe setting whose value has been changed
Todo:
while pvr manager is starting up do accept setting changes.

Reimplemented from ISettingCallback.

§ operator!=()

bool CPVRChannelGroup::operator!= ( const CPVRChannelGroup right) const

§ operator==()

bool CPVRChannelGroup::operator== ( const CPVRChannelGroup right) const

§ Persist()

bool CPVRChannelGroup::Persist ( void  )

Persist changed or new data.

Returns
True if the channel was persisted, false otherwise.

§ PreventSortAndRenumber()

bool CPVRChannelGroup::PreventSortAndRenumber ( void  ) const

True if sorting should be prevented when adding/updating channels to the group.

Returns
True if sorting should be prevented when adding/updating channels to the group.

§ RemoveDeletedChannels()

std::vector< CPVRChannelPtr > CPVRChannelGroup::RemoveDeletedChannels ( const CPVRChannelGroup channels)
protectedvirtual

Remove deleted channels from this group.

Parameters
channelsThe new channels to use for this group.
Returns
The removed channels.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ RemoveFromGroup()

bool CPVRChannelGroup::RemoveFromGroup ( const CPVRChannelPtr channel)
virtual

Remove a channel from this container.

Parameters
channelThe channel to remove.
Returns
True if the channel was found and removed, false otherwise.
Todo:
notify observers

Reimplemented in PVR::CPVRChannelGroupInternal.

§ Renumber()

bool CPVRChannelGroup::Renumber ( void  )

Remove invalid channels and updates the channel numbers.

Returns
True if something changed, false otherwise.

§ SearchAndSetChannelIcons()

void CPVRChannelGroup::SearchAndSetChannelIcons ( bool  bUpdateDb = false)

Search missing channel icons for all known channels.

Parameters
bUpdateDbIf true, update the changed values in the database.
Todo:
start channel icon scraper here if nothing was found

§ SetChannelNumber()

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.

Parameters
channelThe channel to change the channel number for.
channelNumberThe new channel number.

§ SetGroupID()

void CPVRChannelGroup::SetGroupID ( int  iGroupId)

Set the database ID of this group.

Parameters
iGroupIdThe new database ID.

§ SetGroupName()

bool CPVRChannelGroup::SetGroupName ( const std::string &  strGroupName,
bool  bSaveInDb = false 
)

Change the name of this group.

Parameters
strGroupNameThe new group name.
bSaveInDbSave in the database or not.
Returns
True if the something changed, false otherwise.

§ SetGroupType()

void CPVRChannelGroup::SetGroupType ( int  iGroupType)

Set the type of this group.

Parameters
thenew type for this group.

§ SetHidden()

void CPVRChannelGroup::SetHidden ( bool  bHidden)

§ SetLastWatched()

bool CPVRChannelGroup::SetLastWatched ( time_t  iLastWatched)

Last time group has been watched.

Parameters
iLastWatchedThe new value.
Returns
True if something changed, false otherwise.

§ SetPosition()

void CPVRChannelGroup::SetPosition ( int  iPosition)

§ SetPreventSortAndRenumber()

void CPVRChannelGroup::SetPreventSortAndRenumber ( bool  bPreventSortAndRenumber = true)

Set if sorting and renumbering should happen after adding/updating channels to group.

Parameters
bPreventSortAndRenumberThe new sorting and renumbering prevention value for this group.

§ SetRadio()

void PVR::CPVRChannelGroup::SetRadio ( bool  bIsRadio)
inline

Set 'radio' property of this group.

Parameters
bIsRadioThe new value for the 'radio' property.

§ Size()

size_t CPVRChannelGroup::Size ( void  ) const
Returns
The amount of group members

§ SortAndRenumber()

bool CPVRChannelGroup::SortAndRenumber ( void  )

Sort the group and fix up channel numbers.

Returns
True when numbering changed, false otherwise

§ SortByChannelNumber()

void CPVRChannelGroup::SortByChannelNumber ( void  )
protected

Sort the current channel list by channel number.

§ SortByClientChannelNumber()

void CPVRChannelGroup::SortByClientChannelNumber ( void  )
protected

Sort the current channel list by client channel number.

§ Unload()

void CPVRChannelGroup::Unload ( void  )
protectedvirtual

Clear this channel list.

§ Update()

bool CPVRChannelGroup::Update ( void  )
virtual

Refresh the channel list from the clients.

Reimplemented in PVR::CPVRChannelGroupInternal.

§ UpdateChannel()

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 
)
Todo:
add other scrapers

§ UpdateClientPriorities()

bool CPVRChannelGroup::UpdateClientPriorities ( )
protected

Update the priority for all members of all channel groups.

§ UpdateGroupEntries()

bool CPVRChannelGroup::UpdateGroupEntries ( const CPVRChannelGroup channels)
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.

Parameters
channelsThe channels to use to update this list.
Returns
True if everything went well, false otherwise.

Reimplemented in PVR::CPVRChannelGroupInternal.

Friends And Related Function Documentation

§ CPVRChannelGroupInternal

friend class CPVRChannelGroupInternal
friend

§ CPVRDatabase

friend class CPVRDatabase
friend

Member Data Documentation

§ EmptyMember

PVRChannelGroupMember CPVRChannelGroup::EmptyMember
static

Empty group member

§ m_bChanged

bool PVR::CPVRChannelGroup::m_bChanged = false
protected

true if anything changed in this group that hasn't been persisted, false otherwise

§ m_bHidden

bool PVR::CPVRChannelGroup::m_bHidden = false
protected

true if this group is hidden, false otherwise

§ m_bLoaded

bool PVR::CPVRChannelGroup::m_bLoaded = false
protected

True if this container is loaded, false otherwise

§ m_bPreventSortAndRenumber

bool PVR::CPVRChannelGroup::m_bPreventSortAndRenumber = false
protected

true when sorting and renumbering should not be done after adding/updating channels to the group

§ m_bRadio

bool PVR::CPVRChannelGroup::m_bRadio = false
protected

true if this container holds radio channels, false if it holds TV channels

§ m_bUsingBackendChannelNumbers

bool PVR::CPVRChannelGroup::m_bUsingBackendChannelNumbers = false
protected

true to use the channel numbers from 1 backend, false otherwise

§ m_bUsingBackendChannelOrder

bool PVR::CPVRChannelGroup::m_bUsingBackendChannelOrder = false
protected

true to use the channel order from backends, false otherwise

§ m_critSection

CCriticalSection PVR::CPVRChannelGroup::m_critSection
mutableprotected

§ m_failedClientsForChannelGroupMembers

std::vector<int> PVR::CPVRChannelGroup::m_failedClientsForChannelGroupMembers
protected

§ m_failedClientsForChannels

std::vector<int> PVR::CPVRChannelGroup::m_failedClientsForChannels
protected

§ m_iGroupId

int PVR::CPVRChannelGroup::m_iGroupId = -1
protected

The ID of this group in the database

§ m_iGroupType

int PVR::CPVRChannelGroup::m_iGroupType = PVR_GROUP_TYPE_DEFAULT
protected

The type of this group

§ m_iLastWatched

time_t PVR::CPVRChannelGroup::m_iLastWatched = 0
protected

last time group has been watched

§ m_iPosition

int PVR::CPVRChannelGroup::m_iPosition = 0
protected

the position of this group within the group list

§ m_members

PVR_CHANNEL_GROUP_MEMBERS PVR::CPVRChannelGroup::m_members
protected

members with key clientid+uniqueid

§ m_sortedMembers

PVR_CHANNEL_GROUP_SORTED_MEMBERS PVR::CPVRChannelGroup::m_sortedMembers
protected

members sorted by channel number

§ m_strGroupName

std::string PVR::CPVRChannelGroup::m_strGroupName
protected

The name of this group


The documentation for this class was generated from the following files: