Set encoder quality for existing ExportFormatSpecs
[ardour.git] / libs / ardour / windows_vst_plugin.cc
index 17cfa1eed7c4120f2070ba3080b21ceabf536ca5..7a7caa9ed817cda11b25448b922d919fedc44d92 100644 (file)
@@ -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,15 @@ 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 ());
+       other.add_state (root);
+       set_state (*root, Stateful::loading_state_version);
+       delete root;
+
+       init_plugin ();
 }
 
 WindowsVSTPlugin::~WindowsVSTPlugin ()
@@ -127,8 +134,8 @@ WindowsVSTPluginInfo::get_presets (bool user_only) const
        return p;
 }
 
-WindowsVSTPluginInfo::WindowsVSTPluginInfo()
+WindowsVSTPluginInfo::WindowsVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo)
 {
-       type = ARDOUR::Windows_VST;
+       type = ARDOUR::Windows_VST;
 }