18 Q_PROPERTY (
float value READ value WRITE setValue NOTIFY valueChanged)
24 AutomationPoint (
const dsp::TempoMap &tempo_map, QObject * parent =
nullptr);
25 Z_DISABLE_COPY_MOVE (AutomationPoint)
26 ~AutomationPoint ()
override;
32 float value ()
const {
return normalized_value_; }
33 void setValue (
float dval)
35 const auto val = dval;
36 if (qFuzzyCompare (normalized_value_, val))
39 normalized_value_ = val;
40 Q_EMIT valueChanged (dval);
42 Q_SIGNAL
void valueChanged (
float);
46 return curve_opts_adapter_.get ();
52 friend void init_from (
54 const AutomationPoint &other,
57 static constexpr auto kNormalizedValueKey =
"normalized_value"sv;
58 static constexpr auto kCurveOptionsKey =
"curve_options"sv;
59 friend void to_json (nlohmann::json &j,
const AutomationPoint &point)
62 j[kNormalizedValueKey] = point.normalized_value_;
63 j[kCurveOptionsKey] = point.curve_opts_;
65 friend void from_json (
const nlohmann::json &j, AutomationPoint &point)
68 j.at (kNormalizedValueKey).get_to (point.normalized_value_);
69 j.at (kCurveOptionsKey).get_to (point.curve_opts_);
74 float normalized_value_ = 0.f;
79 BOOST_DESCRIBE_CLASS (
84 (normalized_value_, curve_opts_))