Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <Epg.h>
Public Member Functions | |
CPVREpg (int iEpgID, const std::string &strName, const std::string &strScraperName, const std::shared_ptr< CPVREpgDatabase > &database) | |
Create a new EPG instance. | |
CPVREpg (int iEpgID, const std::string &strName, const std::string &strScraperName, const std::shared_ptr< CPVREpgChannelData > &channelData, const std::shared_ptr< CPVREpgDatabase > &database) | |
Create a new EPG instance. | |
virtual | ~CPVREpg () |
Destroy this EPG instance. | |
std::shared_ptr< CPVREpgChannelData > | GetChannelData () const |
Get data for the channel associated with this EPG. | |
void | SetChannelData (const std::shared_ptr< CPVREpgChannelData > &data) |
Set data for the channel associated with this EPG. | |
int | ChannelID () const |
The id of the channel associated with this EPG. | |
const std::string & | ScraperName () const |
Get the name of the scraper to use for this table. | |
bool | UpdatePending () const |
Returns if there is a manual update pending for this EPG. | |
void | ForceUpdate () |
Clear the current tags and schedule manual update. | |
const std::string & | Name () const |
Get the name of this table. | |
int | EpgID () const |
Get the database ID of this table. | |
void | Cleanup (const CDateTime &time) |
Remove all entries from this EPG that finished before the given time. | |
void | Clear () |
Remove all entries from this EPG. | |
std::shared_ptr< CPVREpgInfoTag > | GetTagNow () const |
Get the event that is occurring now. | |
std::shared_ptr< CPVREpgInfoTag > | GetTagNext () const |
Get the event that will occur next. | |
std::shared_ptr< CPVREpgInfoTag > | GetTagPrevious () const |
Get the event that occurred previously. | |
std::shared_ptr< CPVREpgInfoTag > | GetTagBetween (const CDateTime &beginTime, const CDateTime &endTime, bool bUpdateFromClient=false) |
Get the event that occurs between the given begin and end time. | |
std::shared_ptr< CPVREpgInfoTag > | GetTagByBroadcastId (unsigned int iUniqueBroadcastId) const |
Get the event matching the given unique broadcast id. | |
std::shared_ptr< CPVREpgInfoTag > | GetTagByDatabaseId (int iDatabaseId) const |
Get the event matching the given database id. | |
bool | UpdateEntry (const EPG_TAG *data, int iClientId) |
Update an entry in this EPG. | |
bool | UpdateEntry (const std::shared_ptr< CPVREpgInfoTag > &tag, EPG_EVENT_STATE newState) |
Update an entry in this EPG. | |
bool | Update (time_t start, time_t end, int iUpdateTime, int iPastDays, const std::shared_ptr< CPVREpgDatabase > &database, bool bForceUpdate=false) |
Update the EPG from 'start' till 'end'. | |
std::vector< std::shared_ptr< CPVREpgInfoTag > > | GetTags () const |
Get all EPG tags. | |
std::vector< std::shared_ptr< CPVREpgInfoTag > > | GetTimeline (const CDateTime &timelineStart, const CDateTime &timelineEnd, const CDateTime &minEventEnd, const CDateTime &maxEventStart) const |
Get all EPG tags for the given time frame, including "gap" tags. | |
bool | QueuePersistQuery (const std::shared_ptr< CPVREpgDatabase > &database) |
Write the query to persist data into given database's queue. | |
bool | QueueDeleteQueries (const std::shared_ptr< CPVREpgDatabase > &database) |
Write the delete queries into the given database's queue. | |
std::pair< CDateTime, CDateTime > | GetFirstAndLastUncommitedEPGDate () const |
Get the start and end time of the last not yet commited entry in this table. | |
bool | CheckPlayingEvent () |
Notify observers when the currently active tag changed. | |
bool | NeedsSave () const |
Check whether this EPG has unsaved data. | |
bool | IsValid () const |
Check whether this EPG is valid. | |
CEventStream< PVREvent > & | Events () |
Query the events available for CEventStream. | |
void | Lock () |
Lock the instance. No other thread gets access to this EPG until Unlock was called. | |
void | Unlock () |
Unlock the instance. Other threads may get access to this EPG again. | |
void | RemovedFromContainer () |
Called to inform the EPG that it has been removed from the EPG container. | |
int | CleanupCachedImages (const std::shared_ptr< const CPVREpgDatabase > &database) |
Erase stale texture db entries and image files. | |
Static Public Member Functions | |
static const std::string & | ConvertGenreIdToString (int iID, int iSubID) |
Convert a genre id and subid to a human readable name. | |
Friends | |
class | CPVREpgDatabase |
CPVREpg::CPVREpg | ( | int | iEpgID, |
const std::string & | strName, | ||
const std::string & | strScraperName, | ||
const std::shared_ptr< CPVREpgDatabase > & | database ) |
Create a new EPG instance.
iEpgID | The ID of this table or <= 0 to create a new ID. |
strName | The name of this table. |
strScraperName | The name of the scraper to use. |
database | The EPG database |
CPVREpg::CPVREpg | ( | int | iEpgID, |
const std::string & | strName, | ||
const std::string & | strScraperName, | ||
const std::shared_ptr< CPVREpgChannelData > & | channelData, | ||
const std::shared_ptr< CPVREpgDatabase > & | database ) |
Create a new EPG instance.
iEpgID | The ID of this table or <= 0 to create a new ID. |
strName | The name of this table. |
strScraperName | The name of the scraper to use. |
channelData | The channel data. |
database | The EPG database |
|
virtual |
Destroy this EPG instance.
int CPVREpg::ChannelID | ( | ) | const |
The id of the channel associated with this EPG.
bool CPVREpg::CheckPlayingEvent | ( | ) |
Notify observers when the currently active tag changed.
Remove all entries from this EPG that finished before the given time.
time | Delete entries with an end time before this time in UTC. |
int CPVREpg::CleanupCachedImages | ( | const std::shared_ptr< const CPVREpgDatabase > & | database | ) |
Erase stale texture db entries and image files.
database | The EPG database |
void CPVREpg::Clear | ( | ) |
Remove all entries from this EPG.
Convert a genre id and subid to a human readable name.
iID | The genre ID. |
iSubID | The genre sub ID. |
int CPVREpg::EpgID | ( | ) | const |
Get the database ID of this table.
|
inline |
Query the events available for CEventStream.
void CPVREpg::ForceUpdate | ( | ) |
Clear the current tags and schedule manual update.
std::shared_ptr< CPVREpgChannelData > CPVREpg::GetChannelData | ( | ) | const |
Get data for the channel associated with this EPG.
Get the start and end time of the last not yet commited entry in this table.
std::shared_ptr< CPVREpgInfoTag > CPVREpg::GetTagBetween | ( | const CDateTime & | beginTime, |
const CDateTime & | endTime, | ||
bool | bUpdateFromClient = false ) |
Get the event that occurs between the given begin and end time.
beginTime | Minimum start time in UTC of the event. |
endTime | Maximum end time in UTC of the event. |
bUpdateFromClient | if true, try to fetch the event from the client if not found locally. |
std::shared_ptr< CPVREpgInfoTag > CPVREpg::GetTagByBroadcastId | ( | unsigned int | iUniqueBroadcastId | ) | const |
Get the event matching the given unique broadcast id.
iUniqueBroadcastId | The uid to look up |
std::shared_ptr< CPVREpgInfoTag > CPVREpg::GetTagByDatabaseId | ( | int | iDatabaseId | ) | const |
Get the event matching the given database id.
iDatabaseId | The id to look up |
std::shared_ptr< CPVREpgInfoTag > CPVREpg::GetTagNext | ( | ) | const |
Get the event that will occur next.
std::shared_ptr< CPVREpgInfoTag > CPVREpg::GetTagNow | ( | ) | const |
Get the event that is occurring now.
std::shared_ptr< CPVREpgInfoTag > CPVREpg::GetTagPrevious | ( | ) | const |
Get the event that occurred previously.
std::vector< std::shared_ptr< CPVREpgInfoTag > > CPVREpg::GetTags | ( | ) | const |
Get all EPG tags.
std::vector< std::shared_ptr< CPVREpgInfoTag > > CPVREpg::GetTimeline | ( | const CDateTime & | timelineStart, |
const CDateTime & | timelineEnd, | ||
const CDateTime & | minEventEnd, | ||
const CDateTime & | maxEventStart ) const |
Get all EPG tags for the given time frame, including "gap" tags.
timelineStart | Start of time line |
timelineEnd | End of time line |
minEventEnd | The minimum end time of the events to return |
maxEventStart | The maximum start time of the events to return |
bool CPVREpg::IsValid | ( | ) | const |
Check whether this EPG is valid.
|
inline |
Lock the instance. No other thread gets access to this EPG until Unlock was called.
const std::string & CPVREpg::Name | ( | ) | const |
Get the name of this table.
bool CPVREpg::NeedsSave | ( | ) | const |
Check whether this EPG has unsaved data.
bool CPVREpg::QueueDeleteQueries | ( | const std::shared_ptr< CPVREpgDatabase > & | database | ) |
Write the delete queries into the given database's queue.
database | The database. |
bool CPVREpg::QueuePersistQuery | ( | const std::shared_ptr< CPVREpgDatabase > & | database | ) |
Write the query to persist data into given database's queue.
database | The database. |
void CPVREpg::RemovedFromContainer | ( | ) |
Called to inform the EPG that it has been removed from the EPG container.
const std::string & CPVREpg::ScraperName | ( | ) | const |
Get the name of the scraper to use for this table.
void CPVREpg::SetChannelData | ( | const std::shared_ptr< CPVREpgChannelData > & | data | ) |
Set data for the channel associated with this EPG.
data | The data. |
|
inline |
Unlock the instance. Other threads may get access to this EPG again.
bool CPVREpg::Update | ( | time_t | start, |
time_t | end, | ||
int | iUpdateTime, | ||
int | iPastDays, | ||
const std::shared_ptr< CPVREpgDatabase > & | database, | ||
bool | bForceUpdate = false ) |
Update the EPG from 'start' till 'end'.
start | The start time. |
end | The end time. |
iUpdateTime | Update the table after the given amount of time has passed. |
iPastDays | Amount of past days from now on, for which past entries are to be kept. |
database | If given, the database to store the data. |
bForceUpdate | Force update from client even if it's not the time to |
Update an entry in this EPG.
data | The tag to update. |
iClientId | The id of the pvr client this event belongs to. |
bool CPVREpg::UpdateEntry | ( | const std::shared_ptr< CPVREpgInfoTag > & | tag, |
EPG_EVENT_STATE | newState ) |
Update an entry in this EPG.
tag | The tag to update. |
newState | the new state of the event. |
bool CPVREpg::UpdatePending | ( | ) | const |
Returns if there is a manual update pending for this EPG.
|
friend |