PVR timer methods
For editing and displaying timed work, such as video recording.
Timer 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 UpdateTimer(const kodi::addon::PVRTimer &timer)
Update the timer information on the backend.
Definition: PVR.h:2197
virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer &timer, bool forceDelete)
Delete a timer on the backend.
Definition: PVR.h:2182
virtual PVR_ERROR CallTimerMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVRTimer &item)
Call one of the timer related menu hooks (if supported).
Definition: PVR.h:2218
virtual PVR_ERROR AddTimer(const kodi::addon::PVRTimer &timer)
Add a timer on the backend.
Definition: PVR.h:2165
virtual PVR_ERROR GetTimers(kodi::addon::PVRTimersResultSet &results)
Request the list of all timers from the backend if supported.
Definition: PVR.h:2150
virtual PVR_ERROR GetTimersAmount(int &amount)
To get total amount of timers on the backend or -1 on error.
Definition: PVR.h:2110
virtual PVR_ERROR GetTimerTypes(std::vector< kodi::addon::PVRTimerType > &types)
Retrieve the timer types supported by the backend.
Definition: PVR.h:2095
Source parts:
PVR_ERROR CMyInstance::GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
{
}
PVR_ERROR CMyInstance::GetTimersAmount(
int& amount)
{
}
{
}
{
}
{
}
{
}
{
}
@ PVR_ERROR_NOT_IMPLEMENTED
-2 : The method that Kodi called is not implemented by the add-on.
Definition: pvr_general.h:43
◆ GetTimerTypes()
Retrieve the timer types supported by the backend.
- Parameters
-
[out] | types | The function has to write the definition of the class PVRTimerType types into this array. |
- Returns
- PVR_ERROR_NO_ERROR if the types were successfully written to the array.
- Note
- Maximal 32 entries are allowed inside.
The following table contains values that can be set with class PVRTimerType :
◆ GetTimersAmount()
virtual PVR_ERROR GetTimersAmount |
( |
int & |
amount | ) |
|
|
inlinevirtual |
To get total amount of timers on the backend or -1 on error.
- Parameters
-
[out] | amount | The total amount of timers on the backend |
- Returns
- PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
- Note
- Required to use if supportsTimers is set to true.
◆ GetTimers()
Request the list of all timers from the backend if supported.
- Parameters
-
- Returns
- PVR_ERROR_NO_ERROR if the list has been fetched successfully.
- Note
- Required to use if supportsTimers is set to true.
The following table contains values that can be set with class PVRTimer :
Example:
...
{
...
}
...
@ PVR_ERROR_NO_ERROR
0 : No error occurred.
Definition: pvr_general.h:37
@ PVR_TIMER_STATE_SCHEDULED
1 : The timer is scheduled for recording.
Definition: pvr_timers.h:300
void SetClientIndex(unsigned int clientIndex)
required The index of this timer given by the client.
Definition: Timers.h:116
void SetTitle(const std::string &title)
required A title for this timer.
Definition: Timers.h:168
void SetState(PVR_TIMER_STATE state)
required The state of this timer.
Definition: Timers.h:135
void Add(const kodi::addon::PVRTimer &tag)
To add and give content from addon to Kodi on related call.
Definition: Timers.h:503
◆ AddTimer()
Add a timer on the backend.
- Parameters
-
[in] | timer | The timer to add. |
- Returns
- PVR_ERROR_NO_ERROR if the timer has been added successfully.
- Note
- Required to use if supportsTimers is set to true.
◆ DeleteTimer()
Delete a timer on the backend.
- Parameters
-
[in] | timer | The timer to delete. |
[in] | forceDelete | Set to true to delete a timer that is currently recording a program. |
- Returns
- PVR_ERROR_NO_ERROR if the timer has been deleted successfully.
- Note
- Required to use if supportsTimers is set to true.
◆ UpdateTimer()
Update the timer information on the backend.
- Parameters
-
[in] | timer | The timer to update. |
- Returns
- PVR_ERROR_NO_ERROR if the timer has been updated successfully.
- Note
- Required to use if supportsTimers is set to true.
◆ CallTimerMenuHook()
Call one of the timer 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] | item | The selected timer 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 :
◆ TriggerTimerUpdate()
void TriggerTimerUpdate |
( |
| ) |
|
|
inline |
Callback to Kodi Function
Request Kodi to update it's list of timers.