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

#include <PVRChannelGroups.h>

Public Member Functions

 CPVRChannelGroups (bool bRadio)
 Create a new group container. More...
 
virtual ~CPVRChannelGroups (void)
 
void Clear (void)
 Remove all channels from this group. More...
 
bool Load (void)
 Load this container's contents from the database or PVR clients. More...
 
size_t Size (void) const
 
bool Update (const CPVRChannelGroup &group, bool bUpdateFromClient=false)
 Update a group or add it if it's not in here yet. More...
 
bool UpdateFromClient (const CPVRChannelGroup &group)
 Called by the add-on callback to add a new group. More...
 
CFileItemPtr GetByPath (const std::string &strPath) const
 Get a channel given it's path. More...
 
CPVRChannelGroupPtr GetById (int iGroupId) const
 Get a pointer to a channel group given it's ID. More...
 
std::vector< CPVRChannelGroupPtrGetGroupsByChannel (const CPVRChannelPtr &channel, bool bExcludeHidden=false) const
 Get all groups the given channel is a member. More...
 
CPVRChannelGroupPtr GetByName (const std::string &strName) const
 Get a group given it's name. More...
 
CPVRChannelGroupPtr GetGroupAll (void) const
 Get the group that contains all channels. More...
 
CPVRChannelGroupPtr GetFirstGroup (void) const
 
CPVRChannelGroupPtr GetLastGroup (void) const
 
CPVRChannelGroupPtr GetLastPlayedGroup (int iChannelID=-1) const
 The group that was played last and optionally contains the given channel. More...
 
std::vector< CPVRChannelGroupPtrGetMembers (bool bExcludeHidden=false) const
 Get the list of groups. More...
 
int GetGroupList (CFileItemList *results, bool bExcludeHidden=false) const
 Get the list of groups. More...
 
CPVRChannelGroupPtr GetPreviousGroup (const CPVRChannelGroup &group) const
 Get the previous group in this container. More...
 
CPVRChannelGroupPtr GetNextGroup (const CPVRChannelGroup &group) const
 Get the next group in this container. More...
 
CPVRChannelGroupPtr GetSelectedGroup (void) const
 Get the group that is currently selected in the UI. More...
 
void SetSelectedGroup (const CPVRChannelGroupPtr &group)
 Change the selected group. More...
 
bool AddGroup (const std::string &strName)
 Add a group to this container. More...
 
bool DeleteGroup (const CPVRChannelGroup &group)
 Delete a group in this container. More...
 
bool CreateChannelEpgs (void)
 Create EPG tags for all channels of the internal group. More...
 
void RemoveFromAllGroups (const CPVRChannelPtr &channel)
 Remove a channel from all non-system groups. More...
 
bool PersistAll (void)
 Persist all changes in channel groups. More...
 
bool IsRadio (void) const
 
bool Update (bool bChannelsOnly=false)
 Update the contents of the groups in this container. More...
 

Detailed Description

A container class for channel groups

Constructor & Destructor Documentation

§ CPVRChannelGroups()

CPVRChannelGroups::CPVRChannelGroups ( bool  bRadio)
explicit

Create a new group container.

Parameters
bRadioTrue if this is a container for radio channels, false if it is for tv channels.

§ ~CPVRChannelGroups()

CPVRChannelGroups::~CPVRChannelGroups ( void  )
virtual

Member Function Documentation

§ AddGroup()

bool CPVRChannelGroups::AddGroup ( const std::string &  strName)

Add a group to this container.

Parameters
strNameThe name of the group.
Returns
True if the group was added, false otherwise.

§ Clear()

void CPVRChannelGroups::Clear ( void  )

Remove all channels from this group.

§ CreateChannelEpgs()

bool CPVRChannelGroups::CreateChannelEpgs ( void  )

Create EPG tags for all channels of the internal group.

Returns
True if EPG tags where created successfully, false if not.

§ DeleteGroup()

bool CPVRChannelGroups::DeleteGroup ( const CPVRChannelGroup group)

Delete a group in this container.

Parameters
groupThe group to delete.
Returns
True if it was deleted successfully, false if not.

§ GetById()

CPVRChannelGroupPtr CPVRChannelGroups::GetById ( int  iGroupId) const

Get a pointer to a channel group given it's ID.

Parameters
iGroupIdThe ID of the group.
Returns
The group or NULL if it wasn't found.

§ GetByName()

CPVRChannelGroupPtr CPVRChannelGroups::GetByName ( const std::string &  strName) const

Get a group given it's name.

Parameters
strNameThe name.
Returns
The group or NULL if it wasn't found.

§ GetByPath()

CFileItemPtr CPVRChannelGroups::GetByPath ( const std::string &  strPath) const

Get a channel given it's path.

Parameters
strPathThe path to the channel
Returns
The channel, or an empty fileitem when not found

§ GetFirstGroup()

CPVRChannelGroupPtr PVR::CPVRChannelGroups::GetFirstGroup ( void  ) const
inline
Returns
The first group in this container, which always is the group with all channels.

§ GetGroupAll()

CPVRChannelGroupPtr CPVRChannelGroups::GetGroupAll ( void  ) const

Get the group that contains all channels.

Returns
The group that contains all channels.

§ GetGroupList()

int CPVRChannelGroups::GetGroupList ( CFileItemList results,
bool  bExcludeHidden = false 
) const

Get the list of groups.

Parameters
resultsThe file list to store the results in.
bExcludeHiddenDecides whether to filter hidden groups
Returns
The amount of items that were added.

§ GetGroupsByChannel()

std::vector< CPVRChannelGroupPtr > CPVRChannelGroups::GetGroupsByChannel ( const CPVRChannelPtr channel,
bool  bExcludeHidden = false 
) const

Get all groups the given channel is a member.

Parameters
channelThe channel.
bExcludeHiddenWhenever to exclude hidden channel groups.
Returns
A list of groups the channel is a member.

§ GetLastGroup()

CPVRChannelGroupPtr CPVRChannelGroups::GetLastGroup ( void  ) const
Returns
The last group in this container.

§ GetLastPlayedGroup()

CPVRChannelGroupPtr CPVRChannelGroups::GetLastPlayedGroup ( int  iChannelID = -1) const

The group that was played last and optionally contains the given channel.

Parameters
iChannelIDThe channel ID
Returns
The last watched group.

§ GetMembers()

std::vector< CPVRChannelGroupPtr > CPVRChannelGroups::GetMembers ( bool  bExcludeHidden = false) const

Get the list of groups.

Parameters
groupsThe list to store the results in.
bExcludeHiddenWhenever to exclude hidden channel groups.
Returns
The amount of items that were added.

§ GetNextGroup()

CPVRChannelGroupPtr CPVRChannelGroups::GetNextGroup ( const CPVRChannelGroup group) const

Get the next group in this container.

Parameters
groupThe current group.
Returns
The next group or the group containing all channels if it wasn't found.

§ GetPreviousGroup()

CPVRChannelGroupPtr CPVRChannelGroups::GetPreviousGroup ( const CPVRChannelGroup group) const

Get the previous group in this container.

Parameters
groupThe current group.
Returns
The previous group or the group containing all channels if it wasn't found.

§ GetSelectedGroup()

CPVRChannelGroupPtr CPVRChannelGroups::GetSelectedGroup ( void  ) const

Get the group that is currently selected in the UI.

Returns
The selected group.

§ IsRadio()

bool PVR::CPVRChannelGroups::IsRadio ( void  ) const
inline
Returns
True when this container contains radio groups, false otherwise

§ Load()

bool CPVRChannelGroups::Load ( void  )

Load this container's contents from the database or PVR clients.

Returns
True if it was loaded successfully, false if not.

§ PersistAll()

bool CPVRChannelGroups::PersistAll ( void  )

Persist all changes in channel groups.

Returns
True if everything was persisted, false otherwise.

§ RemoveFromAllGroups()

void CPVRChannelGroups::RemoveFromAllGroups ( const CPVRChannelPtr channel)

Remove a channel from all non-system groups.

Parameters
channelThe channel to remove.

§ SetSelectedGroup()

void CPVRChannelGroups::SetSelectedGroup ( const CPVRChannelGroupPtr group)

Change the selected group.

Parameters
groupThe group to select.

§ Size()

size_t PVR::CPVRChannelGroups::Size ( void  ) const
inline
Returns
Amount of groups in this container

§ Update() [1/2]

bool CPVRChannelGroups::Update ( const CPVRChannelGroup group,
bool  bUpdateFromClient = false 
)

Update a group or add it if it's not in here yet.

Parameters
groupThe group to update.
bUpdateFromClientTrue to save the changes in the db.
Returns
True if the group was added or update successfully, false otherwise.

§ Update() [2/2]

bool CPVRChannelGroups::Update ( bool  bChannelsOnly = false)

Update the contents of the groups in this container.

Parameters
bChannelsOnlySet to true to only update channels, not the groups themselves.
Returns
True if the update was successful, false otherwise.

§ UpdateFromClient()

bool PVR::CPVRChannelGroups::UpdateFromClient ( const CPVRChannelGroup group)
inline

Called by the add-on callback to add a new group.

Parameters
groupThe group to add
Returns
True when updated, false otherwise

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