Move the flush request to the audio thread

This commit is contained in:
Robbert van der Helm
2022-09-26 16:46:00 +02:00
parent 214ba51010
commit 8bc61837c9
5 changed files with 17 additions and 22 deletions
+4 -6
View File
@@ -151,11 +151,7 @@ using ClapMainThreadCallbackRequest =
clap::ext::note_ports::host::SupportedDialects,
clap::ext::note_ports::host::Rescan,
clap::ext::params::host::Rescan,
clap::ext::params::host::Clear,
// This doesn't need to be done on the main thread, but we
// don't have an alternative per-plugin instance socket
// available so this is probably fine
clap::ext::params::host::RequestFlush>;
clap::ext::params::host::Clear>;
template <typename S>
void serialize(S& s, ClapMainThreadCallbackRequest& payload) {
@@ -177,7 +173,9 @@ void serialize(S& s, ClapMainThreadCallbackRequest& payload) {
* used.
*/
using ClapAudioThreadCallbackRequest =
std::variant<WantsConfiguration, clap::ext::tail::host::Changed>;
std::variant<WantsConfiguration,
clap::ext::params::host::RequestFlush,
clap::ext::tail::host::Changed>;
template <typename S>
void serialize(S& s, ClapAudioThreadCallbackRequest& payload) {
@@ -223,8 +223,6 @@ struct FlushResponse {
}
};
// TODO: This can be either a main thread or an audio thread function call
// depending on whether or not the plugin is active
/**
* Message struct for `clap_plugin_params::flush()`.
*/