Add CLAP audio thread callback sockets

The initialization here is a bit funky and happens in lockstep to ensure
both sides are synchronized.
This commit is contained in:
Robbert van der Helm
2022-09-26 16:28:30 +02:00
parent da97885062
commit 0d472dcd58
5 changed files with 220 additions and 54 deletions
@@ -17,6 +17,7 @@
#pragma once
#include <future>
#include <thread>
#include <vector>
#include <clap/ext/audio-ports.h>
@@ -201,6 +202,13 @@ class clap_plugin_proxy {
*/
ClapHostExtensions host_extensions_;
/**
* A handler for receiving audio thread callbacks. Set when initializing the
* plugin. This is needed to minimize blocking during those callbacks, as
* certain CLAP extensions allow callbacks on the audio thread.
*/
std::jthread audio_thread_handler_;
private:
ClapPluginBridge& bridge_;
size_t instance_id_;