2#include <ossia/dataflow/audio_port.hpp>
3#include <ossia/dataflow/graph_node.hpp>
4#include <ossia/dataflow/nodes/media.hpp>
5#include <ossia/dataflow/token_request.hpp>
12 int64_t next_sample_to_read{};
13 raw_stretcher() noexcept = default;
14 raw_stretcher(const raw_stretcher&) noexcept = default;
15 raw_stretcher(raw_stretcher&&) noexcept = default;
16 raw_stretcher& operator=(const raw_stretcher&) noexcept = default;
17 raw_stretcher& operator=(raw_stretcher&&) noexcept = default;
18 raw_stretcher(int64_t pos) noexcept
19 : next_sample_to_read{pos}
23 void transport(int64_t date) { next_sample_to_read = date; }
27 run(T& audio_fetcher,
const ossia::token_request& t,
const ossia::exec_state_facade e,
28 double tempo_ratio,
const std::size_t chan,
const int64_t len,
29 const int64_t samples_to_read,
const int64_t samples_to_write,
30 const int64_t samples_offset,
const ossia::mutable_audio_span<double>& ap)
noexcept
34 double** output = (
double**)alloca(
sizeof(
double*) * chan);
35 for(std::size_t i = 0; i < chan; i++)
36 output[i] = ap[i].data() + samples_offset;
38 audio_fetcher.fetch_audio(next_sample_to_read, samples_to_write, output);
39 next_sample_to_read += samples_to_write;