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

#include <PVRManager.h>

Inheritance diagram for PVR::CPVRManager:
CThread Observable ANNOUNCEMENT::IAnnouncer

Public Member Functions

 CPVRManager (void)
 Create a new CPVRManager instance, which handles all PVR related operations in XBMC. More...
 
 ~CPVRManager (void) override
 Stop the PVRManager and destroy all objects it created. More...
 
void Announce (ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) override
 
CPVRChannelGroupsContainerPtr ChannelGroups (void) const
 Get the channel groups container. More...
 
CPVRRecordingsPtr Recordings (void) const
 Get the recordings container. More...
 
CPVRTimersPtr Timers (void) const
 Get the timers container. More...
 
CPVRClientsPtr Clients (void) const
 Get the timers container. More...
 
std::shared_ptr< CPVRClientGetClient (const CFileItem &item) const
 Get the instance of a client that matches the given item. More...
 
std::shared_ptr< CPVRClientGetClient (int iClientId) const
 Get the instance of a client that matches the given id. More...
 
CPVRGUIActionsPtr GUIActions (void) const
 Get access to the pvr gui actions. More...
 
CPVREpgContainerEpgContainer ()
 Get access to the epg container. More...
 
void Init (void)
 Init PVRManager. More...
 
void Start ()
 Start the PVRManager, which loads all PVR data and starts some threads to update the PVR data. More...
 
void Stop (void)
 Stop PVRManager. More...
 
void Unload ()
 Stop PVRManager, unload data. More...
 
void Deinit ()
 Deinit PVRManager, unload data, unload addons. More...
 
void OnSleep ()
 Propagate event on system sleep. More...
 
void OnWake ()
 Propagate event on system wake. More...
 
CPVRDatabasePtr GetTVDatabase (void) const
 Get the TV database. More...
 
bool IsPlaying (void) const
 Check if a TV channel, radio channel or recording is playing. More...
 
bool IsPlayingChannel (const CPVRChannelPtr &channel) const
 Check if the given channel is playing. More...
 
bool IsPlayingRecording (const CPVRRecordingPtr &recording) const
 Check if the given recording is playing. More...
 
bool IsPlayingEpgTag (const CPVREpgInfoTagPtr &epgTag) const
 Check if the given epg tag is playing. More...
 
bool IsInitialising (void) const
 
bool IsStarted (void) const
 Check whether the PVRManager has fully started. More...
 
bool IsStopping (void) const
 Check whether the PVRManager is stopping. More...
 
bool IsStopped (void) const
 Check whether the PVRManager has been stopped. More...
 
CPVRChannelPtr GetPlayingChannel (void) const
 Return the channel that is currently playing. More...
 
CPVRRecordingPtr GetPlayingRecording (void) const
 Return the recording that is currently playing. More...
 
CPVREpgInfoTagPtr GetPlayingEpgTag (void) const
 Return the epg tag that is currently playing. More...
 
std::string GetPlayingClientName (void) const
 Get the name of the playing client, if there is one. More...
 
int GetPlayingClientID (void) const
 Get the ID of the playing client, if there is one. More...
 
bool IsRecordingOnPlayingChannel (void) const
 Check whether there is an active recording on the currenlyt playing channel. More...
 
bool CanRecordOnPlayingChannel (void) const
 Check whether the currently playing channel can be recorded. More...
 
bool EpgsCreated (void) const
 Check whether EPG tags for channels have been created. More...
 
void OnPlaybackStarted (const CFileItemPtr item)
 Inform PVR manager that playback of an item just started. More...
 
void OnPlaybackStopped (const CFileItemPtr item)
 Inform PVR manager that playback of an item was stopped due to user interaction. More...
 
void OnPlaybackEnded (const CFileItemPtr item)
 Inform PVR manager that playback of an item has stopped without user interaction. More...
 
bool IsRecording (void) const
 Check whether there are active recordings. More...
 
void SetPlayingGroup (const CPVRChannelGroupPtr &group)
 Set the current playing group, used to load the right channel. More...
 
CPVRChannelGroupPtr GetPlayingGroup (bool bRadio=false) const
 Get the current playing group, used to load the right channel. More...
 
bool FillStreamFileItem (CFileItem &fileItem)
 Fill the file item for a recording, a channel or an epg tag with the properties required for playback. Values are obtained from the PVR backend. More...
 
void TriggerEpgsCreate (void)
 Let the background thread create epg tags for all channels. More...
 
void TriggerRecordingsUpdate (void)
 Let the background thread update the recordings list. More...
 
void TriggerTimersUpdate (void)
 Let the background thread update the timer list. More...
 
void TriggerChannelsUpdate (void)
 Let the background thread update the channel list. More...
 
void TriggerChannelGroupsUpdate (void)
 Let the background thread update the channel groups list. More...
 
void TriggerSearchMissingChannelIcons (void)
 Let the background thread search for missing channel icons. More...
 
void LocalizationChanged (void)
 Check whether names are still correct after the language settings changed. More...
 
bool IsPlayingTV (void) const
 Check if a TV channel is playing. More...
 
bool IsPlayingRadio (void) const
 Check if a radio channel is playing. More...
 
bool IsPlayingEncryptedChannel (void) const
 Check if a an encrypted TV or radio channel is playing. More...
 
bool IsPlayingRecording (void) const
 Check if a recording is playing. More...
 
bool IsPlayingEpgTag (void) const
 Check if an epg tag is playing. More...
 
void SearchMissingChannelIcons (void)
 Try to find missing channel icons automatically. More...
 
bool IsParentalLocked (const CPVRChannelPtr &channel)
 Check if parental lock is overridden at the given moment. More...
 
void RestartParentalTimer ()
 Restart the parental timer. More...
 
bool CreateChannelEpgs (void)
 Create EPG tags for all channels in internal channel groups. More...
 
void ConnectionStateChange (CPVRClient *client, std::string connectString, PVR_CONNECTION_STATE state, std::string message)
 Signal a connection change of a client. More...
 
CEventStream< PVREvent > & Events ()
 Query the events available for CEventStream. More...
 
void PublishEvent (PVREvent state)
 Publish an event. 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 ANNOUNCEMENT::IAnnouncer
 IAnnouncer ()=default
 
virtual ~IAnnouncer ()=default
 

Protected Member Functions

void Process (void) override
 PVR update and control thread. More...
 
- Protected Member Functions inherited from Observable
void SendMessage (const ObservableMessage message)
 Send a message to all observer when m_bObservableChanged is true. More...
 

Additional Inherited Members

- Protected Attributes inherited from Observable
std::atomic< bool > m_bObservableChanged {false}
 
std::vector< Observer * > m_observers
 
CCriticalSection m_obsCritSection
 

Constructor & Destructor Documentation

§ CPVRManager()

CPVRManager::CPVRManager ( void  )

Create a new CPVRManager instance, which handles all PVR related operations in XBMC.

§ ~CPVRManager()

CPVRManager::~CPVRManager ( void  )
override

Stop the PVRManager and destroy all objects it created.

Member Function Documentation

§ Announce()

void CPVRManager::Announce ( ANNOUNCEMENT::AnnouncementFlag  flag,
const char *  sender,
const char *  message,
const CVariant data 
)
overridevirtual

§ CanRecordOnPlayingChannel()

bool CPVRManager::CanRecordOnPlayingChannel ( void  ) const

Check whether the currently playing channel can be recorded.

Returns
True if there is a playing channel that can be recorded, false otherwise.

§ ChannelGroups()

CPVRChannelGroupsContainerPtr CPVRManager::ChannelGroups ( void  ) const

Get the channel groups container.

Returns
The groups container.

§ Clients()

CPVRClientsPtr CPVRManager::Clients ( void  ) const

Get the timers container.

Returns
The timers container.

§ ConnectionStateChange()

void CPVRManager::ConnectionStateChange ( CPVRClient client,
std::string  connectString,
PVR_CONNECTION_STATE  state,
std::string  message 
)

Signal a connection change of a client.

§ CreateChannelEpgs()

bool CPVRManager::CreateChannelEpgs ( void  )

Create EPG tags for all channels in internal channel groups.

Returns
True if EPG tags where created successfully, false otherwise

§ Deinit()

void CPVRManager::Deinit ( )

Deinit PVRManager, unload data, unload addons.

§ EpgContainer()

CPVREpgContainer & CPVRManager::EpgContainer ( )

Get access to the epg container.

Returns
The epg container.

§ EpgsCreated()

bool CPVRManager::EpgsCreated ( void  ) const

Check whether EPG tags for channels have been created.

Returns
True if EPG tags have been created, false otherwise.

§ Events()

CEventStream<PVREvent>& PVR::CPVRManager::Events ( )
inline

Query the events available for CEventStream.

§ FillStreamFileItem()

bool CPVRManager::FillStreamFileItem ( CFileItem fileItem)

Fill the file item for a recording, a channel or an epg tag with the properties required for playback. Values are obtained from the PVR backend.

Parameters
fileItemThe file item to be filled. Item must contain either a pvr recording, a pvr channel or an epg tag.
Returns
True if the stream properties have been set, false otherwiese.

§ GetClient() [1/2]

CPVRClientPtr CPVRManager::GetClient ( const CFileItem item) const

Get the instance of a client that matches the given item.

Parameters
itemThe item containing a PVR recording, a PVR channel, a PVR timer or a PVR EPG event.
Returns
the requested client on success, nullptr otherwise.

§ GetClient() [2/2]

CPVRClientPtr CPVRManager::GetClient ( int  iClientId) const

Get the instance of a client that matches the given id.

Parameters
iClientIdThe id of a PVR client.
Returns
the requested client on success, nullptr otherwise.

§ GetPlayingChannel()

CPVRChannelPtr CPVRManager::GetPlayingChannel ( void  ) const

Return the channel that is currently playing.

Returns
The channel or NULL if none is playing.

§ GetPlayingClientID()

int CPVRManager::GetPlayingClientID ( void  ) const

Get the ID of the playing client, if there is one.

Returns
The ID or -1 if no client is playing.

§ GetPlayingClientName()

std::string CPVRManager::GetPlayingClientName ( void  ) const

Get the name of the playing client, if there is one.

Returns
The name of the client or an empty string if nothing is playing.

§ GetPlayingEpgTag()

CPVREpgInfoTagPtr CPVRManager::GetPlayingEpgTag ( void  ) const

Return the epg tag that is currently playing.

Returns
The tag or NULL if none is playing.

§ GetPlayingGroup()

CPVRChannelGroupPtr CPVRManager::GetPlayingGroup ( bool  bRadio = false) const

Get the current playing group, used to load the right channel.

Parameters
bRadioTrue to get the current radio group, false to get the current TV group.
Returns
The current group or the group containing all channels if it's not set.

§ GetPlayingRecording()

CPVRRecordingPtr CPVRManager::GetPlayingRecording ( void  ) const

Return the recording that is currently playing.

Returns
The recording or NULL if none is playing.

§ GetTVDatabase()

CPVRDatabasePtr CPVRManager::GetTVDatabase ( void  ) const

Get the TV database.

Returns
The TV database.

§ GUIActions()

CPVRGUIActionsPtr CPVRManager::GUIActions ( void  ) const

Get access to the pvr gui actions.

Returns
The gui actions.

§ Init()

void CPVRManager::Init ( void  )

Init PVRManager.

§ IsInitialising()

bool PVR::CPVRManager::IsInitialising ( void  ) const
inline
Returns
True while the PVRManager is initialising.

§ IsParentalLocked()

bool CPVRManager::IsParentalLocked ( const CPVRChannelPtr channel)

Check if parental lock is overridden at the given moment.

Parameters
channelThe channel to open.
Returns
True if parental lock is overridden, false otherwise.

§ IsPlaying()

bool CPVRManager::IsPlaying ( void  ) const

Check if a TV channel, radio channel or recording is playing.

Returns
True if it's playing, false otherwise.

§ IsPlayingChannel()

bool CPVRManager::IsPlayingChannel ( const CPVRChannelPtr channel) const

Check if the given channel is playing.

Parameters
channelThe channel to check.
Returns
True if it's playing, false otherwise.

§ IsPlayingEncryptedChannel()

bool CPVRManager::IsPlayingEncryptedChannel ( void  ) const

Check if a an encrypted TV or radio channel is playing.

Returns
True if it's playing, false otherwise.

§ IsPlayingEpgTag() [1/2]

bool CPVRManager::IsPlayingEpgTag ( const CPVREpgInfoTagPtr epgTag) const

Check if the given epg tag is playing.

Parameters
epgTagThe tag to check.
Returns
True if it's playing, false otherwise.

§ IsPlayingEpgTag() [2/2]

bool CPVRManager::IsPlayingEpgTag ( void  ) const

Check if an epg tag is playing.

Returns
True if it's playing, false otherwise.

§ IsPlayingRadio()

bool CPVRManager::IsPlayingRadio ( void  ) const

Check if a radio channel is playing.

Returns
True if it's playing, false otherwise.

§ IsPlayingRecording() [1/2]

bool CPVRManager::IsPlayingRecording ( const CPVRRecordingPtr recording) const

Check if the given recording is playing.

Parameters
recordingThe recording to check.
Returns
True if it's playing, false otherwise.

§ IsPlayingRecording() [2/2]

bool CPVRManager::IsPlayingRecording ( void  ) const

Check if a recording is playing.

Returns
True if it's playing, false otherwise.

§ IsPlayingTV()

bool CPVRManager::IsPlayingTV ( void  ) const

Check if a TV channel is playing.

Returns
True if it's playing, false otherwise.

§ IsRecording()

bool CPVRManager::IsRecording ( void  ) const

Check whether there are active recordings.

Returns
True if there are active recordings, false otherwise.

§ IsRecordingOnPlayingChannel()

bool CPVRManager::IsRecordingOnPlayingChannel ( void  ) const

Check whether there is an active recording on the currenlyt playing channel.

Returns
True if there is a playing channel and there is an active recording on that channel, false otherwise.

§ IsStarted()

bool PVR::CPVRManager::IsStarted ( void  ) const
inline

Check whether the PVRManager has fully started.

Returns
True if started, false otherwise.

§ IsStopped()

bool PVR::CPVRManager::IsStopped ( void  ) const
inline

Check whether the PVRManager has been stopped.

Returns
True if stopped, false otherwise.

§ IsStopping()

bool PVR::CPVRManager::IsStopping ( void  ) const
inline

Check whether the PVRManager is stopping.

Returns
True while the PVRManager is stopping.

§ LocalizationChanged()

void CPVRManager::LocalizationChanged ( void  )

Check whether names are still correct after the language settings changed.

§ OnPlaybackEnded()

void CPVRManager::OnPlaybackEnded ( const CFileItemPtr  item)

Inform PVR manager that playback of an item has stopped without user interaction.

Parameters
itemThe item that ended to play.

§ OnPlaybackStarted()

void CPVRManager::OnPlaybackStarted ( const CFileItemPtr  item)

Inform PVR manager that playback of an item just started.

Parameters
itemThe item that started to play.

§ OnPlaybackStopped()

void CPVRManager::OnPlaybackStopped ( const CFileItemPtr  item)

Inform PVR manager that playback of an item was stopped due to user interaction.

Parameters
itemThe item that stopped to play.

§ OnSleep()

void CPVRManager::OnSleep ( )

Propagate event on system sleep.

§ OnWake()

void CPVRManager::OnWake ( )

Propagate event on system wake.

§ Process()

void CPVRManager::Process ( void  )
overrideprotectedvirtual

PVR update and control thread.

Reimplemented from CThread.

§ PublishEvent()

void CPVRManager::PublishEvent ( PVREvent  state)

Publish an event.

Parameters
statethe event

§ Recordings()

CPVRRecordingsPtr CPVRManager::Recordings ( void  ) const

Get the recordings container.

Returns
The recordings container.

§ RestartParentalTimer()

void CPVRManager::RestartParentalTimer ( )

Restart the parental timer.

§ SearchMissingChannelIcons()

void CPVRManager::SearchMissingChannelIcons ( void  )

Try to find missing channel icons automatically.

§ SetPlayingGroup()

void CPVRManager::SetPlayingGroup ( const CPVRChannelGroupPtr group)

Set the current playing group, used to load the right channel.

Parameters
groupThe new group.

§ Start()

void CPVRManager::Start ( void  )

Start the PVRManager, which loads all PVR data and starts some threads to update the PVR data.

§ Stop()

void CPVRManager::Stop ( void  )

Stop PVRManager.

§ Timers()

CPVRTimersPtr CPVRManager::Timers ( void  ) const

Get the timers container.

Returns
The timers container.

§ TriggerChannelGroupsUpdate()

void CPVRManager::TriggerChannelGroupsUpdate ( void  )

Let the background thread update the channel groups list.

§ TriggerChannelsUpdate()

void CPVRManager::TriggerChannelsUpdate ( void  )

Let the background thread update the channel list.

§ TriggerEpgsCreate()

void CPVRManager::TriggerEpgsCreate ( void  )

Let the background thread create epg tags for all channels.

§ TriggerRecordingsUpdate()

void CPVRManager::TriggerRecordingsUpdate ( void  )

Let the background thread update the recordings list.

§ TriggerSearchMissingChannelIcons()

void CPVRManager::TriggerSearchMissingChannelIcons ( void  )

Let the background thread search for missing channel icons.

§ TriggerTimersUpdate()

void CPVRManager::TriggerTimersUpdate ( void  )

Let the background thread update the timer list.

§ Unload()

void CPVRManager::Unload ( )

Stop PVRManager, unload data.


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