3 #include <ossia/dataflow/exec_state_facade.hpp>
4 #include <ossia/dataflow/token_request.hpp>
5 #include <ossia/editor/scenario/time_value.hpp>
6 #include <ossia/math/math_expression.hpp>
8 #include <halp/audio.hpp>
9 #include <halp/controls.hpp>
10 #include <halp/meta.hpp>
11 #include <halp/midi.hpp>
16 template <
typename State>
17 static void setMathExpressionTiming(
18 State&
self, int64_t input_time, int64_t prev_time, std::integral
auto parent_dur)
21 template <
typename State>
22 static void setMathExpressionTiming(
23 State&
self, int64_t input_time, int64_t prev_time,
24 std::floating_point
auto parent_dur)
26 self.cur_time = input_time;
27 self.cur_deltatime = (input_time - prev_time);
28 self.cur_pos = parent_dur > 0 ? double(input_time) / parent_dur : 0;
31 template <
typename State>
32 static void setMathExpressionTiming(
33 State&
self, ossia::time_value input_time, ossia::time_value prev_time,
34 ossia::time_value parent_dur,
double modelToSamples)
36 setMathExpressionTiming(
37 self, input_time.impl * modelToSamples, prev_time.impl * modelToSamples,
38 parent_dur.impl * modelToSamples);
47 template <
typename State>
48 static void setMathExpressionTiming(
State&
self,
const halp::tick_flicks& tk)
50 self.cur_time = tk.end_in_flicks;
51 self.cur_deltatime = tk.end_in_flicks - tk.start_in_flicks;
52 self.cur_pos = tk.parent_duration > 0 ? tk.relative_position : 0.;
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33