From 0b462c034e453b07b4dc5b446a6584f18e7dfde5 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 2 Dec 2020 19:09:55 +0100 Subject: [PATCH] Allow loading VST3 modules Doesn't actually work yet or do anything, but it compiles and it runs. --- src/plugin/vst3-plugin.cpp | 2 ++ src/wine-host/bridges/vst3.cpp | 16 ++++++++++++++++ src/wine-host/bridges/vst3.h | 4 ++++ src/wine-host/individual-host.cpp | 2 ++ 4 files changed, 24 insertions(+) diff --git a/src/plugin/vst3-plugin.cpp b/src/plugin/vst3-plugin.cpp index bc27dc69..bb55be74 100644 --- a/src/plugin/vst3-plugin.cpp +++ b/src/plugin/vst3-plugin.cpp @@ -36,6 +36,8 @@ SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory() { // already implemented and which are left // TODO: And when we get a query for some interface that we do not (yet) // support, we should print some easy to spot warning message + // TODO: Check whether `IPlugView::isPlatformTypeSupported` needs + // special handling. // TODO: Should we always use plugin groups or for VST3 plugins? Since // they seem to be very keen on sharing resources and leaving // modules loaded. diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 817dd545..e6d29728 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -17,4 +17,20 @@ #include "vst3.h" // TODO: Do something with this, I just wanted to get the build working +// TODO: Check if this can load both regular Unix style paths with Wine. Oh and +// check if it works at all. +// TODO: Check if now works with Winelib, or replace with Boost #include + +void justdewit(const std::string& path) { + std::string error; + std::shared_ptr plugin = + VST3::Hosting::Win32Module::create(path, error); + + if (plugin) { + std::cerr << "Hooray!" << std::endl; + } else { + std::cerr << "Ohnoes!" << std::endl; + std::cerr << error << std::endl; + } +} diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index e50f13e6..e6206b82 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -15,3 +15,7 @@ // along with this program. If not, see . #pragma once + +#include + +void justdewit(const std::string& path); diff --git a/src/wine-host/individual-host.cpp b/src/wine-host/individual-host.cpp index 8c2679e9..1201ecf0 100644 --- a/src/wine-host/individual-host.cpp +++ b/src/wine-host/individual-host.cpp @@ -85,6 +85,8 @@ main(int argc, char* argv[]) { break; case PluginType::vst3: #ifdef WITH_VST3 + justdewit(plugin_location); + std::cerr << "TODO: Not yet implemented" << std::endl; return 1; #else