2 #include <Curve/Segment/PointArray/PointArraySegment.hpp>
4 #include <Automation/AutomationModel.hpp>
5 #include <Recording/Record/RecordManager.hpp>
19 void operator()(
const RecordData& proc,
const TimeVal& msecs,
double msec,
float val)
21 auto last = proc.segment.points().rbegin();
22 proc.segment.addPoint(msec - 1, last->second);
23 proc.segment.addPoint(msec, val);
38 void operator()(
const RecordData& proc,
const TimeVal& msecs,
double msec,
float val)
40 proc.segment.addPoint(msec, val);
45 template <
typename RecordingPolicy>
52 void operator()(std::array<float, 2> val)
54 const double msec = msecs.msec();
55 auto it = recorder.vec2_records.find(addr);
56 SCORE_ASSERT(it != recorder.vec2_records.end());
58 const auto& proc_data = it->second;
60 const constexpr std::size_t N = 2;
61 for(std::size_t i = 0; i < N; i++)
63 RecordingPolicy{}(proc_data[i], msecs, msec, val[i]);
67 void operator()(std::array<float, 3> val)
69 const double msec = msecs.msec();
70 auto it = recorder.vec3_records.find(addr);
71 SCORE_ASSERT(it != recorder.vec3_records.end());
73 const auto& proc_data = it->second;
75 const constexpr std::size_t N = 3;
76 for(std::size_t i = 0; i < N; i++)
78 RecordingPolicy{}(proc_data[i], msecs, msec, val[i]);
82 void operator()(std::array<float, 4> val)
84 const double msec = msecs.msec();
85 auto it = recorder.vec4_records.find(addr);
86 SCORE_ASSERT(it != recorder.vec4_records.end());
88 const auto& proc_data = it->second;
90 const constexpr std::size_t N = 4;
91 for(std::size_t i = 0; i < N; i++)
93 RecordingPolicy{}(proc_data[i], msecs, msec, val[i]);
97 void handle_numeric(
float newval)
99 const double msec = msecs.msec();
100 auto it = recorder.numeric_records.find(addr);
101 SCORE_ASSERT(it != recorder.numeric_records.end());
105 RecordingPolicy{}(proc_data, msecs, msec, newval);
108 void operator()(
float f) { handle_numeric(f); }
110 void operator()(
int f) { handle_numeric(f); }
112 void operator()(
char f) { handle_numeric(f); }
114 void operator()(
bool f) { handle_numeric(f); }
116 template <
typename... T>
117 void operator()(
const T&...)
Definition: AutomationModel.hpp:36
Definition: RecordManager.hpp:27
The MessagePolicy struct.
Definition: RecordAutomationParameterCallbackVisitor.hpp:37
The ParameterPolicy struct.
Definition: RecordAutomationParameterCallbackVisitor.hpp:18
Definition: RecordAutomationParameterCallbackVisitor.hpp:47
Definition: RecordData.hpp:26
The Address struct.
Definition: Address.hpp:58
Definition: TimeValue.hpp:21