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

Class: kodi::gui::controls::CSettingsSlider

Window control for moveable slider with text name
The settings slider control is used in the settings screens for when an option is best specified on a sliding scale. More...

Functions

 kodi::gui::controls::CSettingsSlider::CSettingsSlider (CWindow *window, int controlId)
 Construct a new control.
 
 kodi::gui::controls::CSettingsSlider::~CSettingsSlider () override=default
 Destructor.
 
void kodi::gui::controls::CSettingsSlider::SetVisible (bool visible)
 Set the control on window to visible.
 
void kodi::gui::controls::CSettingsSlider::SetEnabled (bool enabled)
 Set's the control's enabled/disabled state.
 
void kodi::gui::controls::CSettingsSlider::SetText (const std::string &text)
 To set the text string on settings slider.
 
void kodi::gui::controls::CSettingsSlider::Reset ()
 To reset slider on defaults.
 
void kodi::gui::controls::CSettingsSlider::SetIntRange (int start, int end)
 To set the the range as integer of slider, e.g. -10 is the slider start and e.g. +10 is the from here defined position where it reach the end.
 
void kodi::gui::controls::CSettingsSlider::SetIntValue (int value)
 Set the slider position with the given integer value. The Range must be defined with a call from SetIntRange before.
 
int kodi::gui::controls::CSettingsSlider::GetIntValue () const
 To get the current position as integer value.
 
void kodi::gui::controls::CSettingsSlider::SetIntInterval (int interval)
 To set the interval steps of slider, as default is it 1. If it becomes changed with this function will a step of the user with the value fixed here be executed.
 
void kodi::gui::controls::CSettingsSlider::SetPercentage (float percent)
 Sets the percent of the slider.
 
float kodi::gui::controls::CSettingsSlider::GetPercentage () const
 Returns a float of the percent of the slider.
 
void kodi::gui::controls::CSettingsSlider::SetFloatRange (float start, float end)
 To set the the range as float of slider, e.g. -25.0 is the slider start and e.g. +25.0 is the from here defined position where it reach the end.
 
void kodi::gui::controls::CSettingsSlider::SetFloatValue (float value)
 Set the slider position with the given float value. The Range can be defined with a call from SetIntRange before, as default it is 0.0 to 1.0.
 
float kodi::gui::controls::CSettingsSlider::GetFloatValue () const
 To get the current position as float value.
 
void kodi::gui::controls::CSettingsSlider::SetFloatInterval (float interval)
 To set the interval steps of slider, as default is it 0.1 If it becomes changed with this function will a step of the user with the value fixed here be executed.
 

Detailed Description

Class: kodi::gui::controls::CSettingsSlider

Window control for moveable slider with text name
The settings slider control is used in the settings screens for when an option is best specified on a sliding scale.

You can choose the position, size, and look of the slider control. It is basically a cross between the button control and a slider control. It has a label and focus and non focus textures, as well as a slider control on the right.

It has the header #include <kodi/gui/controls/SettingsSlider.h> be included to enjoy it.

Here you find the needed skin part for a settings slider control.

Note
The call of the control is only possible from the corresponding window as its class and identification number is required.

Function Documentation

◆ CSettingsSlider()

kodi::gui::controls::CSettingsSlider::CSettingsSlider ( CWindow * window,
int controlId )
inline

Construct a new control.

Parameters
[in]windowRelated window control class
[in]controlIdUsed skin xml control id

◆ GetFloatValue()

float kodi::gui::controls::CSettingsSlider::GetFloatValue ( ) const
inline

To get the current position as float value.

Returns
The position as float

◆ GetIntValue()

int kodi::gui::controls::CSettingsSlider::GetIntValue ( ) const
inline

To get the current position as integer value.

Returns
The position as integer
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ GetPercentage()

float kodi::gui::controls::CSettingsSlider::GetPercentage ( ) const
inline

Returns a float of the percent of the slider.

Returns
float - Percent of slider
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ Reset()

void kodi::gui::controls::CSettingsSlider::Reset ( )
inline

To reset slider on defaults.

◆ SetEnabled()

void kodi::gui::controls::CSettingsSlider::SetEnabled ( bool enabled)
inline

Set's the control's enabled/disabled state.

Parameters
[in]enabledIf true enabled, otherwise disabled

◆ SetFloatInterval()

void kodi::gui::controls::CSettingsSlider::SetFloatInterval ( float interval)
inline

To set the interval steps of slider, as default is it 0.1 If it becomes changed with this function will a step of the user with the value fixed here be executed.

Parameters
[in]intervalIntervall step to set.
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetFloatRange()

void kodi::gui::controls::CSettingsSlider::SetFloatRange ( float start,
float end )
inline

To set the the range as float of slider, e.g. -25.0 is the slider start and e.g. +25.0 is the from here defined position where it reach the end.

As default is the range 0.0 to 1.0.

The float interval is as default 0.1 and can be changed with SetFloatInterval.

Parameters
[in]startInteger start value
[in]endInteger end value
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetFloatValue()

void kodi::gui::controls::CSettingsSlider::SetFloatValue ( float value)
inline

Set the slider position with the given float value. The Range can be defined with a call from SetIntRange before, as default it is 0.0 to 1.0.

Parameters
[in]valuePosition in range to set with float
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetIntInterval()

void kodi::gui::controls::CSettingsSlider::SetIntInterval ( int interval)
inline

To set the interval steps of slider, as default is it 1. If it becomes changed with this function will a step of the user with the value fixed here be executed.

Parameters
[in]intervalIntervall step to set.
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetIntRange()

void kodi::gui::controls::CSettingsSlider::SetIntRange ( int start,
int end )
inline

To set the the range as integer of slider, e.g. -10 is the slider start and e.g. +10 is the from here defined position where it reach the end.

Ad default is the range from 0 to 100.

The integer interval is as default 1 and can be changed with SetIntInterval.

Parameters
[in]startInteger start value
[in]endInteger end value
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetIntValue()

void kodi::gui::controls::CSettingsSlider::SetIntValue ( int value)
inline

Set the slider position with the given integer value. The Range must be defined with a call from SetIntRange before.

Parameters
[in]valuePosition in range to set with integer
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetPercentage()

void kodi::gui::controls::CSettingsSlider::SetPercentage ( float percent)
inline

Sets the percent of the slider.

Parameters
[in]percentfloat - Percent value of slide
Note
Percent, floating point or integer are alone possible. Combining these different values can be not together and can, therefore, only one each can be used.

◆ SetText()

void kodi::gui::controls::CSettingsSlider::SetText ( const std::string & text)
inline

To set the text string on settings slider.

Parameters
[in]textText to show

◆ SetVisible()

void kodi::gui::controls::CSettingsSlider::SetVisible ( bool visible)
inline

Set the control on window to visible.

Parameters
[in]visibleIf true visible, otherwise hidden

◆ ~CSettingsSlider()

kodi::gui::controls::CSettingsSlider::~CSettingsSlider ( )
overridedefault

Destructor.