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

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>

Inheritance diagram for CSkinTimer:
CStopWatch

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 CGUIActionGetStartActions () const
 Gets the start actions of this skin timer.
 
const CGUIActionGetStopActions () 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().
 

Detailed Description

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.

See also
Skin_Timers

Constructor & Destructor Documentation

◆ CSkinTimer()

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.

Parameters
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)

◆ ~CSkinTimer()

virtual CSkinTimer::~CSkinTimer ( )
virtualdefault

Default skin timer destructor.

Member Function Documentation

◆ GetName()

const std::string & CSkinTimer::GetName ( ) const

Getter for the timer name.

Returns
the timer name

◆ GetResetCondition()

INFO::InfoPtr CSkinTimer::GetResetCondition ( ) const

Getter for the timer reset boolean condition/expression.

Returns
the reset boolean condition/expression (may be null)

◆ GetStartActions()

const CGUIAction & CSkinTimer::GetStartActions ( ) const

Gets the start actions of this skin timer.

Returns
the actions configured to start when the timer is started

◆ GetStartCondition()

INFO::InfoPtr CSkinTimer::GetStartCondition ( ) const

Getter for the timer start boolean condition/expression.

Returns
the start boolean condition/expression (may be null)

◆ GetStopActions()

const CGUIAction & CSkinTimer::GetStopActions ( ) const

Gets the stop actions of this skin timer.

Returns
the actions configured to start when the timer is stopped

◆ GetStopCondition()

INFO::InfoPtr CSkinTimer::GetStopCondition ( ) const

Getter for the timer start boolean condition/expression.

Returns
the start boolean condition/expression (may be null)

◆ Reset()

void CSkinTimer::Reset ( )

Resets the skin timer so that the elapsed time of the timer is 0.

◆ ResetsOnStart()

bool CSkinTimer::ResetsOnStart ( ) const

Checks if a given timer is configured to reset every time it starts.

Returns
true if the timer is configured to reset on start, false otherwise

◆ Start()

void CSkinTimer::Start ( )

Start the skin timer.

◆ Stop()

void CSkinTimer::Stop ( )

stops the skin timer

◆ VerifyResetCondition()

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

Returns
true if the condition is true, false otherwise

◆ VerifyStartCondition()

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

Returns
true if the condition is true, false otherwise

◆ VerifyStopCondition()

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

Returns
true if the condition is true, false otherwise

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