Add audio thread callbacks

This commit is contained in:
Robbert van der Helm
2022-09-26 16:45:05 +02:00
parent 0d472dcd58
commit 214ba51010
2 changed files with 33 additions and 0 deletions
+11
View File
@@ -246,6 +246,17 @@ class ClapBridge : public HostBridge {
object, std::nullopt);
}
/**
* Send a callback message to the host from a plugin instance's audio
* thread. This is separate from `send_message()`, which shares one socket
* for all plugin instances.
*/
template <typename T>
typename T::Response send_audio_thread_message(const T& object) {
return sockets_.send_audio_thread_callback_message(
object, std::pair<ClapLogger&, bool>(logger_, true));
}
/**
* When called from the GUI thread, spawn a new thread and call
* `send_message()` from there, and then handle functions passed by calls to