From 0eb03e1afe0257d0eeddf2a4a179b5620d577616 Mon Sep 17 00:00:00 2001 From: Sampo Savolainen Date: Sat, 5 Aug 2006 11:46:13 +0000 Subject: [PATCH] shraed_ptr<> etc. fixes for VST's. VST support now compiles, but doesn't run for some reason. git-svn-id: svn://localhost/ardour2/trunk@759 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/vst_pluginui.cc | 10 +++++----- libs/ardour/ardour/vst_plugin.h | 1 + libs/ardour/plugin_manager.cc | 2 +- libs/ardour/vst_plugin.cc | 8 +++++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/vst_pluginui.cc b/gtk2_ardour/vst_pluginui.cc index 7adf702f4d..5e65475c46 100644 --- a/gtk2_ardour/vst_pluginui.cc +++ b/gtk2_ardour/vst_pluginui.cc @@ -31,17 +31,17 @@ using namespace Gtk; using namespace ARDOUR; using namespace PBD; -VSTPluginUI::VSTPluginUI (PluginInsert& pi, VSTPlugin& vp) +VSTPluginUI::VSTPluginUI (boost::shared_ptr pi, boost::shared_ptr vp) : PlugUIBase (pi), vst (vp) { - fst_run_editor (vst.fst()); + fst_run_editor (vst->fst()); preset_box.pack_end (bypass_button, false, false, 10); preset_box.pack_end (save_button, false, false); preset_box.pack_end (combo, false, false); - bypass_button.set_active (!insert.active()); + bypass_button.set_active (!insert->active()); pack_start (preset_box, false, false); pack_start (socket, true, true); @@ -55,7 +55,7 @@ VSTPluginUI::~VSTPluginUI () int VSTPluginUI::get_preferred_height () { - return vst.fst()->height; + return vst->fst()->height; } int @@ -69,7 +69,7 @@ VSTPluginUI::package (Gtk::Window& win) this assumes that the window's owner understands the XEmbed protocol. */ - socket.add_id (fst_get_XID (vst.fst())); + socket.add_id (fst_get_XID (vst->fst())); return 0; } diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h index 3636fe275a..5253da7b0a 100644 --- a/libs/ardour/ardour/vst_plugin.h +++ b/libs/ardour/ardour/vst_plugin.h @@ -106,6 +106,7 @@ class VSTPlugin : public ARDOUR::Plugin class VSTPluginInfo : public PluginInfo { + public: VSTPluginInfo () {} ~VSTPluginInfo () {} diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index 096696aca5..2a753617e8 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -382,7 +382,7 @@ PluginManager::vst_discover (string path) << endl; } - PluginInfoPtr info(new PluginInfo); + PluginInfoPtr info(new VSTPluginInfo); /* what a goddam joke freeware VST is */ diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index a551a15d28..4c09ba3440 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -488,9 +488,11 @@ VSTPluginInfo::load (Session& session) if (Config->get_use_vst()) { FSTHandle* handle; - - if ((handle = fst_load (info->path.c_str())) == 0) { - error << string_compose(_("VST: cannot load module from \"%1\""), info->path) << endmsg; + + handle = fst_load(path.c_str()); + + if ( (int)handle == -1) { + error << string_compose(_("VST: cannot load module from \"%1\""), path) << endmsg; } else { plugin.reset (new VSTPlugin (session.engine(), session, handle)); }