#include "ardour/session.h"
#include "ardour/lxvst_plugin.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
+ open_plugin ();
Session::vst_current_loading_id = 0;
- set_plugin (_state->plugin);
+ init_plugin ();
}
LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
if ((_state = vstfx_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;
- // Plugin::setup_controls ();
+ init_plugin ();
}
LXVSTPlugin::~LXVSTPlugin ()
Session::vst_current_loading_id = atoi (unique_id);
AEffect* plugin = handle->main_entry (Session::vst_callback);
Session::vst_current_loading_id = 0;
+ plugin->user = NULL;
plugin->dispatcher (plugin, effOpen, 0, 0, 0, 0); // :(
int const vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0);
if (t->read ()) { // TODO read names only. skip parsing the actual data
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* uri = (*i)->property (X_("uri"));
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * uri = (*i)->property (X_("uri"));
+ XMLProperty const * label = (*i)->property (X_("label"));
p.push_back (Plugin::PresetRecord (uri->value(), label->value(), true));
}
}