OSC: remove debug output.
[ardour.git] / libs / ardour / windows_vst_plugin.cc
index 9dec5ea7724be2c029148398af3fde99003c7680..82304a9f9332c5c042cf331ea2a145ee4d2db0d6 100644 (file)
@@ -26,7 +26,7 @@
 #include "ardour/windows_vst_plugin.h"
 #include "ardour/session.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -39,9 +39,10 @@ WindowsVSTPlugin::WindowsVSTPlugin (AudioEngine& e, Session& session, VSTHandle*
        if ((_state = fst_instantiate (_handle, Session::vst_callback, this)) == 0) {
                throw failed_constructor();
        }
+       open_plugin ();
        Session::vst_current_loading_id = 0;
 
-       set_plugin (_state->plugin);
+       init_plugin ();
 }
 
 WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
@@ -53,9 +54,16 @@ WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
        if ((_state = fst_instantiate (_handle, Session::vst_callback, this)) == 0) {
                throw failed_constructor();
        }
+       open_plugin ();
        Session::vst_current_loading_id = 0;
 
-       _plugin = _state->plugin;
+       XMLNode* root = new XMLNode (other.state_node_name ());
+       LocaleGuard lg;
+       other.add_state (root);
+       set_state (*root, Stateful::loading_state_version);
+       delete root;
+
+       init_plugin ();
 }
 
 WindowsVSTPlugin::~WindowsVSTPlugin ()