2#include <ossia/network/base/parameter.hpp>
4#include <ossia-qt/device/qml_node_base.hpp>
5#include <ossia-qt/qml_context.hpp>
18class OSSIA_EXPORT qml_parameter :
public qml_property_base
20 W_OBJECT(qml_parameter)
23 qml_parameter(QQuickItem* parent =
nullptr);
26 void resetNode()
override;
27 void setDevice(QObject* device)
override;
29 qml_val_type::val_type valueType()
const;
30 qml_access_mode::access_mode access()
const;
31 qml_bounding_mode::bounding_mode bounding()
const;
32 qml_rep_filter::repetition_filter filterRepetitions()
const;
35 QVariantList values()
const;
38 QVariant value()
const {
return m_value; }
42 E_SIGNAL(OSSIA_EXPORT, setValue_sig, arg_1);
44 void valueTypeChanged(qml_val_type::val_type valueType)
45 E_SIGNAL(OSSIA_EXPORT, valueTypeChanged, valueType);
46 void accessChanged(qml_access_mode::access_mode access)
47 E_SIGNAL(OSSIA_EXPORT, accessChanged, access);
48 void boundingChanged(qml_bounding_mode::bounding_mode bounding)
49 E_SIGNAL(OSSIA_EXPORT, boundingChanged, bounding);
50 void filterRepetitionsChanged(qml_rep_filter::repetition_filter filterRepetitions)
51 E_SIGNAL(OSSIA_EXPORT, filterRepetitionsChanged, filterRepetitions);
52 void minChanged(QVariant min) E_SIGNAL(OSSIA_EXPORT, minChanged, min);
53 void maxChanged(QVariant max) E_SIGNAL(OSSIA_EXPORT, maxChanged, max);
54 void valuesChanged(QVariantList values) E_SIGNAL(OSSIA_EXPORT, valuesChanged, values);
55 void unitChanged(QString unit) E_SIGNAL(OSSIA_EXPORT, unitChanged, unit);
57 void valueChanged(QVariant value) E_SIGNAL(OSSIA_EXPORT, valueChanged, value);
61 W_SLOT(setValue_slot);
63 void setValueType(qml_val_type::val_type valueType);
65 void setAccess(qml_access_mode::access_mode access);
67 void setBounding(qml_bounding_mode::bounding_mode bounding);
69 void setFilterRepetitions(qml_rep_filter::repetition_filter filterRepetitions);
70 W_SLOT(setFilterRepetitions);
71 void setMin(QVariant min);
73 void setMax(QVariant max);
75 void setValues(QVariantList values);
77 void setUnit(QString unit);
84 m_valueType = std::nullopt;
87 W_SLOT(resetValueType)
92 m_access = std::nullopt;
100 m_bounding = std::nullopt;
103 W_SLOT(resetBounding)
104 void resetFilterRepetitions()
106 if(m_filterRepetitions)
108 m_filterRepetitions = std::nullopt;
111 W_SLOT(resetFilterRepetitions)
112 void resetMin() { setMin(QVariant{}); };
114 void resetMax() { setMax(QVariant{}); };
120 m_values = std::nullopt;
128 m_values = std::nullopt;
132 void setValue(QVariant value);
136 void setupAddress(
bool reading);
140 std::optional<qml_val_type::val_type> m_valueType{};
141 std::optional<qml_access_mode::access_mode> m_access{};
142 std::optional<qml_bounding_mode::bounding_mode> m_bounding{};
143 std::optional<qml_rep_filter::repetition_filter> m_filterRepetitions{};
146 std::optional<QVariantList> m_values{};
147 std::optional<QString> m_unit{};
151 values READ values WRITE setValues NOTIFY valuesChanged RESET resetValues, W_Final)
154 QVariant, max READ max WRITE setMax NOTIFY maxChanged RESET resetMax, W_Final)
157 QVariant, min READ min WRITE setMin NOTIFY minChanged RESET resetMin, W_Final)
160 ossia::qt::qml_rep_filter::repetition_filter,
161 filterRepetitions READ filterRepetitions WRITE setFilterRepetitions NOTIFY
162 filterRepetitionsChanged RESET resetFilterRepetitions,
166 ossia::qt::qml_bounding_mode::bounding_mode,
167 bounding READ bounding WRITE setBounding NOTIFY boundingChanged RESET
172 ossia::qt::qml_access_mode::access_mode,
173 access READ access WRITE setAccess NOTIFY accessChanged RESET resetAccess, W_Final)
176 ossia::qt::qml_val_type::val_type,
177 valueType READ valueType WRITE setValueType NOTIFY valueTypeChanged RESET
182 QString, unit READ unit WRITE setUnit NOTIFY unitChanged RESET resetUnit, W_Final)
184 W_PROPERTY(QVariant, value READ value WRITE setValue NOTIFY valueChanged)
The value class.
Definition value.hpp:173
OSSIA_INLINE constexpr auto min(const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type
min function tailored for values
Definition math.hpp:125
OSSIA_INLINE constexpr auto max(const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type
max function tailored for values
Definition math.hpp:96