summaryrefslogtreecommitdiff
path: root/libs/fst
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-03-27 19:32:59 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-03-27 19:32:59 +0000
commit24bb797853b884fbcdc0f51e420258a49236f49c (patch)
treeff87af16a0ac5ba6c15c2340141a3e7acd45aacc /libs/fst
parent75119176e300f559e1a080b5127b85dff4947d36 (diff)
save+restore VST preset program number; don't call begin/endSetProgram for VST 1.0 plugins
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4917 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/fst')
-rw-r--r--libs/fst/fst.h1
-rw-r--r--libs/fst/vstwin.c18
2 files changed, 14 insertions, 5 deletions
diff --git a/libs/fst/fst.h b/libs/fst/fst.h
index 1cecc71d52..6ef5acf794 100644
--- a/libs/fst/fst.h
+++ b/libs/fst/fst.h
@@ -80,6 +80,7 @@ struct _FST
int height;
int wantIdle;
int destroy;
+ int vst_version;
int want_program;
int current_program;
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c
index 82c4d81d68..09ca8f18d3 100644
--- a/libs/fst/vstwin.c
+++ b/libs/fst/vstwin.c
@@ -166,11 +166,17 @@ again:
}
if (fst->want_program != -1 ) {
- 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;
+ if (fst->vst_version >= 2) {
+ fst->plugin->dispatcher (fst->plugin, 67 /* effBeginSetProgram */, 0, 0, NULL, 0);
+ }
+
+ fst->plugin->dispatcher (fst->plugin, effSetProgram, 0, fst->want_program, NULL, 0);
+
+ if (fst->vst_version >= 2) {
+ fst->plugin->dispatcher (fst->plugin, 68 /* effEndSetProgram */, 0, 0, NULL, 0);
+ }
+ /* did it work? */
+ fst->current_program = fst->plugin->dispatcher (fst->plugin, 3, /* effGetProgram */ 0, 0, NULL, 0);
fst->want_program = -1;
}
@@ -569,6 +575,8 @@ fst_instantiate (FSTHandle* fhandle, audioMasterCallback amc, void* userptr)
fst->plugin->dispatcher (fst->plugin, effOpen, 0, 0, 0, 0);
//fst->plugin->dispatcher (fst->plugin, effMainsChanged, 0, 0, NULL, 0);
+ fst->vst_version = fst->plugin->dispatcher (fst->plugin, effGetVstVersion, 0, 0, 0, 0);
+
fst->handle->plugincnt++;
fst->wantIdle = 0;