diff --git a/meson.build b/meson.build index 1c9efea5..5d762f45 100644 --- a/meson.build +++ b/meson.build @@ -140,6 +140,7 @@ if with_vst3 'src/common/serialization/vst3/plugin-proxy.cpp', 'src/common/serialization/vst3/plugin-factory.cpp', 'src/common/serialization/vst3/process-data.cpp', + 'src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp', 'src/wine-host/bridges/vst3-impls/host-application.cpp', 'src/wine-host/bridges/vst3.cpp', ] diff --git a/src/common/serialization/vst3.h b/src/common/serialization/vst3.h index 5b6f0c9f..7b7d0a8a 100644 --- a/src/common/serialization/vst3.h +++ b/src/common/serialization/vst3.h @@ -23,6 +23,7 @@ #include "../configuration.h" #include "../utils.h" #include "common.h" +#include "vst3/component-handler-proxy.h" #include "vst3/plugin-factory.h" #include "vst3/plugin-proxy.h" diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.h b/src/plugin/bridges/vst3-impls/plugin-proxy.h index eb47f462..d4c0304c 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.h +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.h @@ -16,8 +16,6 @@ #pragma once -#include - #include "../vst3.h" class Vst3PluginProxyImpl : public Vst3PluginProxy { diff --git a/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp b/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp new file mode 100644 index 00000000..273d8fe8 --- /dev/null +++ b/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp @@ -0,0 +1,69 @@ +// 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 . + +#include "component-handler-proxy.h" + +#include + +Vst3ComponentHandlerProxyImpl::Vst3ComponentHandlerProxyImpl( + Vst3Bridge& bridge, + Vst3ComponentHandlerProxy::ConstructArgs&& args) + : Vst3ComponentHandlerProxy(std::move(args)), bridge(bridge) { + // The lifecycle is thos object is managed together with that of the plugin + // object instance instance this belongs to +} + +tresult PLUGIN_API +Vst3ComponentHandlerProxyImpl::queryInterface(const Steinberg::TUID _iid, + void** obj) { + // TODO: Successful queries should also be logged + const tresult result = Vst3ComponentHandlerProxy::queryInterface(_iid, obj); + if (result != Steinberg::kResultOk) { + std::cerr << "TODO: Implement unknown interface logging on Wine side" + << std::endl; + } + + return result; +} + +tresult PLUGIN_API +Vst3ComponentHandlerProxyImpl::beginEdit(Steinberg::Vst::ParamID id) { + // TODO: Implement + std::cerr << "TODO: IComponentHandler::beginEdit()" << std::endl; + return Steinberg::kNotImplemented; +} + +tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::performEdit( + Steinberg::Vst::ParamID id, + Steinberg::Vst::ParamValue valueNormalized) { + // TODO: Implement + std::cerr << "TODO: IComponentHandler::performEdit()" << std::endl; + return Steinberg::kNotImplemented; +} + +tresult PLUGIN_API +Vst3ComponentHandlerProxyImpl::endEdit(Steinberg::Vst::ParamID id) { + // TODO: Implement + std::cerr << "TODO: IComponentHandler::endEdit()" << std::endl; + return Steinberg::kNotImplemented; +} + +tresult PLUGIN_API +Vst3ComponentHandlerProxyImpl::restartComponent(int32 flags) { + // TODO: Implement + std::cerr << "TODO: IComponentHandler::restartComponent()" << std::endl; + return Steinberg::kNotImplemented; +} diff --git a/src/wine-host/bridges/vst3-impls/component-handler-proxy.h b/src/wine-host/bridges/vst3-impls/component-handler-proxy.h new file mode 100644 index 00000000..a4433891 --- /dev/null +++ b/src/wine-host/bridges/vst3-impls/component-handler-proxy.h @@ -0,0 +1,44 @@ +// 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 . + +#pragma once + +#include "../vst3.h" + +class Vst3ComponentHandlerProxyImpl : public Vst3ComponentHandlerProxy { + public: + Vst3ComponentHandlerProxyImpl( + Vst3Bridge& bridge, + Vst3ComponentHandlerProxy::ConstructArgs&& args); + + /** + * We'll override the query interface to log queries for interfaces we do + * not (yet) support. + */ + tresult PLUGIN_API queryInterface(const Steinberg::TUID _iid, + void** obj) override; + + // From `IComponentHandler` + tresult PLUGIN_API beginEdit(Steinberg::Vst::ParamID id) override; + tresult PLUGIN_API + performEdit(Steinberg::Vst::ParamID id, + Steinberg::Vst::ParamValue valueNormalized) override; + tresult PLUGIN_API endEdit(Steinberg::Vst::ParamID id) override; + tresult PLUGIN_API restartComponent(int32 flags) override; + + private: + Vst3Bridge& bridge; +}; diff --git a/src/wine-host/bridges/vst3-impls/host-application.cpp b/src/wine-host/bridges/vst3-impls/host-application.cpp index 211e6242..307cbbde 100644 --- a/src/wine-host/bridges/vst3-impls/host-application.cpp +++ b/src/wine-host/bridges/vst3-impls/host-application.cpp @@ -22,8 +22,8 @@ YaHostApplicationImpl::YaHostApplicationImpl( Vst3Bridge& bridge, YaHostApplication::ConstructArgs&& args) : YaHostApplication(std::move(args)), bridge(bridge) { - // The lifecycle is thos object is managed together with that of the - // `IComponent` instance this belongs to + // The lifecycle is thos object is managed together with that of the plugin + // object instance this belongs to } tresult PLUGIN_API diff --git a/src/wine-host/bridges/vst3-impls/host-application.h b/src/wine-host/bridges/vst3-impls/host-application.h index 9d7f5c29..ae5df390 100644 --- a/src/wine-host/bridges/vst3-impls/host-application.h +++ b/src/wine-host/bridges/vst3-impls/host-application.h @@ -16,8 +16,6 @@ #pragma once -#include - #include "../vst3.h" class YaHostApplicationImpl : public YaHostApplication {