Loading...
Searching...
No Matches
score-plugin-clap/Clap/Executor.hpp
1#pragma once
2#include <Process/Execution/ProcessComponent.hpp>
3
4#include <ossia/dataflow/graph_node.hpp>
5#include <ossia/dataflow/node_process.hpp>
6#include <ossia/dataflow/port.hpp>
7
8#include <Clap/EffectModel.hpp>
9#include <clap/all.h>
10
11#include <QByteArray>
12
13#include <verdigris>
14
15class QTimer;
16
17namespace Clap
18{
19
20class Executor final
21 : public Execution::ProcessComponent_T<Clap::Model, ossia::node_process>
22{
23 COMPONENT_METADATA("4607e18f-6400-4f93-9ce0-c79477b2124b")
24
25public:
26 static constexpr bool is_unique = true;
27
28 Executor(Clap::Model& proc, const Execution::Context& ctx, QObject* parent);
29
30private:
31 template <typename Node_T>
32 void setupNode(Node_T& node);
33
34 // Monophonic polyphonic-pool growth (see clap_node_mono in Executor.cpp).
35 // Audio thread sets m_requested_pool on the node; this timer (main thread)
36 // notices, creates plug-in instances in small batches, clones state, and
37 // pushes them through the SPSC queue. Monotonic — we never shrink.
38 void grow_pool_tick();
39 QTimer* m_grow_timer{};
40 std::size_t m_pool_pushed{0};
41 std::size_t m_pool_max_requested{0};
42 double m_pool_sample_rate{0.0};
43 int m_pool_buffer_size{0};
44};
46}
Definition score-plugin-clap/Clap/Executor.hpp:22
Definition Process/Execution/ProcessComponent.hpp:123
Definition ExecutionContext.hpp:196
Definition Process/Execution/ProcessComponent.hpp:93