Split off IComponent and create a monolithic class

We can now use implement all VST3 plugin interfaces through this class,
check whether the object from the plugin also supports these classes,
and then conditionally allow casting to the supported classes. This
should give us a one-to-one proxy of the original object.
This commit is contained in:
Robbert van der Helm
2020-12-17 12:48:10 +01:00
parent d6c28f48d9
commit d8b2646563
22 changed files with 422 additions and 285 deletions
+5 -3
View File
@@ -24,7 +24,7 @@
#include "common.h"
// Forward declaration
class YaComponentPluginImpl;
class YaPluginMonolithImpl;
/**
* This handles the communication between the native host and a VST3 plugin
@@ -83,9 +83,11 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
* context.
*
* @see component_instances
*
* TODO: REname to `register_instance` or `register_object`
*/
void register_component(size_t instance_id,
YaComponentPluginImpl& component);
YaPluginMonolithImpl& component);
/**
* Remove a previously registered `YaComponentPluginImpl` from the list of
@@ -149,7 +151,7 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
* `register_component()` in the constractor, and an instance is then
* removed through a call to `unregister_component()` in the destructor.
*/
std::map<size_t, std::reference_wrapper<YaComponentPluginImpl>>
std::map<size_t, std::reference_wrapper<YaPluginMonolithImpl>>
component_instances;
std::mutex component_instances_mutex;
};