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

#include <EpgContainer.h>

Inheritance diagram for PVR::CPVREpgContainer:
CThread

Public Member Functions

 CPVREpgContainer ()=delete
 
 CPVREpgContainer (CEventSource< PVREvent > &eventSource)
 Create a new EPG table container.
 
 ~CPVREpgContainer () override
 Destroy this instance.
 
std::shared_ptr< CPVREpgDatabaseGetEpgDatabase () const
 Get a pointer to the database instance.
 
void Start ()
 Start the EPG update thread.
 
void Stop ()
 Stop the EPG update thread.
 
bool Load ()
 (re)load EPG data.
 
void Unload ()
 unload all EPG data.
 
bool IsStarted () const
 Check whether the EpgContainer has fully started.
 
bool QueueDeleteEpgs (const std::vector< std::shared_ptr< CPVREpg > > &epgs)
 Queue the deletion of the given EPG tables from this container.
 
void Notify (const PVREvent &event)
 CEventStream callback for PVR events.
 
std::shared_ptr< CPVREpgCreateChannelEpg (int iEpgId, const std::string &strScraperName, const std::shared_ptr< CPVREpgChannelData > &channelData)
 Create the EPg for a given channel.
 
std::pair< CDateTime, CDateTimeGetFirstAndLastEPGDate () const
 Get the start and end time across all EPGs.
 
std::vector< std::shared_ptr< CPVREpg > > GetAllEpgs () const
 Get all EPGs.
 
std::shared_ptr< CPVREpgGetById (int iEpgId) const
 Get an EPG given its ID.
 
std::shared_ptr< CPVREpgGetByChannelUid (int iClientId, int iChannelUid) const
 Get an EPG given its client id and channel uid.
 
std::shared_ptr< CPVREpgInfoTagGetTagById (const std::shared_ptr< const CPVREpg > &epg, unsigned int iBroadcastId) const
 Get the EPG event with the given event id.
 
std::shared_ptr< CPVREpgInfoTagGetTagByDatabaseId (int iDatabaseId) const
 Get the EPG event with the given database id.
 
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetTags (const PVREpgSearchData &searchData) const
 Get all EPG tags matching the given search criteria.
 
void SetHasPendingUpdates (bool bHasPendingUpdates=true)
 Notify EPG container that there are pending manual EPG updates.
 
void UpdateRequest (int iClientID, int iUniqueChannelID)
 A client triggered an epg update request for a channel.
 
void UpdateFromClient (const std::shared_ptr< CPVREpgInfoTag > &tag, EPG_EVENT_STATE eNewState)
 A client announced an updated epg tag for a channel.
 
int GetPastDaysToDisplay () const
 Get the number of past days to show in the guide and to import from backends.
 
int GetFutureDaysToDisplay () const
 Get the number of future days to show in the guide and to import from backends.
 
void OnPlaybackStarted ()
 Inform the epg container that playback of an item just started.
 
void OnPlaybackStopped ()
 Inform the epg container that playback of an item was stopped due to user interaction.
 
void OnSystemSleep ()
 Inform the epg container that the system is going to sleep.
 
void OnSystemWake ()
 Inform the epg container that the system gets awake from sleep.
 
int CleanupCachedImages ()
 Erase stale texture db entries and image files.
 
std::vector< std::shared_ptr< CPVREpgSearchFilter > > GetSavedSearches (bool bRadio)
 Get all saved searches from the database.
 
std::shared_ptr< CPVREpgSearchFilterGetSavedSearchById (bool bRadio, int iId)
 Get the saved search matching the given id.
 
bool PersistSavedSearch (CPVREpgSearchFilter &search)
 Persist a saved search in the database.
 
bool UpdateSavedSearchLastExecuted (const CPVREpgSearchFilter &epgSearch)
 Update time last executed for the given search.
 
bool DeleteSavedSearch (const CPVREpgSearchFilter &search)
 Delete a saved search from the database.
 

Friends

class CPVREpgDatabase
 

Constructor & Destructor Documentation

◆ CPVREpgContainer() [1/2]

PVR::CPVREpgContainer::CPVREpgContainer ( )
delete

◆ CPVREpgContainer() [2/2]

PVR::CPVREpgContainer::CPVREpgContainer ( CEventSource< PVREvent > & eventSource)
explicit

Create a new EPG table container.

◆ ~CPVREpgContainer()

PVR::CPVREpgContainer::~CPVREpgContainer ( )
override

Destroy this instance.

Member Function Documentation

◆ CleanupCachedImages()

int PVR::CPVREpgContainer::CleanupCachedImages ( )

Erase stale texture db entries and image files.

Returns
number of cleaned up images.

◆ CreateChannelEpg()

std::shared_ptr< CPVREpg > 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

◆ DeleteSavedSearch()

bool PVR::CPVREpgContainer::DeleteSavedSearch ( const CPVREpgSearchFilter & search)

Delete a saved search from the database.

Parameters
searchThe saved search.
Returns
True on success, false otherwise.

◆ GetAllEpgs()

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

Get all EPGs.

Returns
The EPGs.

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

std::shared_ptr< CPVREpg > 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()

std::shared_ptr< CPVREpgDatabase > PVR::CPVREpgContainer::GetEpgDatabase ( ) const

Get a pointer to the database instance.

Returns
A pointer to the database instance.

◆ GetFirstAndLastEPGDate()

std::pair< CDateTime, CDateTime > PVR::CPVREpgContainer::GetFirstAndLastEPGDate ( ) const

Get the start and end time across all EPGs.

Returns
The times; first: start time, second: end 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.

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

◆ GetSavedSearchById()

std::shared_ptr< CPVREpgSearchFilter > PVR::CPVREpgContainer::GetSavedSearchById ( bool bRadio,
int iId )

Get the saved search matching the given id.

Parameters
bRadioWhether to fetch a TV or radio saved search.
iIdThe id.
Returns
The saved search or nullptr if not found.

◆ GetSavedSearches()

std::vector< std::shared_ptr< CPVREpgSearchFilter > > PVR::CPVREpgContainer::GetSavedSearches ( bool bRadio)

Get all saved searches from the database.

Parameters
bRadioWhether to fetch saved searches for radio or TV.
Returns
The searches.

◆ GetTagByDatabaseId()

std::shared_ptr< CPVREpgInfoTag > PVR::CPVREpgContainer::GetTagByDatabaseId ( int iDatabaseId) const

Get the EPG event with the given database id.

Parameters
iDatabaseIdThe id to lookup.
Returns
The requested event, or an empty tag when not found

◆ GetTagById()

std::shared_ptr< CPVREpgInfoTag > PVR::CPVREpgContainer::GetTagById ( const std::shared_ptr< const 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

◆ GetTags()

std::vector< std::shared_ptr< CPVREpgInfoTag > > PVR::CPVREpgContainer::GetTags ( const PVREpgSearchData & searchData) const

Get all EPG tags matching the given search criteria.

Parameters
searchDataThe search criteria.
Returns
The matching tags.

◆ IsStarted()

bool PVR::CPVREpgContainer::IsStarted ( ) const

Check whether the EpgContainer has fully started.

Returns
True if started, false otherwise.

◆ Load()

bool PVR::CPVREpgContainer::Load ( )

(re)load EPG data.

Returns
True if loaded successfully, false otherwise.

◆ Notify()

void PVR::CPVREpgContainer::Notify ( const PVREvent & event)

CEventStream callback for PVR events.

Parameters
eventThe event.

◆ OnPlaybackStarted()

void PVR::CPVREpgContainer::OnPlaybackStarted ( )

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

◆ OnPlaybackStopped()

void PVR::CPVREpgContainer::OnPlaybackStopped ( )

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

◆ OnSystemSleep()

void PVR::CPVREpgContainer::OnSystemSleep ( )

Inform the epg container that the system is going to sleep.

◆ OnSystemWake()

void PVR::CPVREpgContainer::OnSystemWake ( )

Inform the epg container that the system gets awake from sleep.

◆ PersistSavedSearch()

bool PVR::CPVREpgContainer::PersistSavedSearch ( CPVREpgSearchFilter & search)

Persist a saved search in the database.

Parameters
searchThe saved search.
Returns
True on success, false otherwise.

◆ QueueDeleteEpgs()

bool PVR::CPVREpgContainer::QueueDeleteEpgs ( const std::vector< std::shared_ptr< CPVREpg > > & epgs)

Queue the deletion of the given EPG tables from this container.

Parameters
epgThe tables to delete.
Returns
True on success, false otherwise.

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

Start the EPG update thread.

◆ Stop()

void PVR::CPVREpgContainer::Stop ( )

Stop the EPG update thread.

◆ Unload()

void PVR::CPVREpgContainer::Unload ( )

unload all EPG data.

◆ UpdateFromClient()

void PVR::CPVREpgContainer::UpdateFromClient ( const std::shared_ptr< CPVREpgInfoTag > & 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

◆ UpdateSavedSearchLastExecuted()

bool PVR::CPVREpgContainer::UpdateSavedSearchLastExecuted ( const CPVREpgSearchFilter & epgSearch)

Update time last executed for the given search.

Parameters
epgSearchThe search.
Returns
True on success, false otherwise.

Friends And Related Symbol Documentation

◆ CPVREpgDatabase

friend class CPVREpgDatabase
friend

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