Kodi Documentation  19.0
Kodi is an open source media player and entertainment hub.
PVR::CPVRTimers Class Reference

#include <PVRTimers.h>

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

Public Member Functions

 CPVRTimers (void)
 
 ~CPVRTimers (void) override
 
bool Load (void)
 (re)load the timers from the clients. More...
 
void Unload ()
 unload all timers. More...
 
bool Update (void)
 refresh the timer list from the clients. More...
 
bool LoadFromDatabase (void)
 load the local timers from database. More...
 
std::shared_ptr< CPVRTimerInfoTagGetNextActiveTimer (bool bIgnoreReminders=true) const
 
std::shared_ptr< CPVRTimerInfoTagGetNextActiveTVTimer (void) const
 
std::shared_ptr< CPVRTimerInfoTagGetNextActiveRadioTimer (void) const
 
std::vector< std::shared_ptr< CPVRTimerInfoTag > > GetActiveTimers (void) const
 
std::shared_ptr< CPVRTimerInfoTagGetNextReminderToAnnnounce ()
 
void GetAll (CFileItemList &items) const
 
int AmountActiveTimers (void) const
 
int AmountActiveTVTimers (void) const
 
int AmountActiveRadioTimers (void) 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 (void) const
 
bool IsRecordingOnChannel (const CPVRChannel &channel) const
 Check if a recording is running on the given channel. More...
 
CPVRTimerInfoTagPtr GetActiveTimerForChannel (const CPVRChannelPtr &channel) const
 Obtain the active timer for a given channel. More...
 
int AmountActiveRecordings (void) const
 
int AmountActiveTVRecordings (void) const
 
int AmountActiveRadioRecordings (void) const
 
bool GetDirectory (const std::string &strPath, CFileItemList &items) const
 Get all timers for the given path. More...
 
bool DeleteTimersOnChannel (const CPVRChannelPtr &channel, bool bDeleteTimerRules=true, bool bCurrentlyActiveOnly=false)
 Delete all timers on a channel. More...
 
CDateTime GetNextEventTime (void) 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. More...
 
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. More...
 
bool RenameTimer (const std::shared_ptr< CPVRTimerInfoTag > &tag, const std::string &strNewName)
 Rename a timer on the client. Doesn't update the timer in the container. The backend will do this. More...
 
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. More...
 
CPVRTimerInfoTagPtr GetTimerForEpgTag (const CPVREpgInfoTagPtr &epgTag) const
 Get the timer tag that matches the given epg tag. More...
 
CPVRTimerInfoTagPtr GetTimerRule (const CPVRTimerInfoTagPtr &timer) const
 
CFileItemPtr GetTimerRule (const CFileItemPtr &item) const
 
void UpdateChannels (void)
 Update the channel pointers. More...
 
void Notify (const Observable &obs, const ObservableMessage msg) override
 Process a message from an observable. More...
 
CPVRTimerInfoTagPtr GetById (unsigned int iTimerId) const
 
- Public Member Functions inherited from PVR::CPVRTimersContainer
bool UpdateFromClient (const CPVRTimerInfoTagPtr &timer)
 Add a timer tag to this container or update the tag if already present in this container. More...
 
CPVRTimerInfoTagPtr GetByClient (int iClientId, int iClientIndex) const
 Get the timer tag denoted by given client id and timer id. More...
 
const MapTagsGetTags () const
 Get the timertags map. More...
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
virtual ~Observer ()=default
 

Additional Inherited Members

- Public Types inherited from PVR::CPVRTimersContainer
typedef std::vector< CPVRTimerInfoTagPtrVecTimerInfoTag
 
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 ( void  )

§ ~CPVRTimers()

CPVRTimers::~CPVRTimers ( void  )
override

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 ( void  ) const
Returns
The amount of radio timers that are currently recording

§ AmountActiveRadioTimers()

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

§ AmountActiveRecordings()

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

§ AmountActiveTimers()

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

§ AmountActiveTVRecordings()

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

§ AmountActiveTVTimers()

int CPVRTimers::AmountActiveTVTimers ( void  ) 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 CPVRChannelPtr 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()

CPVRTimerInfoTagPtr CPVRTimers::GetActiveTimerForChannel ( const CPVRChannelPtr 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 ( void  ) 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()

void CPVRTimers::GetAll ( CFileItemList items) const

Get all timers

Parameters
itemsThe list to add the timers to

§ GetById()

CPVRTimerInfoTagPtr 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

§ GetDirectory()

bool CPVRTimers::GetDirectory ( const std::string &  strPath,
CFileItemList items 
) const

Get all timers for the given path.

Parameters
strPathThe vfs path to get the timers for.
itemsThe results.
Returns
True when the path was valid, false otherwise.

§ GetNextActiveRadioTimer()

std::shared_ptr< CPVRTimerInfoTag > CPVRTimers::GetNextActiveRadioTimer ( void  ) 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 an empty fileitemptr if none.

§ GetNextActiveTVTimer()

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

§ GetNextEventTime()

CDateTime CPVRTimers::GetNextEventTime ( void  ) 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()

CPVRTimerInfoTagPtr CPVRTimers::GetTimerForEpgTag ( const CPVREpgInfoTagPtr 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() [1/2]

CPVRTimerInfoTagPtr CPVRTimers::GetTimerRule ( const CPVRTimerInfoTagPtr 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.

§ GetTimerRule() [2/2]

CFileItemPtr CPVRTimers::GetTimerRule ( const CFileItemPtr item) const

Get the timer rule for a given timer tag

Parameters
itemThe timer to query the timer rule for
Returns
The timer rule, or an empty fileitemptr if none was found.

§ IsRecording()

bool CPVRTimers::IsRecording ( void  ) 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.

§ Load()

bool CPVRTimers::Load ( void  )

(re)load the timers from the clients.

Returns
True if loaded successfully, false otherwise.

§ LoadFromDatabase()

bool CPVRTimers::LoadFromDatabase ( void  )

load the local timers from database.

Returns
True if loaded successfully, false otherwise.

§ Notify()

void CPVRTimers::Notify ( const Observable obs,
const ObservableMessage  msg 
)
overridevirtual

Process a message from an observable.

Parameters
obsThe observable that sends the message.
msgThe message.

Implements Observer.

§ RenameTimer()

bool CPVRTimers::RenameTimer ( const std::shared_ptr< CPVRTimerInfoTag > &  tag,
const std::string &  strNewName 
)

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

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

§ Unload()

void CPVRTimers::Unload ( )

unload all timers.

§ Update()

bool CPVRTimers::Update ( void  )

refresh the timer list from the clients.

§ UpdateChannels()

void CPVRTimers::UpdateChannels ( void  )

Update the channel pointers.

§ 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: