From e77729125ec262b6a01e8fc22b236995cd37a7f6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 13 Apr 2016 00:52:47 +0200 Subject: [PATCH] VST report audioMasterPinConnected according to Pin Management --- libs/ardour/plugin_insert.cc | 5 +++++ libs/ardour/session_vst.cc | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index ee8016c6af..a1c2e4b165 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -2437,6 +2437,11 @@ PluginInsert::add_plugin (boost::shared_ptr plugin) } } } + + boost::shared_ptr vst = boost::dynamic_pointer_cast (plugin); + if (vst) { + vst->set_insert (this, _plugins.size ()); + } _plugins.push_back (plugin); } diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index c6978eddc7..0e16ac1ebe 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -26,6 +26,7 @@ #include "ardour/debug.h" #include "ardour/session.h" #include "ardour/tempo.h" +#include "ardour/plugin_insert.h" #include "ardour/windows_vst_plugin.h" #include "ardour/vestige/aeffectx.h" #include "ardour/vst_types.h" @@ -124,11 +125,25 @@ intptr_t Session::vst_callback ( } switch (value) { case 0: + if (plug->plugin_insert ()) { + bool valid; + const ChanMapping& map (plug->plugin_insert ()->input_map (plug->plugin_number ())); + map.get (DataType::AUDIO, index, &valid); + return valid ? 0 : 1; + } if (index < plug->plugin()->numInputs) { return 0; } break; case 1: +#if 0 // investigate, the outputs *are* connected to scratch buffers + if (plug->plugin_insert ()) { + bool valid; + const ChanMapping& map (plug->plugin_insert ()->output_map (plug->plugin_number ())); + map.get (DataType::AUDIO, index, &valid); + return valid ? 0 : 1; + } +#endif if (index < plug->plugin()->numOutputs) { return 0; }