2#include <ossia/dataflow/graph_node.hpp>
3#include <ossia/dataflow/nodes/sound.hpp>
4#include <ossia/dataflow/nodes/sound_sampler.hpp>
5#include <ossia/dataflow/nodes/sound_utils.hpp>
9class sound_ref final :
public ossia::sound_node
12 sound_ref() { m_outlets.push_back(&audio_out); }
14 ~sound_ref() =
default;
16 [[nodiscard]] std::string label() const noexcept
override {
return "sound_ref"; }
18 void transport(time_value date)
override { m_sampler.transport(date); }
20 void set_start(std::size_t v) { m_sampler.set_start(v); }
22 void set_upmix(std::size_t v) { m_sampler.set_upmix(v); }
25 void set_sound(audio_array data) { m_sampler.set_sound(std::move(data)); }
27 void set_sound(
const audio_handle& hdl,
int channels,
int sampleRate)
29 m_sampler.set_sound(hdl, channels, sampleRate);
32 void run(
const ossia::token_request& t, ossia::exec_state_facade e)
noexcept override
34 return m_sampler.run(t, e);
37 ossia::audio_outlet audio_out;
38 sound_sampler m_sampler{
this, &audio_out.data};