From 3271a9610056132d5b57eefb94daf3a2580b676b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 15 Oct 2020 20:40:35 +0200 Subject: [PATCH] VST3: allow to debug TUID support --- libs/ardour/vst3_host.cc | 13 +++++++++++++ libs/ardour/vst3_plugin.cc | 14 ++++++++++++++ libs/fst/wscript | 1 + 3 files changed, 28 insertions(+) diff --git a/libs/ardour/vst3_host.cc b/libs/ardour/vst3_host.cc index d779d066e0..65fc73284b 100644 --- a/libs/ardour/vst3_host.cc +++ b/libs/ardour/vst3_host.cc @@ -26,6 +26,11 @@ #include "ardour/vst3_host.h" +#ifndef VST3_SCANNER_APP +#include "pbd/compose.h" +#include "ardour/debug.h" +#endif + using namespace Steinberg; DEF_CLASS_IID (FUnknown) @@ -384,6 +389,14 @@ HostApplication::queryInterface (const char* _iid, void** obj) return kResultOk; } +#ifndef VST3_SCANNER_APP + if (DEBUG_ENABLED(PBD::DEBUG::VST3Config)) { + char fuid[33]; + FUID::fromTUID (_iid).toString (fuid); + DEBUG_TRACE (PBD::DEBUG::VST3Config, string_compose ("HostApplication::queryInterface not supported: %1\n", fuid)); + } +#endif + *obj = nullptr; return kResultFalse; } diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 6c6d7357f1..e65adf4c38 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -987,6 +987,14 @@ VST3PI::VST3PI (boost::shared_ptr m, std::string uniqu throw failed_constructor (); } +#ifndef NDEBUG + if (DEBUG_ENABLED(DEBUG::VST3Config)) { + char fuid[33]; + _fuid.toString (fuid); + DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI create instance %1\n", fuid)); + } +#endif + if (factory->createInstance (_fuid.toTUID (), Vst::IComponent::iid, (void**)&_component) != kResultTrue) { throw failed_constructor (); } @@ -1286,6 +1294,12 @@ VST3PI::queryInterface (const TUID _iid, void** obj) } #endif + if (DEBUG_ENABLED(DEBUG::VST3Config)) { + char fuid[33]; + FUID::fromTUID (_iid).toString (fuid); + DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::queryInterface not supported: %1\n", fuid)); + } + *obj = nullptr; return kNoInterface; } diff --git a/libs/fst/wscript b/libs/fst/wscript index b1bec98e51..693fc1d8cd 100644 --- a/libs/fst/wscript +++ b/libs/fst/wscript @@ -45,6 +45,7 @@ def build(bld): obj.target = 'ardour-vst3-scanner' obj.includes = [ '../pbd/', '../ardour/', '../vst3/', '..' ] obj.defines = [ + 'VST3_SCANNER_APP', 'VERSIONSTRING="' + str(bld.env['VERSION']) + '"', 'PACKAGE="' + I18N_PACKAGE + str(bld.env['MAJOR']) + '"', 'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"',