![]() |
Kodi Documentation
18.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, bool bLoadedFromDb) | |
Create a new EPG instance. More... | |
CPVREpg (const CPVRChannelPtr &channel) | |
Create a new EPG instance for a channel. More... | |
~CPVREpg (void) override | |
Destroy this EPG instance. More... | |
bool | Load (void) |
Load all entries for this table from the database. More... | |
CPVRChannelPtr | Channel (void) const |
The channel this EPG belongs to. More... | |
int | ChannelID (void) const |
The id of the channel this EPG belongs to. More... | |
void | SetChannel (const CPVRChannelPtr &channel) |
Channel the channel tag linked to this EPG table. 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 and that have no timers set. More... | |
void | Cleanup (void) |
Remove all entries from this EPG that finished before the given time and that have no timers set. 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... | |
std::vector< CPVREpgInfoTagPtr > | GetTagsBetween (const CDateTime &beginTime, const CDateTime &endTime) const |
Get all events occurring 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 (const time_t start, const time_t end, int iUpdateTime, bool bForceUpdate=false) |
Update the EPG from 'start' till 'end'. More... | |
int | Get (CFileItemList &results) const |
Get all EPG entries. More... | |
int | Get (CFileItemList &results, const CPVREpgSearchFilter &filter) const |
Get all EPG entries that and apply a filter. More... | |
bool | Persist (void) |
Persist this table in the 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... | |
CDateTime | GetLastScanTime (void) |
Get the time the EPG data were last updated. 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, | ||
bool | bLoadedFromDb | ||
) |
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. |
bLoadedFromDb | True if this table was loaded from the database, false otherwise. |
CPVREpg::CPVREpg | ( | const CPVRChannelPtr & | channel | ) |
Create a new EPG instance for a channel.
channel | The channel to create the EPG for. |
|
override |
Destroy this EPG instance.
CPVRChannelPtr CPVREpg::Channel | ( | void | ) | const |
The channel this EPG belongs to.
int CPVREpg::ChannelID | ( | void | ) | const |
The id of the channel this EPG belongs to.
bool CPVREpg::CheckPlayingEvent | ( | void | ) |
Notify observers when the currently active tag changed.
Remove all entries from this EPG that finished before the given time and that have no timers set.
time | Delete entries with an end time before this time in UTC. |
Remove all entries from this EPG that finished before the given time and that have no timers set.
|
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.
int CPVREpg::Get | ( | CFileItemList & | results | ) | const |
Get all EPG entries.
results | The file list to store the results in. |
int CPVREpg::Get | ( | CFileItemList & | results, |
const CPVREpgSearchFilter & | filter | ||
) | const |
Get all EPG entries that and apply a filter.
results | The file list to store the results in. |
filter | The filter to apply. |
Get the start time of the first entry in this table.
Get the end time of the last entry in this table.
Get the time the EPG data were last updated.
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< CPVREpgInfoTagPtr > CPVREpg::GetTagsBetween | ( | const CDateTime & | beginTime, |
const CDateTime & | endTime | ||
) | const |
Get all events occurring 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. |
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 | ( | void | ) |
Load all entries for this table from 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 | ( | void | ) |
Persist this table in the database.
const std::string & CPVREpg::ScraperName | ( | void | ) | const |
Get the name of the scraper to use for this table.
void CPVREpg::SetChannel | ( | const CPVRChannelPtr & | channel | ) |
Channel the channel tag linked to this EPG table.
channel | The new channel tag. |
bool CPVREpg::Update | ( | const time_t | start, |
const time_t | end, | ||
int | iUpdateTime, | ||
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. |
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 |