summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-11-15 02:49:30 +0100
committerRobin Gareus <robin@gareus.org>2016-11-15 02:49:41 +0100
commit5dc24971009b20a662a58a2e01c47df9b6b5526b (patch)
treef05b71ef82013940ec85d5a86af95eb50a4652c1
parent4e8d705d99d333517757aa212cbcfe712f054f3e (diff)
rework 8e3b6c9ac (fstwin is C code, not C++)
-rw-r--r--libs/ardour/ardour/vst_types.h20
-rw-r--r--libs/ardour/linux_vst_support.cc2
-rw-r--r--libs/ardour/mac_vst_support.cc2
-rw-r--r--libs/ardour/vst_helper.cc38
-rw-r--r--libs/ardour/wscript2
-rw-r--r--libs/fst/scanner.cc1
-rw-r--r--libs/fst/vstwin.c2
7 files changed, 45 insertions, 22 deletions
diff --git a/libs/ardour/ardour/vst_types.h b/libs/ardour/ardour/vst_types.h
index 0b8bcb6273..580c213a0a 100644
--- a/libs/ardour/ardour/vst_types.h
+++ b/libs/ardour/ardour/vst_types.h
@@ -134,26 +134,10 @@ struct LIBARDOUR_API _VSTState
pthread_cond_t plugin_dispatcher_called;
pthread_cond_t window_created;
int been_activated;
-
- void init () {
- pthread_mutex_init (&lock, 0);
- pthread_mutex_init (&state_lock, 0);
- pthread_cond_init (&window_status_change, 0);
- pthread_cond_init (&plugin_dispatcher_called, 0);
- pthread_cond_init (&window_created, 0);
- want_program = -1;
- want_chunk = 0;
- n_pending_keys = 0;
- has_editor = 0;
- program_set_without_editor = 0;
- linux_window = 0;
- linux_plugin_ui_window = 0;
- eventProc = 0;
- extra_data = 0;
- want_resize = 0;
- }
};
typedef struct _VSTState VSTState;
+LIBARDOUR_API extern void vststate_init (VSTState* state);
+
#endif
diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc
index 92c3243fb8..065e8bd755 100644
--- a/libs/ardour/linux_vst_support.cc
+++ b/libs/ardour/linux_vst_support.cc
@@ -83,7 +83,7 @@ static VSTState *
vstfx_new ()
{
VSTState* vstfx = (VSTState *) calloc (1, sizeof (VSTState));
- vstfx->init ();
+ vststate_init (vstfx);
return vstfx;
}
diff --git a/libs/ardour/mac_vst_support.cc b/libs/ardour/mac_vst_support.cc
index d86d3d5825..2a5efc088c 100644
--- a/libs/ardour/mac_vst_support.cc
+++ b/libs/ardour/mac_vst_support.cc
@@ -80,7 +80,7 @@ static VSTState *
mac_vst_new ()
{
VSTState* mac_vst = (VSTState *) calloc (1, sizeof (VSTState));
- mac_vst->init();
+ vststate_init (mac_vst);
return mac_vst;
}
diff --git a/libs/ardour/vst_helper.cc b/libs/ardour/vst_helper.cc
new file mode 100644
index 0000000000..da14eea96b
--- /dev/null
+++ b/libs/ardour/vst_helper.cc
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2010 Paul Davis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "ardour/vst_types.h"
+
+void vststate_init (VSTState* state) {
+ pthread_mutex_init (&state->lock, 0);
+ pthread_mutex_init (&state->state_lock, 0);
+ pthread_cond_init (&state->window_status_change, 0);
+ pthread_cond_init (&state->plugin_dispatcher_called, 0);
+ pthread_cond_init (&state->window_created, 0);
+ state->want_program = -1;
+ state->want_chunk = 0;
+ state->n_pending_keys = 0;
+ state->has_editor = 0;
+ state->program_set_without_editor = 0;
+ state->linux_window = 0;
+ state->linux_plugin_ui_window = 0;
+ state->eventProc = 0;
+ state->extra_data = 0;
+ state->want_resize = 0;
+}
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index 98dffa0384..b998732695 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -436,7 +436,7 @@ def build(bld):
obj.defines += [ 'LXVST_SUPPORT' ]
if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined('MACVST_SUPPORT'):
- obj.source += [ 'session_vst.cc', 'vst_plugin.cc', 'vst_info_file.cc' ]
+ obj.source += [ 'session_vst.cc', 'vst_plugin.cc', 'vst_info_file.cc', 'vst_helper.cc' ]
if bld.is_defined('MACVST_SUPPORT'):
obj.source += [ 'mac_vst_plugin.cc', 'mac_vst_support.cc' ]
diff --git a/libs/fst/scanner.cc b/libs/fst/scanner.cc
index 1f8a90e7a8..1c61976819 100644
--- a/libs/fst/scanner.cc
+++ b/libs/fst/scanner.cc
@@ -36,6 +36,7 @@
#endif
#include "../ardour/filesystem_paths.cc"
#include "../ardour/directory_names.cc"
+#include "../ardour/vst_helper.cc"
#ifdef LXVST_SUPPORT
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c
index b26295fa73..53eba86b06 100644
--- a/libs/fst/vstwin.c
+++ b/libs/fst/vstwin.c
@@ -220,7 +220,7 @@ static VSTState*
fst_new (void)
{
VSTState* fst = (VSTState*) calloc (1, sizeof (VSTState));
- fst->init();
+ vststate_init (fst);
#ifdef PLATFORM_WINDOWS
fst->voffset = 50;
fst->hoffset = 0;