2 #include <Process/Inspector/ProcessInspectorWidgetDelegate.hpp>
3 #include <Process/Inspector/ProcessInspectorWidgetDelegateFactory.hpp>
5 #include <Media/Step/Commands.hpp>
6 #include <Media/Step/Model.hpp>
8 #include <score/command/Dispatchers/OngoingCommandDispatcher.hpp>
9 #include <score/document/DocumentContext.hpp>
10 #include <score/widgets/DoubleSlider.hpp>
11 #include <score/widgets/SignalUtils.hpp>
13 #include <QFormLayout>
25 : InspectorWidgetDelegate_T{obj, parent}
26 , m_dispatcher{doc.dispatcher}
32 m_min.setRange(-100000, 100000);
33 m_max.setRange(-100000, 100000);
34 m_count.setRange(1, 24);
35 m_dur.setRange(1, 1000000);
36 m_count.setValue(obj.stepCount());
37 m_dur.setValue(obj.stepDuration());
38 m_min.setValue(obj.min());
39 m_max.setValue(obj.max());
41 auto lay =
new QFormLayout{
this};
43 con(process(), &Model::stepCountChanged,
this,
44 [&] { m_count.setValue(obj.stepCount()); });
45 con(process(), &Model::stepDurationChanged,
this,
46 [&] { m_dur.setValue(obj.stepDuration()); });
47 con(process(), &Model::minChanged,
this, [&] { m_min.setValue(obj.min()); });
48 con(process(), &Model::maxChanged,
this, [&] { m_max.setValue(obj.max()); });
50 con(m_count, &QSpinBox::editingFinished,
this, [&]() {
54 con(m_dur, &QSpinBox::editingFinished,
this, [&]() {
58 con(m_min, &QDoubleSpinBox::editingFinished,
this, [&]() {
62 con(m_max, &QDoubleSpinBox::editingFinished,
this, [&]() {
67 lay->addRow(tr(
"Count"), &m_count);
68 lay->addRow(tr(
"Duration (samples)"), &m_dur);
69 lay->addRow(tr(
"Min"), &m_min);
70 lay->addRow(tr(
"Max"), &m_max);
84 SCORE_CONCRETE(
"a7c0ecb5-70a1-476c-8187-075076e413d2")
The OngoingCommandDispatcher class.
Definition: OngoingCommandDispatcher.hpp:27
void submit(Args &&... args)
Definition: OngoingCommandDispatcher.hpp:37
void commit()
Definition: OngoingCommandDispatcher.hpp:61
Definition: DocumentContext.hpp:18