Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
Subclass - ControlSlider

Used for a volume slider. More...

Classes

class  XBMCAddon::xbmcgui::ControlSlider
 

Functions

 XBMCAddon::xbmcgui::ControlSlider::getPercent ()
 
 XBMCAddon::xbmcgui::ControlSlider::setPercent (...)
 
 XBMCAddon::xbmcgui::ControlSlider::getInt ()
 
 XBMCAddon::xbmcgui::ControlSlider::setInt (...)
 
 XBMCAddon::xbmcgui::ControlSlider::getFloat ()
 
 XBMCAddon::xbmcgui::ControlSlider::setFloat (...)
 

Detailed Description

Used for a volume slider.

Class: ControlSlider(x, y, width, height[, textureback, texture, texturefocus, orientation])

The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.

Note
This class include also all calls from Control
Parameters
xinteger - x coordinate of control
yinteger - y coordinate of control
widthinteger - width of control
heightinteger - height of control
textureback[opt] string - image filename
texture[opt] string - image filename
texturefocus[opt] string - image filename
orientation[opt] integer - orientation of slider (xbmcgui.HORIZONTAL / xbmcgui.VERTICAL (default))
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().

v17 Python API changes:
orientation option added.

Example:

...
self.slider = xbmcgui.ControlSlider(100, 250, 350, 40)
...

Function Documentation

◆ getFloat()

float XBMCAddon::xbmcgui::ControlSlider::getFloat ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getFloat() </big></font></span></code></h4> \endhtmlonly

Returns the value of the slider.

Returns
float - value of slider

v18 Python API changes:
New function added.

Example:

...
print(self.slider.getFloat())
...

◆ getInt()

int XBMCAddon::xbmcgui::ControlSlider::getInt ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getInt() </big></font></span></code></h4> \endhtmlonly

Returns the value of the slider.

Returns
int - value of slider

v18 Python API changes:
New function added.

Example:

...
print(self.slider.getInt())
...

◆ getPercent()

float XBMCAddon::xbmcgui::ControlSlider::getPercent ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getPercent() </big></font></span></code></h4> \endhtmlonly

Returns a float of the percent of the slider.

Returns
float - Percent of slider

Example:

...
print(self.slider.getPercent())
...

◆ setFloat()

void XBMCAddon::xbmcgui::ControlSlider::setFloat (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setFloat(value, min, delta, max) </big></font></span></code></h4> \endhtmlonly

Sets the range, value and step size of the slider.

Parameters
valuefloat - value of slider
minfloat - min of slider
deltafloat - step size of slider
maxfloat - max of slider

v18 Python API changes:
New function added.

Example:

...
self.slider.setFloat(15.0, 10.0, 1.0, 20.0)
...

◆ setInt()

void XBMCAddon::xbmcgui::ControlSlider::setInt (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setInt(value, min, delta, max) </big></font></span></code></h4> \endhtmlonly

Sets the range, value and step size of the slider.

Parameters
valueint - value of slider
minint - min of slider
deltaint - step size of slider
maxint - max of slider

v18 Python API changes:
New function added.

Example:

...
self.slider.setInt(450, 200, 10, 900)
...

◆ setPercent()

void XBMCAddon::xbmcgui::ControlSlider::setPercent (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setPercent(pct) </big></font></span></code></h4> \endhtmlonly

Sets the percent of the slider.

Parameters
pctfloat - Percent value of slider

Example:

...
self.slider.setPercent(50)
...