mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Use the new approach for creating plugin factory
Directly serializing and deserializing into objects was and more boilerplate heavy (since we now need two implementations even though we only use one), and also much less flexible because we can't wrap payloads in structs or provide optional values that way.
This commit is contained in:
@@ -20,8 +20,10 @@
|
||||
|
||||
#include "component.h"
|
||||
|
||||
YaPluginFactoryPluginImpl::YaPluginFactoryPluginImpl(Vst3PluginBridge& bridge)
|
||||
: bridge(bridge) {}
|
||||
YaPluginFactoryPluginImpl::YaPluginFactoryPluginImpl(
|
||||
Vst3PluginBridge& bridge,
|
||||
YaPluginFactory::ConstructArgs&& args)
|
||||
: YaPluginFactory(std::move(args)), bridge(bridge) {}
|
||||
|
||||
tresult PLUGIN_API
|
||||
YaPluginFactoryPluginImpl::createInstance(Steinberg::FIDString cid,
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
class YaPluginFactoryPluginImpl : public YaPluginFactory {
|
||||
public:
|
||||
YaPluginFactoryPluginImpl(Vst3PluginBridge& bridge);
|
||||
YaPluginFactoryPluginImpl(Vst3PluginBridge& bridge,
|
||||
YaPluginFactory::ConstructArgs&& args);
|
||||
|
||||
tresult PLUGIN_API createInstance(Steinberg::FIDString cid,
|
||||
Steinberg::FIDString _iid,
|
||||
|
||||
@@ -97,10 +97,12 @@ Steinberg::IPluginFactory* Vst3PluginBridge::get_plugin_factory() {
|
||||
// will request after loading the module. Host callback handlers should
|
||||
// have started before this since the Wine plugin host will request a
|
||||
// copy of the configuration during its initialization.
|
||||
plugin_factory = new YaPluginFactoryPluginImpl(*this);
|
||||
sockets.host_vst_control.receive_into(
|
||||
WantsPluginFactory{}, *plugin_factory,
|
||||
std::pair<Vst3Logger&, bool>(logger, true));
|
||||
YaPluginFactory::ConstructArgs factory_args =
|
||||
sockets.host_vst_control.send_message(
|
||||
YaPluginFactory::Construct{},
|
||||
std::pair<Vst3Logger&, bool>(logger, true));
|
||||
plugin_factory =
|
||||
new YaPluginFactoryPluginImpl(*this, std::move(factory_args));
|
||||
}
|
||||
|
||||
return plugin_factory;
|
||||
|
||||
Reference in New Issue
Block a user