Kodi Documentation  18.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

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 channel list from the clients. More...
 
CFileItemPtr GetNextActiveTimer (void) const
 
CFileItemPtr GetNextActiveTVTimer (void) const
 
CFileItemPtr GetNextActiveRadioTimer (void) const
 
std::vector< CFileItemPtrGetActiveTimers (void) const
 
void GetAll (CFileItemList &items) const
 
bool HasActiveTimers (void) const
 
int AmountActiveTimers (void) const
 
int AmountActiveTVTimers (void) const
 
int AmountActiveRadioTimers (void) const
 
std::vector< CFileItemPtrGetActiveRecordings (void) const
 
std::vector< CFileItemPtrGetActiveTVRecordings (void) const
 
std::vector< CFileItemPtrGetActiveRadioRecordings (void) 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
 
CPVRTimerInfoTagPtr GetTimerForEpgTag (const CPVREpgInfoTagPtr &epgTag) const
 Get the timer tag that matches the given epg tag. More...
 
bool HasRecordingTimerForRecording (const CPVRRecording &recording) const
 Check whether there is a timer currently recording the given recording. More...
 
CPVRTimerInfoTagPtr GetRecordingTimerForRecording (const CPVRRecording &recording) const
 Get the timer currently recording the given recording, if any. 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, unsigned int iClientTimerId) 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
 

Static Public Member Functions

static bool AddTimer (const CPVRTimerInfoTagPtr &tag)
 Add a timer to the client. Doesn't add the timer to the container. The backend will do this. More...
 
static TimerOperationResult DeleteTimer (const CPVRTimerInfoTagPtr &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...
 
static bool RenameTimer (const CPVRTimerInfoTagPtr &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...
 
static bool UpdateTimer (const CPVRTimerInfoTagPtr &tag)
 Update the timer on the client. Doesn't update the timer in the container. The backend will do this. More...
 

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 InsertTimer (const CPVRTimerInfoTagPtr &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 CPVRTimerInfoTagPtr tag)
static

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 CPVRTimerInfoTagPtr tag,
bool  bForce = false,
bool  bDeleteRule = false 
)
static

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< CFileItemPtr > CPVRTimers::GetActiveRadioRecordings ( void  ) const
Returns
All radio timers that are recording

§ GetActiveRecordings()

std::vector< CFileItemPtr > CPVRTimers::GetActiveRecordings ( void  ) 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< CFileItemPtr > CPVRTimers::GetActiveTimers ( void  ) const
Returns
All timers that are active (states scheduled or recording)

§ GetActiveTVRecordings()

std::vector< CFileItemPtr > CPVRTimers::GetActiveTVRecordings ( void  ) 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()

CFileItemPtr CPVRTimers::GetNextActiveRadioTimer ( void  ) const
Returns
The radio timer that will be active next (state scheduled), or an empty fileitemptr if none.

§ GetNextActiveTimer()

CFileItemPtr CPVRTimers::GetNextActiveTimer ( void  ) const
Returns
The tv or radio timer that will be active next (state scheduled), or an empty fileitemptr if none.

§ GetNextActiveTVTimer()

CFileItemPtr CPVRTimers::GetNextActiveTVTimer ( void  ) const
Returns
The tv timer that will be active next (state scheduled), or an empty fileitemptr if none.

§ GetNextEventTime()

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

§ GetRecordingTimerForRecording()

CPVRTimerInfoTagPtr CPVRTimers::GetRecordingTimerForRecording ( const CPVRRecording recording) const

Get the timer currently recording the given recording, if any.

Parameters
recordingThe recording to check.
Returns
The requested timer tag, or an null if none was found.

§ 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 an empty fileitemptr 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 null 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.

§ HasActiveTimers()

bool CPVRTimers::HasActiveTimers ( void  ) const
Returns
True when there is at least one timer that is active (states scheduled or recording), false otherwise.

§ HasRecordingTimerForRecording()

bool CPVRTimers::HasRecordingTimerForRecording ( const CPVRRecording recording) const

Check whether there is a timer currently recording the given recording.

Parameters
recordingThe recording to check.
Returns
true if there is a timer currently recording the given recording, false otherwise.

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

§ 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 CPVRTimerInfoTagPtr tag,
const std::string &  strNewName 
)
static

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 channel list from the clients.

§ UpdateChannels()

void CPVRTimers::UpdateChannels ( void  )

Update the channel pointers.

§ UpdateTimer()

bool CPVRTimers::UpdateTimer ( const CPVRTimerInfoTagPtr tag)
static

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: