Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PVR::CPVRTimers Class Reference

#include <PVRTimers.h>

Inheritance diagram for PVR::CPVRTimers:
PVR::CPVRTimersContainer CThread

Public Member Functions

 CPVRTimers ()
 
 ~CPVRTimers () override=default
 
void Start ()
 start the timer update thread.
 
void Stop ()
 stop the timer update thread.
 
bool Update (const std::vector< std::shared_ptr< CPVRClient > > &clients)
 Update all timers from PVR database and from given clients.
 
void Unload ()
 unload all timers.
 
bool UpdateFromClients (const std::vector< std::shared_ptr< CPVRClient > > &clients)
 Update data with recordings from the given clients, sync with local data.
 
std::shared_ptr< CPVRTimerInfoTagGetNextActiveTimer (bool bIgnoreReminders=true) const
 
std::shared_ptr< CPVRTimerInfoTagGetNextActiveTVTimer () const
 
std::shared_ptr< CPVRTimerInfoTagGetNextActiveRadioTimer () const
 
std::vector< std::shared_ptr< CPVRTimerInfoTag > > GetActiveTimers () const
 
std::shared_ptr< CPVRTimerInfoTagGetNextReminderToAnnnounce ()
 
std::vector< std::shared_ptr< CPVRTimerInfoTag > > GetAll () const
 
int AmountActiveTimers () const
 
int AmountActiveTVTimers () const
 
int AmountActiveRadioTimers () const
 
std::vector< std::shared_ptr< CPVRTimerInfoTag > > GetActiveRecordings () const
 
std::vector< std::shared_ptr< CPVRTimerInfoTag > > GetActiveTVRecordings () const
 
std::vector< std::shared_ptr< CPVRTimerInfoTag > > GetActiveRadioRecordings () const
 
bool IsRecording () const
 
bool IsRecordingOnChannel (const CPVRChannel &channel) const
 Check if a recording is running on the given channel.
 
std::shared_ptr< CPVRTimerInfoTagGetActiveTimerForChannel (const std::shared_ptr< const CPVRChannel > &channel) const
 Obtain the active timer for a given channel.
 
int AmountActiveRecordings () const
 
int AmountActiveTVRecordings () const
 
int AmountActiveRadioRecordings () const
 
bool DeleteTimersOnChannel (const std::shared_ptr< CPVRChannel > &channel, bool bDeleteTimerRules=true, bool bCurrentlyActiveOnly=false)
 Delete all timers on a channel.
 
CDateTime GetNextEventTime () const
 
bool AddTimer (const std::shared_ptr< CPVRTimerInfoTag > &tag)
 Add a timer to the client. Doesn't add the timer to the container. The backend will do this.
 
TimerOperationResult DeleteTimer (const std::shared_ptr< CPVRTimerInfoTag > &tag, bool bForce=false, bool bDeleteRule=false)
 Delete a timer on the client. Doesn't delete the timer from the container. The backend will do this.
 
bool UpdateTimer (const std::shared_ptr< CPVRTimerInfoTag > &tag)
 Update the timer on the client. Doesn't update the timer in the container. The backend will do this.
 
std::shared_ptr< CPVRTimerInfoTagGetTimerForEpgTag (const std::shared_ptr< const CPVREpgInfoTag > &epgTag) const
 Get the timer tag that matches the given epg tag.
 
std::shared_ptr< CPVRTimerInfoTagGetTimerRule (const std::shared_ptr< const CPVRTimerInfoTag > &timer) const
 Get the timer rule for a given timer tag.
 
void UpdateChannels ()
 Update the channel pointers.
 
void Notify (const PVREvent &event)
 CEventStream callback for PVR events.
 
std::shared_ptr< CPVRTimerInfoTagGetById (unsigned int iTimerId) const
 Get a timer tag given it's unique ID.
 
- Public Member Functions inherited from PVR::CPVRTimersContainer
bool UpdateFromClient (const std::shared_ptr< CPVRTimerInfoTag > &timer)
 Add a timer tag to this container or update the tag if already present in this container.
 
std::shared_ptr< CPVRTimerInfoTagGetByClient (int iClientId, int iClientIndex) const
 Get the timer tag denoted by given client id and timer id.
 
const MapTagsGetTags () const
 Get the timertags map.
 

Additional Inherited Members

- Public Types inherited from PVR::CPVRTimersContainer
typedef std::vector< std::shared_ptr< CPVRTimerInfoTag > > VecTimerInfoTag
 
typedef std::map< CDateTime, VecTimerInfoTagMapTags
 
- Protected Member Functions inherited from PVR::CPVRTimersContainer
void InsertEntry (const std::shared_ptr< CPVRTimerInfoTag > &newTimer)
 
- Protected Attributes inherited from PVR::CPVRTimersContainer
CCriticalSection m_critSection
 
unsigned int m_iLastId = 0
 
MapTags m_tags
 

Constructor & Destructor Documentation

◆ CPVRTimers()

CPVRTimers::CPVRTimers ( )

◆ ~CPVRTimers()

PVR::CPVRTimers::~CPVRTimers ( )
overridedefault

Member Function Documentation

◆ AddTimer()

bool CPVRTimers::AddTimer ( const std::shared_ptr< CPVRTimerInfoTag > & tag)

Add a timer to the client. Doesn't add the timer to the container. The backend will do this.

Parameters
tagThe timer to add.
Returns
True if timer add request was sent correctly, false if not.

◆ AmountActiveRadioRecordings()

int CPVRTimers::AmountActiveRadioRecordings ( ) const
Returns
The amount of radio timers that are currently recording

◆ AmountActiveRadioTimers()

int CPVRTimers::AmountActiveRadioTimers ( ) const
Returns
The amount of radio timers that are active (states scheduled or recording)

◆ AmountActiveRecordings()

int CPVRTimers::AmountActiveRecordings ( ) const
Returns
The amount of tv and radio timers that are currently recording

◆ AmountActiveTimers()

int CPVRTimers::AmountActiveTimers ( ) const
Returns
The amount of tv and radio timers that are active (states scheduled or recording)

◆ AmountActiveTVRecordings()

int CPVRTimers::AmountActiveTVRecordings ( ) const
Returns
The amount of tv timers that are currently recording

◆ AmountActiveTVTimers()

int CPVRTimers::AmountActiveTVTimers ( ) const
Returns
The amount of tv timers that are active (states scheduled or recording)

◆ DeleteTimer()

TimerOperationResult CPVRTimers::DeleteTimer ( const std::shared_ptr< CPVRTimerInfoTag > & tag,
bool bForce = false,
bool bDeleteRule = false )

Delete a timer on the client. Doesn't delete the timer from the container. The backend will do this.

Parameters
tagThe timer to delete.
bForceControl what to do in case the timer is currently recording. True to force to delete the timer, false to return TimerDeleteResult::RECORDING.
bDeleteRuleAlso delete the timer rule that scheduled the timer instead of single timer only.
Returns
The result.

◆ DeleteTimersOnChannel()

bool CPVRTimers::DeleteTimersOnChannel ( const std::shared_ptr< CPVRChannel > & channel,
bool bDeleteTimerRules = true,
bool bCurrentlyActiveOnly = false )

Delete all timers on a channel.

Parameters
channelThe channel to delete the timers for.
bDeleteTimerRulesTrue to delete timer rules too, false otherwise.
bCurrentlyActiveOnlyTrue to delete timers that are currently running only.
Returns
True if timers any were deleted, false otherwise.

◆ GetActiveRadioRecordings()

std::vector< std::shared_ptr< CPVRTimerInfoTag > > CPVRTimers::GetActiveRadioRecordings ( ) const
Returns
All radio timers that are recording

◆ GetActiveRecordings()

std::vector< std::shared_ptr< CPVRTimerInfoTag > > CPVRTimers::GetActiveRecordings ( ) const
Returns
All tv and radio timers that are recording

◆ GetActiveTimerForChannel()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetActiveTimerForChannel ( const std::shared_ptr< const CPVRChannel > & channel) const

Obtain the active timer for a given channel.

Parameters
channelThe channel to check.
Returns
the timer, null otherwise.

◆ GetActiveTimers()

std::vector< std::shared_ptr< CPVRTimerInfoTag > > CPVRTimers::GetActiveTimers ( ) const
Returns
All timers that are active (states scheduled or recording)

◆ GetActiveTVRecordings()

std::vector< std::shared_ptr< CPVRTimerInfoTag > > CPVRTimers::GetActiveTVRecordings ( ) const
Returns
All tv timers that are recording

◆ GetAll()

std::vector< std::shared_ptr< CPVRTimerInfoTag > > CPVRTimers::GetAll ( ) const

Get all timers

Returns
The list of all timers

◆ GetById()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetById ( unsigned int iTimerId) const

Get a timer tag given it's unique ID.

Parameters
iTimerIdThe ID to find
Returns
The tag, or an empty one when not found

◆ GetNextActiveRadioTimer()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetNextActiveRadioTimer ( ) const
Returns
The radio timer that will be active next (state scheduled), or nullptr if none.

◆ GetNextActiveTimer()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetNextActiveTimer ( bool bIgnoreReminders = true) const
Parameters
bIgnoreRemindersinclude or ignore reminders
Returns
The tv or radio timer that will be active next (state scheduled), or nullptr if none.

◆ GetNextActiveTVTimer()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetNextActiveTVTimer ( ) const
Returns
The tv timer that will be active next (state scheduled), or nullptr if none.

◆ GetNextEventTime()

CDateTime CPVRTimers::GetNextEventTime ( ) const
Returns
Next event time (timer or daily wake up)

◆ GetNextReminderToAnnnounce()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetNextReminderToAnnnounce ( )
Returns
Next due reminder, if any. Removes it from the queue of due reminders.

◆ GetTimerForEpgTag()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetTimerForEpgTag ( const std::shared_ptr< const CPVREpgInfoTag > & epgTag) const

Get the timer tag that matches the given epg tag.

Parameters
epgTagThe epg tag.
Returns
The requested timer tag, or nullptr if none was found.

◆ GetTimerRule()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetTimerRule ( const std::shared_ptr< const CPVRTimerInfoTag > & timer) const

Get the timer rule for a given timer tag.

Parameters
timerThe timer to query the timer rule for
Returns
The timer rule, or nullptr if none was found.

◆ IsRecording()

bool CPVRTimers::IsRecording ( ) const
Returns
True when recording, false otherwise.

◆ IsRecordingOnChannel()

bool CPVRTimers::IsRecordingOnChannel ( const CPVRChannel & channel) const

Check if a recording is running on the given channel.

Parameters
channelThe channel to check.
Returns
True when recording, false otherwise.

◆ Notify()

void CPVRTimers::Notify ( const PVREvent & event)

CEventStream callback for PVR events.

Parameters
eventThe event.

◆ Start()

void CPVRTimers::Start ( )

start the timer update thread.

◆ Stop()

void CPVRTimers::Stop ( )

stop the timer update thread.

◆ Unload()

void CPVRTimers::Unload ( )

unload all timers.

◆ Update()

bool CPVRTimers::Update ( const std::vector< std::shared_ptr< CPVRClient > > & clients)

Update all timers from PVR database and from given clients.

Parameters
clientsThe PVR clients data should be loaded for. Leave empty for all clients.
Returns
True on success, false otherwise.

◆ UpdateChannels()

void CPVRTimers::UpdateChannels ( )

Update the channel pointers.

◆ UpdateFromClients()

bool CPVRTimers::UpdateFromClients ( const std::vector< std::shared_ptr< CPVRClient > > & clients)

Update data with recordings from the given clients, sync with local data.

Parameters
clientsThe clients to fetch data from. Leave empty to fetch data from all created clients.
Returns
True on success, false otherwise.

◆ UpdateTimer()

bool CPVRTimers::UpdateTimer ( const std::shared_ptr< CPVRTimerInfoTag > & tag)

Update the timer on the client. Doesn't update the timer in the container. The backend will do this.

Parameters
tagThe timer to update.
Returns
True if timer update request was sent correctly, false if not.

The documentation for this class was generated from the following files: