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

#include <PVRChannel.h>

Inheritance diagram for PVR::CPVRChannel:
ISerializable ISortable

Public Member Functions

 CPVRChannel (bool bRadio)
 
 CPVRChannel (bool bRadio, const std::string &iconPath)
 
 CPVRChannel (const PVR_CHANNEL &channel, unsigned int iClientId)
 
virtual ~CPVRChannel ()
 
bool operator== (const CPVRChannel &right) const
 
bool operator!= (const CPVRChannel &right) const
 
void FillAddonData (PVR_CHANNEL &channel) const
 Copy over data to the given PVR_CHANNEL instance.
 
void Serialize (CVariant &value) const override
 
Kodi related channel methods
bool QueueDelete ()
 Delete this channel from the database.
 
bool UpdateFromClient (const std::shared_ptr< const CPVRChannel > &channel)
 Update this channel tag with the data of the given channel tag.
 
bool Persist ()
 Persists the changes in the database.
 
int ChannelID () const
 
bool IsNew () const
 
bool SetChannelID (int iDatabaseId)
 Set the identifier for this channel.
 
bool IsRadio () const
 
bool IsHidden () const
 
bool SetHidden (bool bIsHidden, bool bIsUserSetHidden=false)
 Set to true to hide this channel. Set to false to unhide it.
 
bool IsLocked () const
 
bool SetLocked (bool bIsLocked)
 Set to true to lock this channel. Set to false to unlock it.
 
std::shared_ptr< CPVRRadioRDSInfoTagGetRadioRDSInfoTag () const
 Obtain the Radio RDS data for this channel, if available.
 
void SetRadioRDSInfoTag (const std::shared_ptr< CPVRRadioRDSInfoTag > &tag)
 Set the Radio RDS data for the channel.
 
bool HasArchive () const
 
bool SetArchive (bool bHasArchive)
 Set the archive support flag for this channel.
 
std::string ClientIconPath () const
 
std::string IconPath () const
 
bool IsUserSetIcon () const
 
bool IsUserSetName () const
 
bool IsUserSetHidden () const
 
int LastWatchedGroupId () const
 
bool SetIconPath (const std::string &strIconPath, bool bIsUserSetIcon=false)
 Set the path to the icon for this channel.
 
std::string ChannelName () const
 
bool SetChannelName (const std::string &strChannelName, bool bIsUserSetName=false)
 Set the name for this channel used by XBMC.
 
time_t LastWatched () const
 
bool SetLastWatched (time_t lastWatched, int groupId)
 Set the last time the channel has been watched and the channel group used to watch.
 
bool IsChanged () const
 Check whether this channel has unpersisted data changes.
 
void Persisted ()
 reset changed flag after persist
 
Client related channel methods
int UniqueID () const
 A unique identifier for this channel.
 
int ClientID () const
 
bool SetClientID (int iClientId)
 Set the identifier of the client that serves this channel.
 
const CPVRChannelNumberClientChannelNumber () const
 
std::string ClientChannelName () const
 
std::string MimeType () const
 The stream input mime type.
 
void ToSortable (SortItem &sortable, Field field) const override
 
std::pair< int, intStorageId () const
 
bool IsEncrypted () const
 Return true if this channel is encrypted.
 
int EncryptionSystem () const
 Return the encryption system ID for this channel. 0 for FTA.
 
std::string EncryptionName () const
 

Static Public Attributes

static const std::string IMAGE_OWNER_PATTERN = "pvrchannel_{}"
 

Friends

class CPVRDatabase
 

EPG methods

int EpgID () const
 
bool CreateEPG ()
 Create the EPG for this channel, if it does not yet exist.
 
std::shared_ptr< CPVREpgGetEPG () const
 Get the EPG table for this channel.
 
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetEpgTags () const
 Get the EPG tags for this channel.
 
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetEPGTimeline (const CDateTime &timelineStart, const CDateTime &timelineEnd, const CDateTime &minEventEnd, const CDateTime &maxEventStart) const
 Get all EPG tags for the given time frame, including "gap" tags.
 
std::shared_ptr< CPVREpgInfoTagCreateEPGGapTag (const CDateTime &start, const CDateTime &end) const
 Create a "gap" EPG tag.
 
std::shared_ptr< CPVREpgInfoTagGetEPGNow () const
 Get the EPG tag that is now active on this channel.
 
std::shared_ptr< CPVREpgInfoTagGetEPGPrevious () const
 Get the EPG tag that was previously active on this channel.
 
std::shared_ptr< CPVREpgInfoTagGetEPGNext () const
 Get the EPG tag that will be next active on this channel.
 
bool EPGEnabled () const
 
bool SetEPGEnabled (bool bEPGEnabled)
 Set to true if an EPG should be used for this channel. Set to false otherwise.
 
std::string EPGScraper () const
 Get the name of the scraper to be used for this channel.
 
bool SetEPGScraper (const std::string &strScraper)
 Set the name of the scraper to be used for this channel.
 
bool CanRecord () const
 
int ClientOrder () const
 Get the client order for this channel.
 
int ClientProviderUid () const
 Get the client provider Uid for this channel.
 
void Notify (const PVREvent &event)
 CEventStream callback for PVR events.
 
void Lock ()
 Lock the instance. No other thread gets access to this channel until Unlock was called.
 
void Unlock ()
 Unlock the instance. Other threads may get access to this channel again.
 
std::shared_ptr< CPVRProviderGetDefaultProvider () const
 Get the default provider of this channel. The default provider represents the PVR add-on itself.
 
bool HasClientProvider () const
 Whether or not this channel has a provider set by the client.
 
std::shared_ptr< CPVRProviderGetProvider () const
 Get the provider of this channel. This may be the default provider or a custom provider set by the client. If HasClientProvider() returns true the provider will be custom from the client, otherwise the default provider.
 
static std::string GetEncryptionName (int iCaid)
 

Additional Inherited Members

- Protected Member Functions inherited from ISerializable
 ~ISerializable ()=default
 
- Protected Member Functions inherited from ISortable
 ~ISortable ()=default
 

Constructor & Destructor Documentation

◆ CPVRChannel() [1/3]

CPVRChannel::CPVRChannel ( bool bRadio)
explicit

◆ CPVRChannel() [2/3]

CPVRChannel::CPVRChannel ( bool bRadio,
const std::string & iconPath )

◆ CPVRChannel() [3/3]

CPVRChannel::CPVRChannel ( const PVR_CHANNEL & channel,
unsigned int iClientId )

◆ ~CPVRChannel()

CPVRChannel::~CPVRChannel ( )
virtual

Member Function Documentation

◆ CanRecord()

bool CPVRChannel::CanRecord ( ) const

◆ ChannelID()

int CPVRChannel::ChannelID ( ) const
Returns
The identifier given to this channel by the TV database.

◆ ChannelName()

std::string CPVRChannel::ChannelName ( ) const
Returns
The name for this channel used by XBMC.

◆ ClientChannelName()

std::string CPVRChannel::ClientChannelName ( ) const
Returns
The name of this channel on the client.

◆ ClientChannelNumber()

const CPVRChannelNumber & CPVRChannel::ClientChannelNumber ( ) const

Get the channel number on the client.

Returns
The channel number on the client.

◆ ClientIconPath()

std::string CPVRChannel::ClientIconPath ( ) const
Returns
The path to the icon for this channel as given by the client.

◆ ClientID()

int CPVRChannel::ClientID ( ) const
Returns
The identifier of the client that serves this channel.

◆ ClientOrder()

int PVR::CPVRChannel::ClientOrder ( ) const
inline

Get the client order for this channel.

Returns
iOrder The order for this channel

◆ ClientProviderUid()

int PVR::CPVRChannel::ClientProviderUid ( ) const
inline

Get the client provider Uid for this channel.

Returns
m_iClientProviderUid The provider Uid for this channel

◆ CreateEPG()

bool CPVRChannel::CreateEPG ( )

Create the EPG for this channel, if it does not yet exist.

Returns
true if a new epg was created, false otherwise.

◆ CreateEPGGapTag()

std::shared_ptr< CPVREpgInfoTag > CPVRChannel::CreateEPGGapTag ( const CDateTime & start,
const CDateTime & end ) const

Create a "gap" EPG tag.

Parameters
startStart of gap.
endEnd of gap.
Returns
The tag.

◆ EncryptionName()

std::string CPVRChannel::EncryptionName ( ) const
Returns
A friendly name for the used encryption system.

◆ EncryptionSystem()

int CPVRChannel::EncryptionSystem ( ) const

Return the encryption system ID for this channel. 0 for FTA.

Return the encryption system ID for this channel. 0 for FTA. The values are documented on: http://www.dvb.org/index.php?id=174.

Returns
Return the encryption system ID for this channel.

◆ EPGEnabled()

bool CPVRChannel::EPGEnabled ( ) const
Returns
Don't use an EPG for this channel if set to false.

◆ EpgID()

int CPVRChannel::EpgID ( ) const
Returns
The ID of the EPG table to use for this channel or -1 if it isn't set.

◆ EPGScraper()

std::string CPVRChannel::EPGScraper ( ) const

Get the name of the scraper to be used for this channel.

Get the name of the scraper to be used for this channel. The default is 'client', which means the EPG should be loaded from the backend.

Returns
The name of the scraper to be used for this channel.

◆ FillAddonData()

void CPVRChannel::FillAddonData ( PVR_CHANNEL & channel) const

Copy over data to the given PVR_CHANNEL instance.

Parameters
channelThe channel instance to fill.

◆ GetDefaultProvider()

std::shared_ptr< CPVRProvider > CPVRChannel::GetDefaultProvider ( ) const

Get the default provider of this channel. The default provider represents the PVR add-on itself.

Returns
The default provider of this channel

◆ GetEncryptionName()

std::string CPVRChannel::GetEncryptionName ( int iCaid)
static

◆ GetEPG()

std::shared_ptr< CPVREpg > CPVRChannel::GetEPG ( ) const

Get the EPG table for this channel.

Returns
The EPG for this channel.

◆ GetEPGNext()

std::shared_ptr< CPVREpgInfoTag > CPVRChannel::GetEPGNext ( ) const

Get the EPG tag that will be next active on this channel.

Get the EPG tag that will be next active on this channel. Will return an empty tag if there is none.

Returns
The EPG tag that will be next active.

◆ GetEPGNow()

std::shared_ptr< CPVREpgInfoTag > CPVRChannel::GetEPGNow ( ) const

Get the EPG tag that is now active on this channel.

Get the EPG tag that is now active on this channel. Will return an empty tag if there is none.

Returns
The EPG tag that is now active.

◆ GetEPGPrevious()

std::shared_ptr< CPVREpgInfoTag > CPVRChannel::GetEPGPrevious ( ) const

Get the EPG tag that was previously active on this channel.

Get the EPG tag that was previously active on this channel. Will return an empty tag if there is none.

Returns
The EPG tag that was previously active.

◆ GetEpgTags()

std::vector< std::shared_ptr< CPVREpgInfoTag > > CPVRChannel::GetEpgTags ( ) const

Get the EPG tags for this channel.

Returns
The tags.

◆ GetEPGTimeline()

std::vector< std::shared_ptr< CPVREpgInfoTag > > CPVRChannel::GetEPGTimeline ( const CDateTime & timelineStart,
const CDateTime & timelineEnd,
const CDateTime & minEventEnd,
const CDateTime & maxEventStart ) const

Get all EPG tags for the given time frame, including "gap" tags.

Parameters
timelineStartStart of time line.
timelineEndEnd of time line.
minEventEndThe minimum end time of the events to return.
maxEventStartThe maximum start time of the events to return.
Returns
The matching tags.

◆ GetProvider()

std::shared_ptr< CPVRProvider > CPVRChannel::GetProvider ( ) const

Get the provider of this channel. This may be the default provider or a custom provider set by the client. If HasClientProvider() returns true the provider will be custom from the client, otherwise the default provider.

Returns
The provider of this channel

◆ GetRadioRDSInfoTag()

std::shared_ptr< CPVRRadioRDSInfoTag > CPVRChannel::GetRadioRDSInfoTag ( ) const

Obtain the Radio RDS data for this channel, if available.

Returns
The Radio RDS data or nullptr.

◆ HasArchive()

bool CPVRChannel::HasArchive ( ) const
Returns
True if this channel has archive support, false otherwise

◆ HasClientProvider()

bool CPVRChannel::HasClientProvider ( ) const

Whether or not this channel has a provider set by the client.

Returns
True if a provider was set by the client, false otherwise.

◆ IconPath()

std::string CPVRChannel::IconPath ( ) const
Returns
The path to the icon for this channel.

◆ IsChanged()

bool CPVRChannel::IsChanged ( ) const

Check whether this channel has unpersisted data changes.

Returns
True if this channel has changes to persist, false otherwise

◆ IsEncrypted()

bool CPVRChannel::IsEncrypted ( ) const

Return true if this channel is encrypted.

Return true if this channel is encrypted. Does not inform whether XBMC can play the file. Decryption should be done by the client.

Returns
Return true if this channel is encrypted.

◆ IsHidden()

bool CPVRChannel::IsHidden ( ) const
Returns
True if this channel is hidden. False if not.

◆ IsLocked()

bool CPVRChannel::IsLocked ( ) const
Returns
True if this channel is locked. False if not.

◆ IsNew()

bool CPVRChannel::IsNew ( ) const
Returns
True when not persisted yet, false otherwise.

◆ IsRadio()

bool PVR::CPVRChannel::IsRadio ( ) const
inline
Returns
True if this channel is a radio channel, false if not.

◆ IsUserSetHidden()

bool CPVRChannel::IsUserSetHidden ( ) const
Returns
True if user changed the hidden flag via GUI, False if not

◆ IsUserSetIcon()

bool CPVRChannel::IsUserSetIcon ( ) const
Returns
True if this user changed icon via GUI. False if not.

◆ IsUserSetName()

bool CPVRChannel::IsUserSetName ( ) const
Returns
whether the user has changed the channel name through the GUI

◆ LastWatched()

time_t CPVRChannel::LastWatched ( ) const
Returns
Time channel has been watched last.

◆ LastWatchedGroupId()

int CPVRChannel::LastWatchedGroupId ( ) const
Returns
the id of the channel group the channel was watched from the last time; -1 if unknown.

◆ Lock()

void PVR::CPVRChannel::Lock ( )
inline

Lock the instance. No other thread gets access to this channel until Unlock was called.

◆ MimeType()

std::string CPVRChannel::MimeType ( ) const

The stream input mime type.

The stream input type If it is empty, ffmpeg will try to scan the stream to find the right input format. See https://www.iana.org/assignments/media-types/media-types.xhtml for a list of the input formats.

Returns
The stream input type

◆ Notify()

void CPVRChannel::Notify ( const PVREvent & event)

CEventStream callback for PVR events.

Parameters
eventThe event.

◆ operator!=()

bool CPVRChannel::operator!= ( const CPVRChannel & right) const

◆ operator==()

bool CPVRChannel::operator== ( const CPVRChannel & right) const

◆ Persist()

bool CPVRChannel::Persist ( )

Persists the changes in the database.

Returns
True if the changes were saved successfully, false otherwise.

◆ Persisted()

void CPVRChannel::Persisted ( )

reset changed flag after persist

◆ QueueDelete()

bool CPVRChannel::QueueDelete ( )

Delete this channel from the database.

Returns
True if it was deleted successfully, false otherwise.

◆ Serialize()

void CPVRChannel::Serialize ( CVariant & value) const
overridevirtual

Implements ISerializable.

◆ SetArchive()

bool CPVRChannel::SetArchive ( bool bHasArchive)

Set the archive support flag for this channel.

Parameters
bHasArchiveTrue to set the flag, false to reset.
Returns
True if the flag was changed, false otherwise.

◆ SetChannelID()

bool CPVRChannel::SetChannelID ( int iDatabaseId)

Set the identifier for this channel.

Parameters
iDatabaseIdThe new channel ID
Returns
True if the something changed, false otherwise.

◆ SetChannelName()

bool CPVRChannel::SetChannelName ( const std::string & strChannelName,
bool bIsUserSetName = false )

Set the name for this channel used by XBMC.

Parameters
strChannelNameThe new channel name.
bIsUserSetNamewhether the change was triggered by the user directly
Returns
True if the something changed, false otherwise.

◆ SetClientID()

bool CPVRChannel::SetClientID ( int iClientId)

Set the identifier of the client that serves this channel.

Parameters
iClientIdThe new ID.
Returns
True if the something changed, false otherwise.

◆ SetEPGEnabled()

bool CPVRChannel::SetEPGEnabled ( bool bEPGEnabled)

Set to true if an EPG should be used for this channel. Set to false otherwise.

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

◆ SetEPGScraper()

bool CPVRChannel::SetEPGScraper ( const std::string & strScraper)

Set the name of the scraper to be used for this channel.

Set the name of the scraper to be used for this channel. Set to "client" to load the EPG from the backend

Parameters
strScraperThe new scraper name.
Returns
True if the something changed, false otherwise.

◆ SetHidden()

bool CPVRChannel::SetHidden ( bool bIsHidden,
bool bIsUserSetHidden = false )

Set to true to hide this channel. Set to false to unhide it.

Set to true to hide this channel. Set to false to unhide it. The EPG of hidden channels won't be updated.

Parameters
bIsHiddenThe new setting.
bIsUserSetIcontrue if user changed the hidden flag via GUI, false otherwise.
Returns
True if the something changed, false otherwise.

◆ SetIconPath()

bool CPVRChannel::SetIconPath ( const std::string & strIconPath,
bool bIsUserSetIcon = false )

Set the path to the icon for this channel.

Parameters
strIconPathThe new path.
bIsUserSetIcontrue if user changed the icon via GUI, false otherwise.
Returns
True if the something changed, false otherwise.

◆ SetLastWatched()

bool CPVRChannel::SetLastWatched ( time_t lastWatched,
int groupId )

Set the last time the channel has been watched and the channel group used to watch.

Parameters
lastWatchedThe new last watched time value.
groupIdthe id of the group used to watch the channel.
Returns
True if the something changed, false otherwise.

◆ SetLocked()

bool CPVRChannel::SetLocked ( bool bIsLocked)

Set to true to lock this channel. Set to false to unlock it.

Set to true to lock this channel. Set to false to unlock it. Locked channels need can only be viewed if parental PIN entered.

Parameters
bIsLockedThe new setting.
Returns
True if the something changed, false otherwise.

◆ SetRadioRDSInfoTag()

void CPVRChannel::SetRadioRDSInfoTag ( const std::shared_ptr< CPVRRadioRDSInfoTag > & tag)

Set the Radio RDS data for the channel.

Parameters
tagThe RDS data.

◆ StorageId()

std::pair< int, int > PVR::CPVRChannel::StorageId ( ) const
inline
Returns
Storage id for this channel in CPVRChannelGroup

◆ ToSortable()

void CPVRChannel::ToSortable ( SortItem & sortable,
Field field ) const
overridevirtual

Implements ISortable.

◆ UniqueID()

int CPVRChannel::UniqueID ( ) const

A unique identifier for this channel.

A unique identifier for this channel. It can be used to find the same channel on different providers

Returns
The Unique ID.

◆ Unlock()

void PVR::CPVRChannel::Unlock ( )
inline

Unlock the instance. Other threads may get access to this channel again.

◆ UpdateFromClient()

bool CPVRChannel::UpdateFromClient ( const std::shared_ptr< const CPVRChannel > & channel)

Update this channel tag with the data of the given channel tag.

Parameters
channelThe new channel data.
Returns
True if something changed, false otherwise.

Friends And Related Symbol Documentation

◆ CPVRDatabase

friend class CPVRDatabase
friend

Member Data Documentation

◆ IMAGE_OWNER_PATTERN

const std::string CPVRChannel::IMAGE_OWNER_PATTERN = "pvrchannel_{}"
static

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