Kodi Documentation  19.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...
 
std::shared_ptr< CPVREpgCreateChannelEpg (int iEpgId, const std::string &strScraperName, const std::shared_ptr< CPVREpgChannelData > &channelData)
 Create the EPg for a given channel. 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...
 
std::vector< std::shared_ptr< CPVREpg > > GetAllEpgs () const
 Get all EPGs. More...
 
CPVREpgPtr GetById (int iEpgId) const
 Get an EPG given its ID. More...
 
std::shared_ptr< CPVREpgGetByChannelUid (int iClientId, int iChannelUid) const
 Get an EPG given its client id and channel uid. More...
 
std::shared_ptr< CPVREpgInfoTagGetTagById (const std::shared_ptr< CPVREpg > &epg, unsigned int iBroadcastId) const
 Get the EPG event with the given event id. More...
 
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetAllTags () const
 Get all EPG tags. 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, 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 std::shared_ptr< CFileItem > &item)
 Inform the epg container that playback of an item just started. More...
 
void OnPlaybackStopped (const std::shared_ptr< CFileItem > &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 ( int  iEpgId,
const std::string &  strScraperName,
const std::shared_ptr< CPVREpgChannelData > &  channelData 
)

Create the EPg for a given channel.

Parameters
iEpgIdThe EPG id.
strScraperNameThe scraper name.
channelDataThe channel data.
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.

§ GetAllEpgs()

std::vector< std::shared_ptr< CPVREpg > > PVR::CPVREpgContainer::GetAllEpgs ( ) const

Get all EPGs.

Returns
The EPGs.

§ GetAllTags()

std::vector< std::shared_ptr< CPVREpgInfoTag > > PVR::CPVREpgContainer::GetAllTags ( ) const

Get all EPG tags.

Returns
The tags.

§ GetByChannelUid()

std::shared_ptr< CPVREpg > PVR::CPVREpgContainer::GetByChannelUid ( int  iClientId,
int  iChannelUid 
) const

Get an EPG given its client id and channel uid.

Parameters
iClientIdthe id of the pvr client providing the EPG
iChannelUidthe uid of the channel for the EPG
Returns
The EPG or nullptr if it wasn't found.

§ GetById()

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

Get an EPG given its ID.

Parameters
iEpgIdThe database ID of the table.
Returns
The EPG or nullptr 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.

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

std::shared_ptr< CPVREpgInfoTag > PVR::CPVREpgContainer::GetTagById ( const std::shared_ptr< CPVREpg > &  epg,
unsigned int  iBroadcastId 
) const

Get the EPG event with the given event id.

Parameters
epgThe epg to lookup the event.
iBroadcastIdThe event id to lookup.
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 std::shared_ptr< CFileItem > &  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 std::shared_ptr< CFileItem > &  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,
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: