2#include <ossia/dataflow/audio_port.hpp>
3#include <ossia/dataflow/graph_node.hpp>
4#include <ossia/dataflow/midi_port.hpp>
5#include <ossia/dataflow/port.hpp>
8class forward_node :
public ossia::nonowning_graph_node
13 m_inlets.push_back(&audio_in);
15 m_outlets.push_back(&audio_out);
19 [[nodiscard]] std::string label() const noexcept
override {
return "forward_node"; }
20 void run(
const token_request& t, exec_state_facade)
noexcept override
25 ossia::audio_port& i = *audio_in;
26 ossia::audio_port& o = *audio_out;
27 if(!audio_out.has_gain)
39 process_audio_out_mono(i, audio_out);
43 process_audio_out_general(i, audio_out);
55 ossia::audio_inlet audio_in;
57 ossia::audio_outlet audio_out;
61class interval final :
public forward_node
64 using forward_node::forward_node;
68 if(m_inlets.size() == 4)
76 [[nodiscard]] std::string label() const noexcept
override {
return "Interval"; }
78 void run(
const token_request& t, exec_state_facade f)
noexcept override
80 forward_node::run(t, f);
81 if(m_inlets.size() >= 4)
84 ossia::value_port& vp = *m_inlets[1]->target<ossia::value_port>();
85 if(
auto& data = vp.get_data(); !data.empty())
87 tempo = ossia::convert<float>(data.back().value);
91 ossia::value_port& vp = *m_inlets[3]->target<ossia::value_port>();
92 if(
auto& data = vp.get_data(); !data.empty())
94 float seek_ms = ossia::convert<float>(data.back().value);
95 seek = ossia::flicks_per_millisecond<double> * seek_ms;
101 static const constexpr float no_tempo = -1000.f;
102 float tempo{no_tempo};
103 int64_t seek{std::numeric_limits<int64_t>::min()};
105class loop final :
public forward_node
108 using forward_node::forward_node;
109 [[nodiscard]] std::string label() const noexcept
override {
return "Loop"; }
111class scenario final :
public forward_node
114 using forward_node::forward_node;
115 [[nodiscard]] std::string label() const noexcept
override {
return "Scenario"; }