From bae2dcd4bf57d2ce54f266f4048df7f641866a69 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 21 Nov 2011 22:46:20 +0000 Subject: [PATCH] Share VSTKey struct beween linux and windows VST. git-svn-id: svn://localhost/ardour2/branches/3.0@10750 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/vstfxwin.cc | 2 +- gtk2_ardour/windows_vst_plugin_ui.cc | 2 +- libs/ardour/ardour/vstfx.h | 17 +++-------------- libs/fst/fst.h | 13 +++---------- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/gtk2_ardour/vstfxwin.cc b/gtk2_ardour/vstfxwin.cc index abdde722ee..65ff7912e9 100755 --- a/gtk2_ardour/vstfxwin.cc +++ b/gtk2_ardour/vstfxwin.cc @@ -17,7 +17,7 @@ #include #include -#include +#include "ardour/vstfx.h" #include #include diff --git a/gtk2_ardour/windows_vst_plugin_ui.cc b/gtk2_ardour/windows_vst_plugin_ui.cc index e76458051b..dbd61b3268 100644 --- a/gtk2_ardour/windows_vst_plugin_ui.cc +++ b/gtk2_ardour/windows_vst_plugin_ui.cc @@ -143,7 +143,7 @@ WindowsVSTPluginUI::forward_key_event (GdkEventKey* ev) FST* fst = vst->fst (); pthread_mutex_lock (&fst->lock); - if (fst->n_pending_keys == (sizeof (fst->pending_keys) * sizeof (FSTKey))) { + if (fst->n_pending_keys == (sizeof (fst->pending_keys) * sizeof (VSTKey))) { /* buffer full */ return; } diff --git a/libs/ardour/ardour/vstfx.h b/libs/ardour/ardour/vstfx.h index 1f0a85364a..decfd571de 100755 --- a/libs/ardour/ardour/vstfx.h +++ b/libs/ardour/ardour/vstfx.h @@ -6,6 +6,8 @@ #include #include +#include "ardour/vst_types.h" + /******************************************************************************************/ /*VSTFX - an engine to manage native linux VST plugins - derived from FST for Windows VSTs*/ /******************************************************************************************/ @@ -25,7 +27,6 @@ void vstfx_error (const char *fmt, ...); typedef struct _VSTFX VSTFX; typedef struct _VSTFXHandle VSTFXHandle; typedef struct _VSTFXInfo VSTFXInfo; -typedef struct _VSTFXKey VSTFXKey; /*Struct to contain the info about a plugin*/ @@ -69,18 +70,6 @@ struct _VSTFXHandle int plugincnt; }; -/*No key forwarding enabled in vstfx at the moment - maybe - not required*/ - -struct _VSTFXKey -{ - /** virtual-key code, or 0 if this _VSTFXKey is a `character' key */ - int special; - /** `character' key, or 0 if this _VSTFXKey is a virtual-key */ - int character; -}; - - /*Structure used to describe the instance of VSTFX responsible for a particular plugin instance. These are connected together in a @@ -119,7 +108,7 @@ struct _VSTFX float *want_params; float *set_params; - VSTFXKey pending_keys[16]; + VSTKey pending_keys[16]; int dispatcher_wantcall; int dispatcher_opcode; diff --git a/libs/fst/fst.h b/libs/fst/fst.h index 6cf057d2fa..86a43ba8d8 100644 --- a/libs/fst/fst.h +++ b/libs/fst/fst.h @@ -5,6 +5,8 @@ #include #include +#include "ardour/vst_types.h" + /** * Display FST error message. * @@ -34,7 +36,6 @@ void fst_error (const char *fmt, ...); typedef struct _FST FST; typedef struct _FSTHandle FSTHandle; typedef struct _FSTInfo FSTInfo; -typedef struct _FSTKey FSTKey; struct _FSTInfo { @@ -71,14 +72,6 @@ struct _FSTHandle int plugincnt; }; -struct _FSTKey -{ - /** virtual-key code, or 0 if this _FSTKey is a `character' key */ - int special; - /** `character' key, or 0 if this _FSTKey is a virtual-key */ - int character; -}; - struct _FST { struct AEffect* plugin; @@ -101,7 +94,7 @@ struct _FST float *want_params; float *set_params; - FSTKey pending_keys[16]; + VSTKey pending_keys[16]; int n_pending_keys; int dispatcher_wantcall;