summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-03-27 18:38:02 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-03-27 18:38:02 +0000
commit75119176e300f559e1a080b5127b85dff4947d36 (patch)
tree848e8dd29cf07f664314a21d82a87525d505649f
parent95114e89ad81e83f56fa5449bc8ead2f7f45eca1 (diff)
some totally untested FST/VST changes
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4916 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/vst_pluginui.cc7
-rw-r--r--libs/ardour/vst_plugin.cc10
-rw-r--r--libs/fst/fst.h1
-rw-r--r--libs/fst/vstwin.c7
4 files changed, 23 insertions, 2 deletions
diff --git a/gtk2_ardour/vst_pluginui.cc b/gtk2_ardour/vst_pluginui.cc
index aed9fb7337..19a0826065 100644
--- a/gtk2_ardour/vst_pluginui.cc
+++ b/gtk2_ardour/vst_pluginui.cc
@@ -167,7 +167,12 @@ VSTPluginUI::create_preset_store ()
CellRenderer* renderer = manage (new CellRendererText());
vst_preset_combo.pack_start (*renderer, true);
vst_preset_combo.add_attribute (*renderer, "text", 0);
- vst_preset_combo.set_active (0);
+
+ if (vst->fst()->current_program != -1) {
+ vst_preset_combo.set_active (vst->fst()->current_program);
+ } else {
+ vst_preset_combo.set_active (0);
+ }
}
typedef int (*error_handler_t)( Display *, XErrorEvent *);
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index e4e623c356..eb067d6c5a 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -222,7 +222,11 @@ VSTPlugin::set_state(const XMLNode& node)
}
}
+ _fst->current_program = _plugin->dispatcher (_plugin, 3, /* effGetProgram */, 0, NULL, NULL, 0);
+ cerr << name() << ": current program is " << _fst->current_program << endl;
+
return 0;
+
} else if ((child = find_named_node (node, X_("parameters"))) != 0) {
XMLPropertyList::const_iterator i;
@@ -238,9 +242,15 @@ VSTPlugin::set_state(const XMLNode& node)
_plugin->setParameter (_plugin, param, val);
}
+ /* program number is not knowable */
+
+ _fst->current_program = -1;
+
return 0;
}
+
+
return -1;
}
diff --git a/libs/fst/fst.h b/libs/fst/fst.h
index 7e2cfec08b..1cecc71d52 100644
--- a/libs/fst/fst.h
+++ b/libs/fst/fst.h
@@ -82,6 +82,7 @@ struct _FST
int destroy;
int want_program;
+ int current_program;
float *want_params;
float *set_params;
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c
index 151eedcbdb..82c4d81d68 100644
--- a/libs/fst/vstwin.c
+++ b/libs/fst/vstwin.c
@@ -71,6 +71,7 @@ fst_new ()
pthread_cond_init (&fst->window_status_change, NULL);
pthread_cond_init (&fst->plugin_dispatcher_called, NULL);
fst->want_program = -1;
+ fst->current_program = -1;
return fst;
}
@@ -165,7 +166,11 @@ again:
}
if (fst->want_program != -1 ) {
- fst->plugin->dispatcher (fst->plugin, effSetProgram, 0, fst->want_program, NULL, 0);
+ fst->plugin->dispatcher (fst->plugin, 67 /* effBeginSetProgram */, 0, 0, NULL, 0);
+ fst->plugin->dispatcher (fst->plugin, effSetProgram, 0, fst->want_program, NULL, 0))
+ fst->plugin->dispatcher (fst->plugin, 68 /* effEndSetProgram */, 0, 0, NULL, 0);
+ /* assume it worked */
+ fst->current_program = fst->want_program;
fst->want_program = -1;
}