Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PVR::CPVRChannelGroupAllChannels Class Reference

#include <PVRChannelGroupAllChannels.h>

Inheritance diagram for PVR::CPVRChannelGroupAllChannels:
PVR::CPVRChannelGroup PVR::IChannelGroupSettingsCallback

Public Member Functions

 CPVRChannelGroupAllChannels ()=delete
 
 CPVRChannelGroupAllChannels (bool bRadio)
 Create a new all channels channel group.
 
 CPVRChannelGroupAllChannels (const CPVRChannelsPath &path)
 Create a new all channels channel group.
 
 ~CPVRChannelGroupAllChannels () override
 
bool IsGroupMember (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) const override
 
bool AppendToGroup (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) override
 
bool RemoveFromGroup (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) override
 
void CheckGroupName ()
 Check whether the group name is still correct after the language setting changed.
 
Origin GetOrigin () const override
 Get the group's origin.
 
int GroupType () const override
 Return the type of this group.
 
bool SupportsDelete () const override
 Check whether this group could be deleted by the user.
 
bool SupportsMemberAdd () const override
 Check whether members could be added to this group by the user.
 
bool SupportsMemberRemove () const override
 Check whether members could be removed from this group by the user.
 
bool IsChannelsOwner () const override
 Check whether this group is owner of the channel instances it contains.
 
bool ShouldBeIgnored (const std::vector< std::shared_ptr< CPVRChannelGroup > > &allChannelGroups) const override
 Check whether this group should be ignored, e.g. not presented to the user and API.
 
- Public Member Functions inherited from PVR::CPVRChannelGroup
 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
 
void FillAddonData (PVR_CHANNEL_GROUP &group) const
 Copy over data to the given PVR_CHANNEL_GROUP instance.
 
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
 
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 CPVRChannelsPathGetPath () const
 Get the path of this group.
 
void SetPath (const CPVRChannelsPath &path)
 Set the path of this group.
 
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.
 
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< CPVRChannelGroupMemberGetLastPlayedChannelGroupMember (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< CPVRChannelGroupMemberGetByChannelNumber (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< CPVRChannelGroupMemberGetNextChannelGroupMember (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) const
 Get the next channel group member in this group.
 
std::shared_ptr< CPVRChannelGroupMemberGetPreviousChannelGroupMember (const std::shared_ptr< const CPVRChannelGroupMember > &groupMember) const
 Get the previous channel group member in this group.
 
std::shared_ptr< CPVRChannelGetByChannelID (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< CPVRChannelGetByUniqueID (int iUniqueChannelId, int iClientID) const
 Get a channel given the channel number on the client.
 
std::shared_ptr< CPVRChannelGroupMemberGetByUniqueID (const std::pair< int, int > &id) const
 Get a channel group member given its storage id.
 
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.
 
void DeleteGroupMember (const std::shared_ptr< CPVRChannelGroupMember > &member)
 Remove the given group member from the 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.
 
- Public Member Functions inherited from PVR::IChannelGroupSettingsCallback
virtual ~IChannelGroupSettingsCallback ()=default
 

Protected Member Functions

std::vector< std::shared_ptr< CPVRChannelGroupMember > > RemoveDeletedGroupMembers (const std::vector< std::shared_ptr< CPVRChannelGroupMember > > &groupMembers) override
 Remove deleted group members from this group. Delete stale channels.
 
bool UpdateFromClients (const std::vector< std::shared_ptr< CPVRClient > > &clients) override
 Update data with 'all channels' group members from the given clients, sync with local data.
 
- Protected Member Functions inherited from PVR::CPVRChannelGroup
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< CPVRChannelGroupSettingsGetSettings () const
 

Additional Inherited Members

- Public Types inherited from PVR::CPVRChannelGroup
enum class  Include { ALL , ONLY_HIDDEN , ONLY_VISIBLE }
 
enum class  Origin { USER , SYSTEM , CLIENT }
 
- Static Public Attributes inherited from PVR::CPVRChannelGroup
static const int INVALID_GROUP_ID = -1
 
- Protected Attributes inherited from PVR::CPVRChannelGroup
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< intm_failedClients
 
CEventSource< PVREventm_events
 
std::shared_ptr< CPVRChannelGroupSettingsm_settings
 
- Static Protected Attributes inherited from PVR::CPVRChannelGroup
static CCriticalSection m_settingsSingletonCritSection
 
static std::weak_ptr< CPVRChannelGroupSettingsm_settingsSingleton
 

Constructor & Destructor Documentation

◆ CPVRChannelGroupAllChannels() [1/3]

PVR::CPVRChannelGroupAllChannels::CPVRChannelGroupAllChannels ( )
delete

◆ CPVRChannelGroupAllChannels() [2/3]

CPVRChannelGroupAllChannels::CPVRChannelGroupAllChannels ( bool bRadio)
explicit

Create a new all channels channel group.

Parameters
bRadioTrue if this group holds radio channels.

◆ CPVRChannelGroupAllChannels() [3/3]

CPVRChannelGroupAllChannels::CPVRChannelGroupAllChannels ( const CPVRChannelsPath & path)
explicit

Create a new all channels channel group.

Parameters
pathThe path for the new group.

◆ ~CPVRChannelGroupAllChannels()

CPVRChannelGroupAllChannels::~CPVRChannelGroupAllChannels ( )
override

Member Function Documentation

◆ AppendToGroup()

bool CPVRChannelGroupAllChannels::AppendToGroup ( const std::shared_ptr< const CPVRChannelGroupMember > & groupMember)
overridevirtual

◆ CheckGroupName()

void CPVRChannelGroupAllChannels::CheckGroupName ( )

Check whether the group name is still correct after the language setting changed.

Todo
major design flaw to fix: channel and group URLs must not contain the group name!

◆ GetOrigin()

Origin PVR::CPVRChannelGroupAllChannels::GetOrigin ( ) const
inlineoverridevirtual

Get the group's origin.

Returns
The origin.

Implements PVR::CPVRChannelGroup.

◆ GroupType()

int PVR::CPVRChannelGroupAllChannels::GroupType ( ) const
inlineoverridevirtual

Return the type of this group.

Implements PVR::CPVRChannelGroup.

◆ IsChannelsOwner()

bool PVR::CPVRChannelGroupAllChannels::IsChannelsOwner ( ) const
inlineoverridevirtual

Check whether this group is owner of the channel instances it contains.

Returns
True if owner, false otherwise.

Implements PVR::CPVRChannelGroup.

◆ IsGroupMember()

bool CPVRChannelGroupAllChannels::IsGroupMember ( const std::shared_ptr< const CPVRChannelGroupMember > & groupMember) const
overridevirtual

◆ RemoveDeletedGroupMembers()

std::vector< std::shared_ptr< CPVRChannelGroupMember > > CPVRChannelGroupAllChannels::RemoveDeletedGroupMembers ( const std::vector< std::shared_ptr< CPVRChannelGroupMember > > & groupMembers)
overrideprotectedvirtual

Remove deleted group members from this group. Delete stale channels.

Parameters
groupMembersThe group members to use to update this list.
Returns
The removed members .

Reimplemented from PVR::CPVRChannelGroup.

◆ RemoveFromGroup()

bool CPVRChannelGroupAllChannels::RemoveFromGroup ( const std::shared_ptr< const CPVRChannelGroupMember > & groupMember)
overridevirtual

◆ ShouldBeIgnored()

bool PVR::CPVRChannelGroupAllChannels::ShouldBeIgnored ( const std::vector< std::shared_ptr< CPVRChannelGroup > > & allChannelGroups) const
inlineoverridevirtual

Check whether this group should be ignored, e.g. not presented to the user and API.

Parameters
allChannelGroupsAll available channel groups.
Returns
True if to be ignored, false otherwise.

Reimplemented from PVR::CPVRChannelGroup.

◆ SupportsDelete()

bool PVR::CPVRChannelGroupAllChannels::SupportsDelete ( ) const
inlineoverridevirtual

Check whether this group could be deleted by the user.

Returns
True if the group could be deleted, false otherwise.

Implements PVR::CPVRChannelGroup.

◆ SupportsMemberAdd()

bool PVR::CPVRChannelGroupAllChannels::SupportsMemberAdd ( ) const
inlineoverridevirtual

Check whether members could be added to this group by the user.

Returns
True if members could be added, false otherwise.

Implements PVR::CPVRChannelGroup.

◆ SupportsMemberRemove()

bool PVR::CPVRChannelGroupAllChannels::SupportsMemberRemove ( ) const
inlineoverridevirtual

Check whether members could be removed from this group by the user.

Returns
True if members could be removed, false otherwise.

Implements PVR::CPVRChannelGroup.

◆ UpdateFromClients()

bool CPVRChannelGroupAllChannels::UpdateFromClients ( const std::vector< std::shared_ptr< CPVRClient > > & clients)
overrideprotectedvirtual

Update data with 'all channels' group members from the given clients, sync with local data.

Parameters
clientsThe clients to fetch data from. Leave empty to fetch data from all created clients.
Returns
True on success, false otherwise.

Implements PVR::CPVRChannelGroup.


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