2#include <ossia/audio/audio_parameter.hpp>
3#include <ossia/audio/audio_tick.hpp>
4#include <ossia/detail/lockfree_queue.hpp>
10#include <ossia-config.hpp>
14class OSSIA_EXPORT audio_engine
17 explicit audio_engine();
18 virtual ~audio_engine();
20 virtual bool running()
const = 0;
21 virtual void wait(
int milliseconds);
27 using fun_type = smallfun::function<void(
const ossia::audio_tick_state&), 256>;
28 void set_tick(fun_type&& t);
29 void load_audio_tick();
32 ossia::spsc_queue<fun_type> tick_funlist;
35 ossia::spsc_queue<fun_type> tick_gc;
39 std::atomic_bool stop_processing{};
40 std::atomic_bool stop_received{};
42 int effective_sample_rate{};
43 int effective_buffer_size{};
44 int effective_inputs{};
45 int effective_outputs{};
47 void tick_start() { load_audio_tick(); }
48 void tick_clear() { stop_received =
true; }
52 std::shared_ptr<audio_engine> self;
53 std::atomic_int64_t request{-1};
54 std::atomic_int64_t reply{-1};
58ossia::audio_engine* make_audio_engine(
59 std::string proto, std::string name, std::string req_in, std::string req_out,
60 int& inputs,
int& outputs,
int& rate,
int& bs);