summaryrefslogtreecommitdiff
path: root/libs/fst
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-11-15 17:07:04 +0100
committerRobin Gareus <robin@gareus.org>2016-11-15 17:10:13 +0100
commitcf1651e6d7b615cba28025a5952afcc99946c18f (patch)
tree4244772fd4c01a6eaa96766521231345ffffa166 /libs/fst
parentf944c24c4bbbda1a9225ba9cd96f3caee6d4f453 (diff)
consolidate VSTState functions
Diffstat (limited to 'libs/fst')
-rw-r--r--libs/fst/scanner.cc2
-rw-r--r--libs/fst/vstwin.c43
2 files changed, 5 insertions, 40 deletions
diff --git a/libs/fst/scanner.cc b/libs/fst/scanner.cc
index 1c61976819..18f4048cbb 100644
--- a/libs/fst/scanner.cc
+++ b/libs/fst/scanner.cc
@@ -36,8 +36,8 @@
#endif
#include "../ardour/filesystem_paths.cc"
#include "../ardour/directory_names.cc"
-#include "../ardour/vst_helper.cc"
+#include "../ardour/vst_state.cc"
#ifdef LXVST_SUPPORT
void
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c
index 820027c9ae..fcfa836893 100644
--- a/libs/fst/vstwin.c
+++ b/libs/fst/vstwin.c
@@ -72,33 +72,6 @@ vstedit_wndproc (HWND w, UINT msg, WPARAM wp, LPARAM lp)
}
-static void
-maybe_set_program (VSTState* fst)
-{
- if (fst->want_program != -1) {
- if (fst->vst_version >= 2) {
- fst->plugin->dispatcher (fst->plugin, 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, effEndSetProgram, 0, 0, NULL, 0);
- }
- fst->want_program = -1;
- }
-
- if (fst->want_chunk == 1) {
- // XXX check
- // 24 == audioMasterGetAutomationState,
- // 48 == audioMasterGetChunkFile
- pthread_mutex_lock (&fst->state_lock);
- fst->plugin->dispatcher (fst->plugin, 24 /* effSetChunk */, 1, fst->wanted_chunk_size, fst->wanted_chunk, 0);
- fst->want_chunk = 0;
- pthread_mutex_unlock (&fst->state_lock);
- }
-}
-
static VOID CALLBACK
idle_hands(
HWND hwnd, // handle to window for timer messages
@@ -148,8 +121,8 @@ idle_hands(
fst->n_pending_keys = 0;
#endif
- /* See comment for maybe_set_program call below */
- maybe_set_program (fst);
+ /* See comment for call below */
+ vststate_maybe_set_program (fst);
fst->want_program = -1;
fst->want_chunk = 0;
/* If we don't have an editor window yet, we still need to
@@ -161,7 +134,7 @@ idle_hands(
* and so it will be done again if and when the GUI arrives.
*/
if (fst->program_set_without_editor == 0) {
- maybe_set_program (fst);
+ vststate_maybe_set_program (fst);
fst->program_set_without_editor = 1;
}
@@ -220,15 +193,7 @@ static VSTState*
fst_new (void)
{
VSTState* fst = (VSTState*) calloc (1, sizeof (VSTState));
-
- //vststate_init (fst);
- pthread_mutex_init (&fst->lock, 0);
- pthread_mutex_init (&fst->state_lock, 0);
- pthread_cond_init (&fst->window_status_change, 0);
- pthread_cond_init (&fst->plugin_dispatcher_called, 0);
- pthread_cond_init (&fst->window_created, 0);
- fst->want_program = -1;
- //
+ vststate_init (fst);
#ifdef PLATFORM_WINDOWS
fst->voffset = 50;