11 #include "../../c-api/gui/controls/spin.h"
12 #include "../Window.h"
129 m_controlHandle = m_interface->kodi_gui->window->get_control_spin(
130 m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
131 if (!m_controlHandle)
133 "kodi::gui::controls::CSpin can't create control class from Kodi !!!");
152 m_interface->kodi_gui->control_spin->set_visible(m_interface->kodiBase, m_controlHandle,
165 m_interface->kodi_gui->control_spin->set_enabled(m_interface->kodiBase, m_controlHandle,
178 m_interface->kodi_gui->control_spin->set_text(m_interface->kodiBase, m_controlHandle,
189 m_interface->kodi_gui->control_spin->reset(m_interface->kodiBase, m_controlHandle);
203 m_interface->kodi_gui->control_spin->set_type(m_interface->kodiBase, m_controlHandle,
217 void AddLabel(
const std::string& label,
const std::string& value)
219 m_interface->kodi_gui->control_spin->add_string_label(m_interface->kodiBase, m_controlHandle,
220 label.c_str(), value.c_str());
235 m_interface->kodi_gui->control_spin->add_int_label(m_interface->kodiBase, m_controlHandle,
236 label.c_str(), value);
250 m_interface->kodi_gui->control_spin->set_string_value(m_interface->kodiBase, m_controlHandle,
266 char* ret = m_interface->kodi_gui->control_spin->get_string_value(m_interface->kodiBase,
270 if (std::strlen(ret))
272 m_interface->free_string(m_interface->kodiBase, ret);
295 m_interface->kodi_gui->control_spin->set_int_range(m_interface->kodiBase, m_controlHandle,
313 m_interface->kodi_gui->control_spin->set_int_value(m_interface->kodiBase, m_controlHandle,
330 return m_interface->kodi_gui->control_spin->get_int_value(m_interface->kodiBase,
355 m_interface->kodi_gui->control_spin->set_float_range(m_interface->kodiBase, m_controlHandle,
374 m_interface->kodi_gui->control_spin->set_float_value(m_interface->kodiBase, m_controlHandle,
387 return m_interface->kodi_gui->control_spin->get_float_value(m_interface->kodiBase,
406 m_interface->kodi_gui->control_spin->set_float_interval(m_interface->kodiBase, m_controlHandle,
Definition: ListItem.h:26
@ ADDON_LOG_FATAL
4 : To notify fatal unrecoverable errors, which can may also indicate upcoming crashes.
Definition: addon_base.h:187
CSpin(CWindow *window, int controlId)
Construct a new control.
Definition: Spin.h:127
void SetFloatInterval(float interval)
To set the interval steps of spin, as default is it 0.1 If it becomes changed with this function will...
Definition: Spin.h:404
void 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...
Definition: Spin.h:293
void SetIntValue(int value)
Set the slider position with the given integer value. The Range must be defined with a call from SetI...
Definition: Spin.h:311
void SetType(AddonGUISpinControlType type)
To set the with SpinControlType defined types of spin.
Definition: Spin.h:201
void SetStringValue(const std::string &value)
To change the spin to position with them string as value.
Definition: Spin.h:248
void Reset()
To reset spin control to defaults.
Definition: Spin.h:187
float GetFloatValue() const
To get the current position as float value.
Definition: Spin.h:385
void SetVisible(bool visible)
Set the control on window to visible.
Definition: Spin.h:150
void SetText(const std::string &text)
To set the text string on spin control.
Definition: Spin.h:176
void AddLabel(const std::string &label, const std::string &value)
To add a label entry in spin defined with a value as string.
Definition: Spin.h:217
AddonGUISpinControlType
The values here defines the used value format for steps on spin control.
Definition: Spin.h:105
~CSpin() override=default
Destructor.
void SetEnabled(bool enabled)
Set's the control's enabled/disabled state.
Definition: Spin.h:163
void SetFloatValue(float value)
Set the spin position with the given float value. The Range can be defined with a call from SetIntRan...
Definition: Spin.h:372
int GetIntValue() const
To get the current position as integer value.
Definition: Spin.h:328
std::string GetStringValue() const
To get the current spin control position with text string value.
Definition: Spin.h:263
void AddLabel(const std::string &label, int value)
To add a label entry in spin defined with a value as integer.
Definition: Spin.h:233
void SetFloatRange(float start, float end)
To set the the range as float of spin, e.g. -25.0 is the spin start and e.g. +25.0 is the from here d...
Definition: Spin.h:353
@ ADDON_SPIN_CONTROL_TYPE_TEXT
One spin step interpreted as text string.
Definition: Spin.h:111
@ ADDON_SPIN_CONTROL_TYPE_PAGE
One spin step interpreted as a page change value.
Definition: Spin.h:113
@ ADDON_SPIN_CONTROL_TYPE_INT
One spin step interpreted as integer.
Definition: Spin.h:107
@ ADDON_SPIN_CONTROL_TYPE_FLOAT
One spin step interpreted as floating point value.
Definition: Spin.h:109
void ATTRIBUTE_HIDDEN Log(const AddonLog loglevel, const char *format,...)
Add a message to Kodi's log.
Definition: AddonBase.h:749