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

Used for a volume slider. More...

Classes

class  XBMCAddon::xbmcgui::ControlSlider
 

Functions

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

Function: getPercent()


Returns a float of the percent of the slider.
 
 XBMCAddon::xbmcgui::ControlSlider::setPercent (...)
 

Function: setPercent(pct)


Sets the percent of the slider.
 
 XBMCAddon::xbmcgui::ControlSlider::getInt ()
 

Function: getInt()


Returns the value of the slider.
 
 XBMCAddon::xbmcgui::ControlSlider::setInt (...)
 

Function: setInt(value, min, delta, max)


Sets the range, value and step size of the slider.
 
 XBMCAddon::xbmcgui::ControlSlider::getFloat ()
 

Function: getFloat()


Returns the value of the slider.
 
 XBMCAddon::xbmcgui::ControlSlider::setFloat (...)
 

Function: setFloat(value, min, delta, max)


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

Detailed Description

Used for a volume slider.

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

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))
texturebackdisabled[opt] string - image filename
texturedisabled[opt] string - image filename
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 ( )

Function: getFloat()


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

Function: getInt()


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

Function: getPercent()


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 ( ...)

Function: setFloat(value, min, delta, max)


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 ( ...)

Function: setInt(value, min, delta, max)


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 ( ...)

Function: setPercent(pct)


Sets the percent of the slider.

Parameters
pctfloat - Percent value of slider

Example:

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