2#include <ossia/dataflow/graph_node.hpp>
3#include <ossia/dataflow/port.hpp>
4#include <ossia/detail/pod_vector.hpp>
8class step final :
public ossia::graph_node
11 step() { m_outlets.push_back(
new ossia::value_outlet); }
13 ~step()
override =
default;
15 void run(
const ossia::token_request& t, ossia::exec_state_facade e)
noexcept override
21 auto& port = *m_outlets[0]->target<ossia::value_port>();
22 const int64_t d = dur.impl * e.samplesToModel();
23 int64_t quo = std::floor(
double(t.date.impl) / d);
24 int64_t prev_step = d * quo;
26 while(t.in_range(time_value{prev_step}))
29 values[quo % values.size()],
30 t.to_physical_time_in_tick(prev_step, e.modelToSamples()));
36 ossia::float_vector values;
39 [[nodiscard]] std::string label() const noexcept
override {
return "Step"; }
The time_value class.
Definition ossia/editor/scenario/time_value.hpp:30