2 #include "AddressSettingsWidget.hpp"
4 #include <State/ValueConversion.hpp>
5 #include <State/Widgets/UnitWidget.hpp>
6 #include <State/Widgets/Values/NumericValueWidget.hpp>
8 #include <score/widgets/SpinBoxes.hpp>
10 #include <ossia/network/dataspace/dataspace_visitors.hpp>
11 #include <ossia/network/value/value_conversion.hpp>
20 static const constexpr
int min = 0;
21 static const constexpr
int max = 127;
26 static const constexpr
float min = 0.;
27 static const constexpr
float max = 1.;
36 using namespace score;
40 m_layout->insertRow(0, makeLabel(tr(
"Value"),
this), m_valueSBox);
41 m_layout->insertRow(1, makeLabel(tr(
"Domain"),
this), m_domainEdit);
43 connect(m_unit, &State::UnitWidget::unitChanged,
this, [
this](
const State::Unit& u) {
44 auto dom = ossia::get_unit_default_domain(u.get());
46 if(
auto p = dom.v.target<ossia::domain_base<float>>())
48 m_domainEdit->set_domain(dom);
52 m_valueSBox->setValue(0);
53 m_domainEdit->set_domain(
59 auto settings = getCommonSettings();
60 settings.value = T(m_valueSBox->value());
61 settings.domain = m_domainEdit->domain();
75 setCommonSettings(settings);
76 m_valueSBox->setValue(State::convert::value<T>(settings.value));
77 m_domainEdit->set_domain(settings.domain);
80 void setCanEditProperties(
bool b)
override
82 AddressSettingsWidget::setCanEditProperties(b);
83 m_domainEdit->setEnabled(b);
Definition: NumericValueWidget.hpp:129
The SpinBox class.
Definition: SpinBoxes.hpp:68
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: AddressSettings.hpp:49
Definition: AddressNumericSettingsWidget.hpp:16
The TemplatedSpinBox class.
Definition: SpinBoxes.hpp:19