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

#include <EpgContainer.h>

Inheritance diagram for PVR::CPVREpgContainer:
Observer Observable CThread

Public Member Functions

 CPVREpgContainer (void)
 Create a new EPG table container. More...
 
 ~CPVREpgContainer (void) override
 Destroy this instance. More...
 
CPVREpgDatabasePtr GetEpgDatabase () const
 Get a pointer to the database instance. More...
 
void Start (bool bAsync)
 Start the EPG update thread. More...
 
void Stop (void)
 Stop the EPG update thread. More...
 
void Clear ()
 Clear all EPG entries. More...
 
bool IsStarted (void) const
 Check whether the EpgContainer has fully started. More...
 
bool DeleteEpg (const CPVREpgPtr &epg, bool bDeleteFromDatabase=false)
 Delete an EPG table from this container. More...
 
void Notify (const Observable &obs, const ObservableMessage msg) override
 Process a notification from an observable. More...
 
CPVREpgPtr CreateChannelEpg (const CPVRChannelPtr &channel)
 Create the EPg for a given channel. More...
 
int GetEPGSearch (CFileItemList &results, const CPVREpgSearchFilter &filter)
 Get all EPG tables and apply a filter. More...
 
const CDateTime GetFirstEPGDate (void)
 Get the start time of the first entry. More...
 
const CDateTime GetLastEPGDate (void)
 Get the end time of the last entry. More...
 
CPVREpgPtr GetById (int iEpgId) const
 Get an EPG table given it's ID. More...
 
CPVREpgInfoTagPtr GetTagById (const CPVRChannelPtr &channel, unsigned int iBroadcastId) const
 Get the EPG event with the given event id. More...
 
std::vector< CPVREpgInfoTagPtrGetEpgTagsForTimer (const CPVRTimerInfoTagPtr &timer) const
 Get the EPG events matching the given timer. More...
 
bool IgnoreDB () const
 Check whether data should be persisted to the EPG database. More...
 
void SetHasPendingUpdates (bool bHasPendingUpdates=true)
 Notify EPG container that there are pending manual EPG updates. More...
 
void UpdateRequest (int iClientID, unsigned int iUniqueChannelID)
 A client triggered an epg update request for a channel. More...
 
void UpdateFromClient (const CPVREpgInfoTagPtr &tag, EPG_EVENT_STATE eNewState)
 A client announced an updated epg tag for a channel. More...
 
int GetPastDaysToDisplay () const
 Get the number of past days to show in the guide and to import from backends. More...
 
int GetFutureDaysToDisplay () const
 Get the number of future days to show in the guide and to import from backends. More...
 
void OnPlaybackStarted (const CFileItemPtr &item)
 Inform the epg container that playback of an item just started. More...
 
void OnPlaybackStopped (const CFileItemPtr &item)
 Inform the epg container that playback of an item was stopped due to user interaction. More...
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
virtual ~Observer ()=default
 
- 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 CPVREpgDatabase
 

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 Attributes inherited from Observable
std::atomic< bool > m_bObservableChanged {false}
 
std::vector< Observer * > m_observers
 
CCriticalSection m_obsCritSection
 

Constructor & Destructor Documentation

§ CPVREpgContainer()

PVR::CPVREpgContainer::CPVREpgContainer ( void  )

Create a new EPG table container.

§ ~CPVREpgContainer()

PVR::CPVREpgContainer::~CPVREpgContainer ( void  )
override

Destroy this instance.

Member Function Documentation

§ Clear()

void PVR::CPVREpgContainer::Clear ( )

Clear all EPG entries.

§ CreateChannelEpg()

CPVREpgPtr PVR::CPVREpgContainer::CreateChannelEpg ( const CPVRChannelPtr channel)

Create the EPg for a given channel.

Parameters
channelThe channel.
Returns
the created EPG

§ DeleteEpg()

bool PVR::CPVREpgContainer::DeleteEpg ( const CPVREpgPtr epg,
bool  bDeleteFromDatabase = false 
)

Delete an EPG table from this container.

Parameters
epgThe table to delete.
bDeleteFromDatabaseDelete this table from the database too if true.
Returns
True on success, false otherwise.

§ GetById()

CPVREpgPtr PVR::CPVREpgContainer::GetById ( int  iEpgId) const

Get an EPG table given it's ID.

Parameters
iEpgIdThe database ID of the table.
Returns
The table or NULL if it wasn't found.

§ GetEpgDatabase()

CPVREpgDatabasePtr PVR::CPVREpgContainer::GetEpgDatabase ( ) const

Get a pointer to the database instance.

Returns
A pointer to the database instance.

§ GetEPGSearch()

int PVR::CPVREpgContainer::GetEPGSearch ( CFileItemList results,
const CPVREpgSearchFilter filter 
)

Get all EPG tables and apply a filter.

Parameters
resultsThe fileitem list to store the results in.
filterThe filter to apply.
Returns
The amount of entries that were added.

§ GetEpgTagsForTimer()

std::vector< CPVREpgInfoTagPtr > PVR::CPVREpgContainer::GetEpgTagsForTimer ( const CPVRTimerInfoTagPtr timer) const

Get the EPG events matching the given timer.

Parameters
timerThe timer to get the matching events for.
Returns
The matching events, or an empty vector when no matching tag was found

§ GetFirstEPGDate()

const CDateTime PVR::CPVREpgContainer::GetFirstEPGDate ( void  )

Get the start time of the first entry.

Returns
The start time.

§ GetFutureDaysToDisplay()

int PVR::CPVREpgContainer::GetFutureDaysToDisplay ( ) const

Get the number of future days to show in the guide and to import from backends.

Returns
the number of future epg days.

§ GetLastEPGDate()

const CDateTime PVR::CPVREpgContainer::GetLastEPGDate ( void  )

Get the end time of the last entry.

Returns
The end time.

§ GetPastDaysToDisplay()

int PVR::CPVREpgContainer::GetPastDaysToDisplay ( ) const

Get the number of past days to show in the guide and to import from backends.

Returns
the number of past epg days.

§ GetTagById()

CPVREpgInfoTagPtr PVR::CPVREpgContainer::GetTagById ( const CPVRChannelPtr channel,
unsigned int  iBroadcastId 
) const

Get the EPG event with the given event id.

Parameters
channelThe channel to get the event for.
iBroadcastIdThe event id to get
Returns
The requested event, or an empty tag when not found

§ IgnoreDB()

bool PVR::CPVREpgContainer::IgnoreDB ( ) const

Check whether data should be persisted to the EPG database.

Returns
True if data should not be persisted to the EPG database, false otherwise.

§ IsStarted()

bool PVR::CPVREpgContainer::IsStarted ( void  ) const

Check whether the EpgContainer has fully started.

Returns
True if started, false otherwise.

§ Notify()

void PVR::CPVREpgContainer::Notify ( const Observable obs,
const ObservableMessage  msg 
)
overridevirtual

Process a notification from an observable.

Parameters
obsThe observable that sent the update.
msgThe update message.

Implements Observer.

§ OnPlaybackStarted()

void PVR::CPVREpgContainer::OnPlaybackStarted ( const CFileItemPtr item)

Inform the epg container that playback of an item just started.

Parameters
itemThe item that started to play.

§ OnPlaybackStopped()

void PVR::CPVREpgContainer::OnPlaybackStopped ( const CFileItemPtr item)

Inform the epg container that playback of an item was stopped due to user interaction.

Parameters
itemThe item that stopped to play.

§ SetHasPendingUpdates()

void PVR::CPVREpgContainer::SetHasPendingUpdates ( bool  bHasPendingUpdates = true)

Notify EPG container that there are pending manual EPG updates.

Parameters
bHasPendingUpdatesThe new value

§ Start()

void PVR::CPVREpgContainer::Start ( bool  bAsync)

Start the EPG update thread.

Parameters
bAsyncShould the EPG container starts asynchronously

§ Stop()

void PVR::CPVREpgContainer::Stop ( void  )

Stop the EPG update thread.

§ UpdateFromClient()

void PVR::CPVREpgContainer::UpdateFromClient ( const CPVREpgInfoTagPtr tag,
EPG_EVENT_STATE  eNewState 
)

A client announced an updated epg tag for a channel.

Parameters
tagThe epg tag containing the updated data
eNewStateThe kind of change (CREATED, UPDATED, DELETED)

§ UpdateRequest()

void PVR::CPVREpgContainer::UpdateRequest ( int  iClientID,
unsigned int  iUniqueChannelID 
)

A client triggered an epg update request for a channel.

Parameters
iClientIDThe id of the client which triggered the update request
iUniqueChannelIDThe uid of the channel for which the epg shall be updated

Friends And Related Function Documentation

§ CPVREpgDatabase

friend class CPVREpgDatabase
friend

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