Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Skin timers are skin objects that dependent on time and can be fully controlled from skins either using boolean conditions or builtin functions. This class represents the Skin Timer object. More...
#include <SkinTimer.h>
Public Member Functions | |
CSkinTimer (const std::string &name, const INFO::InfoPtr &startCondition, const INFO::InfoPtr &resetCondition, const INFO::InfoPtr &stopCondition, const CGUIAction &startActions, const CGUIAction &stopActions, bool resetOnStart) | |
Skin timer constructor. | |
virtual | ~CSkinTimer ()=default |
Default skin timer destructor. | |
void | Start () |
Start the skin timer. | |
void | Reset () |
Resets the skin timer so that the elapsed time of the timer is 0. | |
void | Stop () |
stops the skin timer | |
const std::string & | GetName () const |
Getter for the timer name. | |
INFO::InfoPtr | GetStartCondition () const |
Getter for the timer start boolean condition/expression. | |
INFO::InfoPtr | GetResetCondition () const |
Getter for the timer reset boolean condition/expression. | |
INFO::InfoPtr | GetStopCondition () const |
Getter for the timer start boolean condition/expression. | |
bool | ResetsOnStart () const |
Checks if a given timer is configured to reset every time it starts. | |
const CGUIAction & | GetStartActions () const |
Gets the start actions of this skin timer. | |
const CGUIAction & | GetStopActions () const |
Gets the stop actions of this skin timer. | |
bool | VerifyStartCondition () const |
Evaluates the timer start boolean info expression returning the respective result. | |
bool | VerifyResetCondition () const |
Evaluates the timer reset boolean info expression returning the respective result. | |
bool | VerifyStopCondition () const |
Evaluates the timer stop boolean info expression returning the respective result. | |
Public Member Functions inherited from CStopWatch | |
CStopWatch ()=default | |
~CStopWatch ()=default | |
bool | IsRunning () const |
Retrieve the running state of the stopwatch. | |
void | StartZero () |
Record start time and change state to running. | |
void | Start () |
Record start time and change state to running, only if the stopwatch is stopped. | |
void | Stop () |
Record stop time and change state to not running. | |
void | Reset () |
Set the start time such that time elapsed is now zero. | |
float | GetElapsedSeconds () const |
Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running, now; if stopped, the last call to Stop(). | |
float | GetElapsedMilliseconds () const |
Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running, now; if stopped, the last call to Stop(). | |
Skin timers are skin objects that dependent on time and can be fully controlled from skins either using boolean conditions or builtin functions. This class represents the Skin Timer object.
CSkinTimer::CSkinTimer | ( | const std::string & | name, |
const INFO::InfoPtr & | startCondition, | ||
const INFO::InfoPtr & | resetCondition, | ||
const INFO::InfoPtr & | stopCondition, | ||
const CGUIAction & | startActions, | ||
const CGUIAction & | stopActions, | ||
bool | resetOnStart ) |
Skin timer constructor.
name | - the name of the timer |
startCondition | - the boolean info expression to start the timer (may be null) |
resetCondition | - the boolean info expression to reset the timer (may be null) |
stopCondition | - the boolean info expression to stop the timer (may be null) |
startActions | - the builtin functions to execute on timer start (actions may be empty) |
stopActions | - the builtin functions to execute on timer stop (actions may be empty) |
resetOnStart | - if the timer should be reset when started (i.e. start from zero if true or resumed if false) |
|
virtualdefault |
Default skin timer destructor.
const std::string & CSkinTimer::GetName | ( | ) | const |
Getter for the timer name.
INFO::InfoPtr CSkinTimer::GetResetCondition | ( | ) | const |
Getter for the timer reset boolean condition/expression.
const CGUIAction & CSkinTimer::GetStartActions | ( | ) | const |
Gets the start actions of this skin timer.
INFO::InfoPtr CSkinTimer::GetStartCondition | ( | ) | const |
Getter for the timer start boolean condition/expression.
const CGUIAction & CSkinTimer::GetStopActions | ( | ) | const |
Gets the stop actions of this skin timer.
INFO::InfoPtr CSkinTimer::GetStopCondition | ( | ) | const |
Getter for the timer start boolean condition/expression.
void CSkinTimer::Reset | ( | ) |
Resets the skin timer so that the elapsed time of the timer is 0.
bool CSkinTimer::ResetsOnStart | ( | ) | const |
Checks if a given timer is configured to reset every time it starts.
void CSkinTimer::Start | ( | ) |
Start the skin timer.
void CSkinTimer::Stop | ( | ) |
stops the skin timer
bool CSkinTimer::VerifyResetCondition | ( | ) | const |
Evaluates the timer reset boolean info expression returning the respective result.
Called from the skin timer manager to check if the timer should be reset to 0
bool CSkinTimer::VerifyStartCondition | ( | ) | const |
Evaluates the timer start boolean info expression returning the respective result.
Called from the skin timer manager to check if the timer should be started
bool CSkinTimer::VerifyStopCondition | ( | ) | const |
Evaluates the timer stop boolean info expression returning the respective result.
Called from the skin timer manager to check if the timer should be stopped