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

#include <PVRChannel.h>

Inheritance diagram for PVR::CPVRChannel:
Observable ISerializable ISortable

Public Member Functions

 CPVRChannel (bool bRadio=false)
 Create a new channel. More...
 
 CPVRChannel (const PVR_CHANNEL &channel, unsigned int iClientId)
 
bool operator== (const CPVRChannel &right) const
 
bool operator!= (const CPVRChannel &right) const
 
void Serialize (CVariant &value) const override
 
XBMC related channel methods
bool Delete (void)
 Delete this channel from the database and delete the corresponding EPG table if it exists. More...
 
bool UpdateFromClient (const CPVRChannelPtr &channel)
 Update this channel tag with the data of the given channel tag. More...
 
bool Persist ()
 Persists the changes in the database. More...
 
int ChannelID (void) const
 
bool IsNew (void) const
 
bool SetChannelID (int iDatabaseId)
 Set the identifier for this channel. More...
 
void SetChannelNumber (const CPVRChannelNumber &channelNumber)
 Set the channel number for this channel. More...
 
const CPVRChannelNumberChannelNumber () const
 Get the channel number for this channel. More...
 
bool IsRadio (void) const
 
bool IsHidden (void) const
 
bool SetHidden (bool bIsHidden)
 Set to true to hide this channel. Set to false to unhide it. More...
 
bool IsLocked (void) const
 
bool SetLocked (bool bIsLocked)
 Set to true to lock this channel. Set to false to unlock it. More...
 
bool IsRecording (void) const
 
CPVRRecordingPtr GetRecording (void) const
 
bool HasRecording (void) const
 
std::string IconPath (void) const
 
bool IsUserSetIcon (void) const
 
bool IsIconExists (void) const
 
bool IsUserSetName (void) const
 
bool SetIconPath (const std::string &strIconPath, bool bIsUserSetIcon=false)
 Set the path to the icon for this channel. More...
 
std::string ChannelName (void) const
 
bool SetChannelName (const std::string &strChannelName, bool bIsUserSetName=false)
 Set the name for this channel used by XBMC. More...
 
time_t LastWatched () const
 
bool SetLastWatched (time_t iLastWatched)
 Last time channel has been watched. More...
 
bool IsEmpty () const
 True if this channel has no file or stream name. More...
 
bool IsChanged () const
 
void Persisted ()
 reset changed flag after persist More...
 
Client related channel methods
int UniqueID (void) const
 A unique identifier for this channel. More...
 
int ClientID (void) const
 
bool SetClientID (int iClientId)
 Set the identifier of the client that serves this channel. More...
 
const CPVRChannelNumberClientChannelNumber () const
 
std::string ClientChannelName (void) const
 
std::string InputFormat (void) const
 The stream input type. More...
 
std::string Path (void) const
 The path in the XBMC VFS to be used by PVRManager to open and read the stream. More...
 
void ToSortable (SortItem &sortable, Field field) const override
 
void UpdatePath (CPVRChannelGroupInternal *group)
 Update the path this channel got added to the internal group. More...
 
std::pair< int, int > StorageId (void) const
 
bool IsEncrypted (void) const
 Return true if this channel is encrypted. More...
 
int EncryptionSystem (void) const
 Return the encryption system ID for this channel. 0 for FTA. More...
 
std::string EncryptionName (void) const
 
- 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...
 

Friends

class CPVRDatabase
 

EPG methods

int EpgID (void) const
 
void SetEpgID (int iEpgId)
 Change the id of the epg that is linked to this channel. More...
 
bool CreateEPG (bool bForce)
 Create the EPG for this channel, if it does not yet exist. More...
 
CPVREpgPtr GetEPG (void) const
 Get the EPG table for this channel. More...
 
int GetEPG (CFileItemList &results) const
 Get the EPG table for this channel. More...
 
bool ClearEPG (void) const
 Clear the EPG for this channel. More...
 
CPVREpgInfoTagPtr GetEPGNow () const
 Get the EPG tag that is now active on this channel. More...
 
CPVREpgInfoTagPtr GetEPGPrevious () const
 Get the EPG tag that was previously active on this channel. More...
 
CPVREpgInfoTagPtr GetEPGNext () const
 Get the EPG tag that will be next active on this channel. More...
 
bool EPGEnabled (void) const
 
bool SetEPGEnabled (bool bEPGEnabled)
 Set to true if an EPG should be used for this channel. Set to false otherwise. More...
 
std::string EPGScraper (void) const
 Get the name of the scraper to be used for this channel. More...
 
bool SetEPGScraper (const std::string &strScraper)
 Set the name of the scraper to be used for this channel. More...
 
bool CanRecord (void) const
 
static std::string GetEncryptionName (int iCaid)
 

Additional Inherited Members

- Protected Member Functions inherited from Observable
void SendMessage (const ObservableMessage message)
 Send a message to all observer when m_bObservableChanged is true. More...
 
- Protected Member Functions inherited from ISerializable
 ~ISerializable ()=default
 
- Protected Member Functions inherited from ISortable
 ~ISortable ()=default
 
- Protected Attributes inherited from Observable
std::atomic< bool > m_bObservableChanged {false}
 
std::vector< Observer * > m_observers
 
CCriticalSection m_obsCritSection
 

Detailed Description

PVR Channel class

Constructor & Destructor Documentation

§ CPVRChannel() [1/2]

CPVRChannel::CPVRChannel ( bool  bRadio = false)
explicit

Create a new channel.

§ CPVRChannel() [2/2]

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

Member Function Documentation

§ CanRecord()

bool CPVRChannel::CanRecord ( void  ) const

§ ChannelID()

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

§ ChannelName()

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

§ ChannelNumber()

const CPVRChannelNumber & CPVRChannel::ChannelNumber ( ) const

Get the channel number for this channel.

Returns
The channel number.

§ ClearEPG()

bool CPVRChannel::ClearEPG ( void  ) const

Clear the EPG for this channel.

Returns
True if it was cleared, false if not.

§ ClientChannelName()

std::string CPVRChannel::ClientChannelName ( void  ) 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.

§ ClientID()

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

§ CreateEPG()

bool CPVRChannel::CreateEPG ( bool  bForce)

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

Parameters
bForceto create a new EPG, even if it already exists.
Returns
true if a new epg was created, false otherwise.

§ Delete()

bool CPVRChannel::Delete ( void  )

Delete this channel from the database and delete the corresponding EPG table if it exists.

Returns
True if it was deleted successfully, false otherwise.

§ EncryptionName()

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

§ EncryptionSystem()

int CPVRChannel::EncryptionSystem ( void  ) 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 ( void  ) const
Returns
Don't use an EPG for this channel if set to false.

§ EpgID()

int CPVRChannel::EpgID ( void  ) 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 ( void  ) 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.

§ GetEncryptionName()

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

§ GetEPG() [1/2]

CPVREpgPtr CPVRChannel::GetEPG ( void  ) const

Get the EPG table for this channel.

Returns
The EPG for this channel.

§ GetEPG() [2/2]

int CPVRChannel::GetEPG ( CFileItemList results) const

Get the EPG table for this channel.

Parameters
resultsThe file list to store the results in.
Returns
The number of tables that were added.

§ GetEPGNext()

CPVREpgInfoTagPtr 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()

CPVREpgInfoTagPtr 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()

CPVREpgInfoTagPtr 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 activ.

§ GetRecording()

CPVRRecordingPtr CPVRChannel::GetRecording ( void  ) const
Returns
If recording, gets the recording if the add-on provides the epg id in recordings

§ HasRecording()

bool CPVRChannel::HasRecording ( void  ) const
Returns
True if this channel has a corresponding recording, false otherwise

§ IconPath()

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

§ InputFormat()

std::string CPVRChannel::InputFormat ( void  ) const

The stream input type.

The stream input type If it is empty, ffmpeg will try to scan the stream to find the right input format. See "xbmc/cores/VideoPlayer/Codecs/ffmpeg/libavformat/allformats.c" for a list of the input formats.

Returns
The stream input type

§ IsChanged()

bool CPVRChannel::IsChanged ( ) const

§ IsEmpty()

bool CPVRChannel::IsEmpty ( ) const

True if this channel has no file or stream name.

Returns
True if this channel has no file or stream name

§ IsEncrypted()

bool CPVRChannel::IsEncrypted ( void  ) 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 ( void  ) const
Returns
True if this channel is hidden. False if not.

§ IsIconExists()

bool CPVRChannel::IsIconExists ( void  ) const
Returns
True if the channel icon path exists

§ IsLocked()

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

§ IsNew()

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

§ IsRadio()

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

§ IsRecording()

bool CPVRChannel::IsRecording ( void  ) const
Returns
True if a recording is currently running on this channel. False if not.

§ IsUserSetIcon()

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

§ IsUserSetName()

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

§ LastWatched()

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

§ operator!=()

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

§ operator==()

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

§ Path()

std::string CPVRChannel::Path ( void  ) const

The path in the XBMC VFS to be used by PVRManager to open and read the stream.

Returns
The path in the XBMC VFS to be used by PVRManager to open and read the stream.

§ 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

§ Serialize()

void CPVRChannel::Serialize ( CVariant value) const
overridevirtual

Implements ISerializable.

§ 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.

§ SetChannelNumber()

void CPVRChannel::SetChannelNumber ( const CPVRChannelNumber channelNumber)

Set the channel number for this channel.

Parameters
channelNumberThe new channel number

§ 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.

§ SetEpgID()

void CPVRChannel::SetEpgID ( int  iEpgId)

Change the id of the epg that is linked to this channel.

Parameters
iEpgIdThe new epg id

§ 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)

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.
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  iLastWatched)

Last time channel has been watched.

Parameters
iLastWatchedThe new value.
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.

§ StorageId()

std::pair<int, int> PVR::CPVRChannel::StorageId ( void  ) 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 ( void  ) 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.

§ UpdateFromClient()

bool CPVRChannel::UpdateFromClient ( const CPVRChannelPtr 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.

§ UpdatePath()

void CPVRChannel::UpdatePath ( CPVRChannelGroupInternal group)

Update the path this channel got added to the internal group.

Parameters
groupThe internal group that contains this channel

Friends And Related Function Documentation

§ CPVRDatabase

friend class CPVRDatabase
friend

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