Kodi Community Forum

Full Version: Slider with <info>
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The documentation on slider control says the info tag
Quote:Specifies the information that the slider controls.

This is a bit cryptic, but I interpret this as meaning I can do this:

Code:
<info>Window.Property(SliderValue)</info>

then in my script:

Code:
slidervalue = WINDOW.getProperty('SliderValue')

This doesn't work. I can't find examples of <info> in action. Can someone clarify what this tag does?
It only supports volume and seek I think it is - basically there needs to be code within the slider so it knows what to do with that property.
(2013-12-27, 01:50)jmarshall Wrote: [ -> ]basically there needs to be code within the slider so it knows what to do with that property.

I don't understand. Do you mean that something needs to be added to XBMC source, or do you mean that there's something I can add to my control to make it work? If the latter, can you give an example?
The source. If you check guilib/GUISliderControl.cpp you'll see it specifically handles a small number of properties/events.
OK. To clarify, can you confirm that the only thing a slider (<control type="slider">) can ever control is volume and seek?

The documentation says "such as" suggesting volume and seek are just examples of the many things a slider can control.

Would a <control type="sliderex"> be able to control a window property? Are there any examples of sliderex controlling something with the <info> tag?
No. As I said, only the stuff in guilib/GUISliderControl.cpp can be controlled.
If the slider will only control seek or volume, as the code implies, what is the point of the <info> tag? Does it do anything at all?
(2017-10-16, 04:32)aegidius Wrote: [ -> ]If the slider will only control seek or volume, as the code implies, what is the point of the <info> tag? Does it do anything at all?

Answered my own question with a little reading in the source code....
it seems that sliders can only have two actions, volume or seek, or else no action at all. (this from xbmc/xbmc/guilib/GUISliderControl.cpp )
Code:
static const SliderAction actions[] = {
 {"seek",    "PlayerControl(SeekPercentage(%2f))", PLAYER_PROGRESS, false},
 {"volume",  "SetVolume(%2f)",                     PLAYER_VOLUME,   true}
};

If a slider has an action then the info tag is overridden by that from the table above:

Code:
int infoCode = m_iInfoCode;
 if (m_action && (!m_dragging || m_action->fireOnDrag))
infoCode = m_action->infoCode;

But if the slider is to display something else, then it must have a null action.
So the way to get some other info to display with a seek slider, is to have two sliders: the first to display the nib, with (say) PVR.Progress, and the second with no nib to do that seek action.