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
+3 -2
View File
@@ -605,7 +605,8 @@ void ClapBridge::register_plugin_instance(
object_instances_.emplace(
instance_id, ClapPluginInstance(plugin, std::move(host_proxy)));
// Every plugin instance gets its own audio thread
// Every plugin instance gets its own audio thread along with sockets for
// host->plugin control messages and plugin->host callbacks
std::promise<void> socket_listening_latch;
object_instances_.at(instance_id).audio_thread_handler =
Win32Thread([&, instance_id]() {
@@ -619,7 +620,7 @@ void ClapBridge::register_plugin_instance(
"audio-" + std::to_string(instance_id);
pthread_setname_np(pthread_self(), thread_name.c_str());
sockets_.add_audio_thread_and_listen(
sockets_.add_audio_thread_and_listen_control(
instance_id, socket_listening_latch,
overload{
[&](const clap::plugin::StartProcessing& request)