![]() |
Kodi Documentation
19.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) | |
Create a new EPG instance. More... | |
CPVREpg (int iEpgID, const std::string &strName, const std::string &strScraperName, const std::shared_ptr< CPVREpgChannelData > &channelData) | |
Create a new EPG instance. More... | |
~CPVREpg (void) override | |
Destroy this EPG instance. More... | |
bool | Load (const std::shared_ptr< CPVREpgDatabase > &database) |
Load all entries for this table from the given database. More... | |
std::shared_ptr< CPVREpgChannelData > | GetChannelData () const |
Get data for the channel associated with this EPG. More... | |
void | SetChannelData (const std::shared_ptr< CPVREpgChannelData > &data) |
Set data for the channel associated with this EPG. More... | |
int | ChannelID (void) const |
The id of the channel associated with this EPG. More... | |
const std::string & | ScraperName (void) const |
Get the name of the scraper to use for this table. More... | |
bool | UpdatePending (void) const |
Returns if there is a manual update pending for this EPG. More... | |
void | ForceUpdate (void) |
Clear the current tags and schedule manual update. More... | |
const std::string & | Name (void) const |
Get the name of this table. More... | |
int | EpgID (void) const |
Get the database ID of this table. More... | |
bool | HasValidEntries (void) const |
Check whether this EPG contains valid entries. More... | |
void | Cleanup (const CDateTime &time) |
Remove all entries from this EPG that finished before the given time. More... | |
void | Clear (void) |
Remove all entries from this EPG. More... | |
CPVREpgInfoTagPtr | GetTagNow (bool bUpdateIfNeeded=true) const |
Get the event that is occurring now. More... | |
CPVREpgInfoTagPtr | GetTagNext () const |
Get the event that will occur next. More... | |
CPVREpgInfoTagPtr | GetTagPrevious () const |
Get the event that occured previously. More... | |
CPVREpgInfoTagPtr | GetTagBetween (const CDateTime &beginTime, const CDateTime &endTime, bool bUpdateFromClient=false) |
Get the event that occurs between the given begin and end time. More... | |
CPVREpgInfoTagPtr | GetTagByBroadcastId (unsigned int iUniqueBroadcastId) const |
Get the event matching the given unique broadcast id. More... | |
bool | UpdateEntry (const EPG_TAG *data, int iClientId, bool bUpdateDatabase) |
Update an entry in this EPG. More... | |
bool | UpdateEntry (const CPVREpgInfoTagPtr &tag, bool bUpdateDatabase) |
Update an entry in this EPG. More... | |
bool | UpdateEntry (const CPVREpgInfoTagPtr &tag, EPG_EVENT_STATE newState, bool bUpdateDatabase) |
Update an entry in this EPG. More... | |
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'. More... | |
std::vector< std::shared_ptr< CPVREpgInfoTag > > | GetTags () const |
Get all EPG tags. More... | |
bool | Persist (const std::shared_ptr< CPVREpgDatabase > &database) |
Persist this table in the given database. More... | |
CDateTime | GetFirstDate (void) const |
Get the start time of the first entry in this table. More... | |
CDateTime | GetLastDate (void) const |
Get the end time of the last entry in this table. More... | |
bool | CheckPlayingEvent (void) |
Notify observers when the currently active tag changed. More... | |
bool | NeedsSave (void) const |
Check whether this EPG has unsaved data. More... | |
bool | IsValid (void) const |
Check whether this EPG is valid. More... | |
![]() | |
Observable ()=default | |
virtual | ~Observable ()=default |
virtual Observable & | operator= (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... | |
Static Public Member Functions | |
static const std::string & | ConvertGenreIdToString (int iID, int iSubID) |
Convert a genre id and subid to a human readable name. More... | |
Friends | |
class | CPVREpgDatabase |
Additional Inherited Members | |
![]() | |
void | SendMessage (const ObservableMessage message) |
Send a message to all observer when m_bObservableChanged is true. More... | |
![]() | |
std::atomic< bool > | m_bObservableChanged {false} |
std::vector< Observer * > | m_observers |
CCriticalSection | m_obsCritSection |
CPVREpg::CPVREpg | ( | int | iEpgID, |
const std::string & | strName, | ||
const std::string & | strScraperName | ||
) |
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. |
CPVREpg::CPVREpg | ( | int | iEpgID, |
const std::string & | strName, | ||
const std::string & | strScraperName, | ||
const std::shared_ptr< CPVREpgChannelData > & | channelData | ||
) |
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. |
|
override |
Destroy this EPG instance.
int CPVREpg::ChannelID | ( | void | ) | const |
The id of the channel associated with this EPG.
bool CPVREpg::CheckPlayingEvent | ( | void | ) |
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. |
|
static |
Convert a genre id and subid to a human readable name.
iID | The genre ID. |
iSubID | The genre sub ID. |
int CPVREpg::EpgID | ( | void | ) | const |
Get the database ID of this table.
std::shared_ptr< CPVREpgChannelData > CPVREpg::GetChannelData | ( | ) | const |
Get data for the channel associated with this EPG.
Get the start time of the first entry in this table.
Get the end time of the last entry in this table.
CPVREpgInfoTagPtr 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. |
CPVREpgInfoTagPtr CPVREpg::GetTagByBroadcastId | ( | unsigned int | iUniqueBroadcastId | ) | const |
Get the event matching the given unique broadcast id.
iUniqueBroadcastId | The uid to look up |
CPVREpgInfoTagPtr CPVREpg::GetTagNext | ( | ) | const |
Get the event that will occur next.
CPVREpgInfoTagPtr CPVREpg::GetTagNow | ( | bool | bUpdateIfNeeded = true | ) | const |
Get the event that is occurring now.
CPVREpgInfoTagPtr CPVREpg::GetTagPrevious | ( | ) | const |
Get the event that occured previously.
std::vector< std::shared_ptr< CPVREpgInfoTag > > CPVREpg::GetTags | ( | ) | const |
Get all EPG tags.
bool CPVREpg::HasValidEntries | ( | void | ) | const |
Check whether this EPG contains valid entries.
bool CPVREpg::IsValid | ( | void | ) | const |
Check whether this EPG is valid.
bool CPVREpg::Load | ( | const std::shared_ptr< CPVREpgDatabase > & | database | ) |
Load all entries for this table from the given database.
database | The database. |
const std::string & CPVREpg::Name | ( | void | ) | const |
Get the name of this table.
bool CPVREpg::NeedsSave | ( | void | ) | const |
Check whether this EPG has unsaved data.
bool CPVREpg::Persist | ( | const std::shared_ptr< CPVREpgDatabase > & | database | ) |
Persist this table in the given database.
database | The database. |
const std::string & CPVREpg::ScraperName | ( | void | ) | 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. |
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 |
bool CPVREpg::UpdateEntry | ( | const EPG_TAG * | data, |
int | iClientId, | ||
bool | bUpdateDatabase | ||
) |
Update an entry in this EPG.
data | The tag to update. |
iClientId | The id of the pvr client this event belongs to. |
bUpdateDatabase | If set to true, this event will be persisted in the database. |
bool CPVREpg::UpdateEntry | ( | const CPVREpgInfoTagPtr & | tag, |
bool | bUpdateDatabase | ||
) |
Update an entry in this EPG.
tag | The tag to update. |
bUpdateDatabase | If set to true, this event will be persisted in the database. |
bool CPVREpg::UpdateEntry | ( | const CPVREpgInfoTagPtr & | tag, |
EPG_EVENT_STATE | newState, | ||
bool | bUpdateDatabase | ||
) |
Update an entry in this EPG.
tag | The tag to update. |
newState | the new state of the event. |
bUpdateDatabase | If set to true, this event will be persisted in the database. |
bool CPVREpg::UpdatePending | ( | void | ) | const |
Returns if there is a manual update pending for this EPG.
|
friend |