mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
Make YaPluginFactory abstract
And add separate implementations for the native plugin and the Wine plugin host. This way we can easily allow the native host to do callbacks without having to manage a load of lambdas.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// yabridge: a Wine VST bridge
|
||||
// Copyright (C) 2020 Robbert van der Helm
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "vst3-impls.h"
|
||||
|
||||
YaPluginFactoryPluginImpl::YaPluginFactoryPluginImpl(Vst3PluginBridge& bridge)
|
||||
: bridge(bridge) {}
|
||||
|
||||
tresult PLUGIN_API
|
||||
YaPluginFactoryPluginImpl::createInstance(Steinberg::FIDString /*cid*/,
|
||||
Steinberg::FIDString /*_iid*/,
|
||||
void** /*obj*/) {
|
||||
// TODO: Send a control message
|
||||
return 0;
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
YaPluginFactoryPluginImpl::setHostContext(Steinberg::FUnknown* /*context*/) {
|
||||
// TODO: Send a control message
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// yabridge: a Wine VST bridge
|
||||
// Copyright (C) 2020 Robbert van der Helm
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "vst3.h"
|
||||
|
||||
// These are implementation of the serialization clases in
|
||||
// `src/common/serialization/vst3/` to provide callback support
|
||||
|
||||
class YaPluginFactoryPluginImpl : public YaPluginFactory {
|
||||
public:
|
||||
YaPluginFactoryPluginImpl(Vst3PluginBridge& bridge);
|
||||
|
||||
tresult PLUGIN_API createInstance(Steinberg::FIDString cid,
|
||||
Steinberg::FIDString _iid,
|
||||
void** obj) override;
|
||||
|
||||
tresult PLUGIN_API setHostContext(Steinberg::FUnknown* context) override;
|
||||
|
||||
private:
|
||||
Vst3PluginBridge& bridge;
|
||||
};
|
||||
@@ -17,6 +17,9 @@
|
||||
#include <public.sdk/source/main/pluginfactory.h>
|
||||
|
||||
#include "bridges/vst3.h"
|
||||
// TODO: Remove include, instantiating and returning the `YaPluginFactory`
|
||||
// should be done in `Vst3PluginBridge`
|
||||
#include "src/plugin/bridges/vst3-impls.h"
|
||||
|
||||
#include <public.sdk/source/main/linuxmain.cpp>
|
||||
|
||||
@@ -87,8 +90,8 @@ SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory() {
|
||||
// TODO: Remove, this is just for type checking
|
||||
if (false) {
|
||||
boost::asio::local::stream_protocol::socket* socket;
|
||||
YaPluginFactory* object;
|
||||
write_object(*socket, *object);
|
||||
YaPluginFactoryPluginImpl object(*bridge);
|
||||
write_object(*socket, object);
|
||||
}
|
||||
|
||||
if (!gPluginFactory) {
|
||||
|
||||
Reference in New Issue
Block a user