PVR EPG methods
These C ++ class functions of are intended for processing EPG information and for giving it to Kodi.
The necessary data is transferred with class PVREPGTag.
EPG parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
Header parts:
PVR_ERROR
Definition: pvr_general.h:35
virtual PVR_ERROR GetEPGForChannel(int channelUid, time_t start, time_t end, kodi::addon::PVREPGTagsResultSet &results)
Request the EPG for a channel from the backend.
Definition: PVR.h:1464
virtual PVR_ERROR SetEPGMaxPastDays(int pastDays)
Tell the client the past time frame to use when notifying epg events back to Kodi.
Definition: PVR.h:1584
virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag &tag, bool &isPlayable)
Check if the given EPG tag can be played.
Definition: PVR.h:1497
virtual PVR_ERROR SetEPGMaxFutureDays(int futureDays)
Tell the client the future time frame to use when notifying epg events back to Kodi.
Definition: PVR.h:1602
virtual PVR_ERROR GetEPGTagStreamProperties(const kodi::addon::PVREPGTag &tag, std::vector< kodi::addon::PVRStreamProperty > &properties)
Get the stream properties for an epg tag from the backend.
Definition: PVR.h:1562
virtual PVR_ERROR CallEPGMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVREPGTag &tag)
Call one of the EPG related menu hooks (if supported).
Definition: PVR.h:1619
virtual PVR_ERROR GetEPGTagEdl(const kodi::addon::PVREPGTag &tag, std::vector< kodi::addon::PVREDLEntry > &edl)
Retrieve the edit decision list (EDL) of an EPG tag on the backend.
Definition: PVR.h:1521
virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag &tag, bool &isRecordable)
Check if the given EPG tag can be recorded.
Definition: PVR.h:1482
Source parts:
{
}
{
}
{
}
{
}
{
}
PVR_ERROR CMyInstance::SetEPGMaxPastDays(
int pastDays)
{
}
PVR_ERROR CMyInstance::SetEPGMaxFutureDays(
int futureDays)
{
}
{
}
@ PVR_ERROR_NOT_IMPLEMENTED
-2 : The method that Kodi called is not implemented by the add-on.
Definition: pvr_general.h:43
◆ GetEPGForChannel()
Request the EPG for a channel from the backend.
- Parameters
-
[in] | channelUid | The UID of the channel to get the EPG table for. |
[in] | start | Get events after this time (UTC). |
[in] | end | Get events before this time (UTC). |
[out] | results | List where available EPG information becomes transferred with class PVREPGTag and given to Kodi |
- Returns
- PVR_ERROR_NO_ERROR if the table has been fetched successfully.
The following table contains values that can be set with class PVREPGTag :
Example:
...
PVR_ERROR CMyPVRInstance::GetEPGForChannel(int channelUid,
time_t start,
time_t end,
{
...
}
...
@ PVR_ERROR_NO_ERROR
0 : No error occurred.
Definition: pvr_general.h:37
@ EPG_EVENT_CONTENTMASK_MOVIEDRAMA
0x10 : Movie/Drama. See EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA about related sub types.
Definition: pvr_epg.h:69
void SetUniqueBroadcastId(unsigned int uniqueBroadcastId)
required Identifier for this event. Event uids must be unique for a channel. Valid uids must be great...
Definition: EPG.h:112
void SetStartTime(time_t startTime)
required Start time in UTC.
Definition: EPG.h:141
void SetTitle(const std::string &title)
required This event's title.
Definition: EPG.h:132
void SetGenreType(int genreType)
optional Genre type.
Definition: EPG.h:255
void SetUniqueChannelId(unsigned int uniqueChannelId)
required Unique identifier of the channel this event belongs to.
Definition: EPG.h:122
void SetEndTime(time_t endTime)
required End time in UTC.
Definition: EPG.h:150
◆ IsEPGTagRecordable()
Check if the given EPG tag can be recorded.
- Parameters
-
[in] | tag | the epg tag to check. |
[out] | isRecordable | Set to true if the tag can be recorded. |
- Returns
- PVR_ERROR_NO_ERROR if bIsRecordable has been set successfully.
◆ IsEPGTagPlayable()
Check if the given EPG tag can be played.
- Parameters
-
[in] | tag | the epg tag to check. |
[out] | isPlayable | Set to true if the tag can be played. |
- Returns
- PVR_ERROR_NO_ERROR if bIsPlayable has been set successfully.
◆ GetEPGTagEdl()
Retrieve the edit decision list (EDL) of an EPG tag on the backend.
- Parameters
-
[in] | tag | The epg tag. |
[out] | edl | The function has to write the EDL into this array. |
- Returns
- PVR_ERROR_NO_ERROR if the EDL was successfully read or no EDL exists.
The following table contains values that can be set with class PVREDLEntry :
◆ GetEPGTagStreamProperties()
Get the stream properties for an epg tag from the backend.
- Parameters
-
[in] | tag | The epg tag to get the stream properties for. |
[out] | properties | the properties required to play the stream. |
- Returns
- PVR_ERROR_NO_ERROR if the stream is available.
- Note
- The value directly related to inputstream must always begin with the name of the associated add-on, e.g.
"inputstream.adaptive.manifest_update_parameter"
.
Example:
...
std::vector<kodi::addon::PVRStreamProperty>& properties)
{
...
properties.emplace_back("inputstream.adaptive.manifest_type", "mpd");
properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
}
...
#define PVR_STREAM_PROPERTY_MIMETYPE
the MIME type of the stream that should be played.
Definition: pvr_general.h:237
#define PVR_STREAM_PROPERTY_INPUTSTREAM
To define in stream properties the name of the inputstream add-on that should be used.
Definition: pvr_general.h:162
◆ SetEPGMaxPastDays()
virtual PVR_ERROR SetEPGMaxPastDays |
( |
int |
pastDays | ) |
|
|
inlinevirtual |
Tell the client the past time frame to use when notifying epg events back to Kodi.
The client might push epg events asynchronously to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi, client needs to know about the epg time frame Kodi uses. Kodi supplies the current epg max past time frame value EpgMaxPastDays() when creating the addon and calls SetEPGMaxPastDays later whenever Kodi's epg time frame value changes.
- Parameters
-
[in] | pastDays | number of days before "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. |
- Returns
- PVR_ERROR_NO_ERROR if new value was successfully set.
◆ SetEPGMaxFutureDays()
virtual PVR_ERROR SetEPGMaxFutureDays |
( |
int |
futureDays | ) |
|
|
inlinevirtual |
Tell the client the future time frame to use when notifying epg events back to Kodi.
The client might push epg events asynchronously to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi, client needs to know about the epg time frame Kodi uses. Kodi supplies the current epg max future time frame value EpgMaxFutureDays() when creating the addon and calls SetEPGMaxFutureDays later whenever Kodi's epg time frame value changes.
- Parameters
-
[in] | futureDays | number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. |
- Returns
- PVR_ERROR_NO_ERROR if new value was successfully set.
◆ CallEPGMenuHook()
Call one of the EPG related menu hooks (if supported).
Supported class PVRMenuhook instances have to be added in constructor()
, by calling AddMenuHook() on the callback.
- Parameters
-
[in] | menuhook | The hook to call. |
[in] | tag | The selected EPG item for which the hook was called. |
- Returns
- PVR_ERROR_NO_ERROR if the hook was called successfully.
The following table contains values that can be set with class PVRMenuhook :
◆ EpgMaxPastDays()
int EpgMaxPastDays |
( |
| ) |
const |
|
inline |
◆ EpgMaxFutureDays()
int EpgMaxFutureDays |
( |
| ) |
const |
|
inline |
◆ TriggerEpgUpdate()
void TriggerEpgUpdate |
( |
unsigned int |
channelUid | ) |
|
|
inline |
Callback to Kodi Function
Schedule an EPG update for the given channel channel.
- Parameters
-
[in] | channelUid | The unique id of the channel for this add-on |
◆ EpgEventStateChange()
Callback to Kodi Function
Notify a state change for an EPG event.
- Parameters
-
[in] | tag | The EPG tag where have event. |
[in] | newState | The new state.
|
Example:
...
void CMyPVRInstance::MyProcessFunction()
{
...
tag.SetUniqueId(123);
...
}
...
@ EPG_EVENT_UPDATED
1 : Event updated.
Definition: pvr_epg.h:607
void EpgEventStateChange(kodi::addon::PVREPGTag &tag, EPG_EVENT_STATE newState)
Callback to Kodi Function Notify a state change for an EPG event.
Definition: PVR.h:1698