summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-22 01:28:27 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-22 01:28:27 +0000
commitd98b2b6039f4733bc264046810d56c5b56ddb288 (patch)
tree07fab2d23ab6a708b96d0a570391ee22be3edf65
parentac647e5fec542ad8b38d0a3080e9d0cf4c1a4bbd (diff)
Use same aeffectx.h for windows and linux VSTs.
git-svn-id: svn://localhost/ardour2/branches/3.0@10757 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/ardour/buffer_set.h6
-rwxr-xr-xlibs/ardour/ardour/lxvst_plugin.h3
-rw-r--r--libs/ardour/ardour/session.h3
-rwxr-xr-xlibs/ardour/ardour/vestige/aeffectx.h249
-rwxr-xr-xlibs/ardour/ardour/vstfx.h4
-rw-r--r--libs/ardour/ardour/windows_vst_plugin.h5
-rw-r--r--libs/ardour/buffer_set.cc6
-rw-r--r--libs/ardour/session_vst.cc2
-rwxr-xr-xlibs/ardour/vstfxinfofile.cc7
-rw-r--r--libs/ardour/windows_vst_plugin.cc2
-rw-r--r--libs/fst/fst.h7
-rw-r--r--libs/fst/fstinfofile.c22
-rw-r--r--libs/fst/vsti.c10
13 files changed, 162 insertions, 164 deletions
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h
index 5b0234de46..b64cdb7b60 100644
--- a/libs/ardour/ardour/buffer_set.h
+++ b/libs/ardour/ardour/buffer_set.h
@@ -31,8 +31,10 @@
#if defined VST_SUPPORT || defined LXVST_SUPPORT
#include "evoral/MIDIEvent.hpp"
-struct VstEvents;
-struct VstMidiEvent;
+struct _VstEvents;
+typedef struct _VstEvents VstEvents;
+struct _VstMidiEvent;
+typedef struct _VstMidiEvent VstMidiEvent;
#endif
namespace ARDOUR {
diff --git a/libs/ardour/ardour/lxvst_plugin.h b/libs/ardour/ardour/lxvst_plugin.h
index 108437b6a3..db0d5cd953 100755
--- a/libs/ardour/ardour/lxvst_plugin.h
+++ b/libs/ardour/ardour/lxvst_plugin.h
@@ -34,7 +34,8 @@ struct _VSTFXHandle;
struct _VSTFX;
typedef struct _VSTFXHandle VSTFXHandle;
typedef struct _VSTFX VSTFX;
-class AEffect;
+struct _AEffect;
+typedef struct _AEffect AEffect;
namespace ARDOUR {
class AudioEngine;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index d302c310c8..b9e426c96f 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -64,7 +64,8 @@
class XMLTree;
class XMLNode;
-class AEffect;
+struct _AEffect;
+typedef struct _AEffect AEffect;
namespace MIDI {
class Port;
diff --git a/libs/ardour/ardour/vestige/aeffectx.h b/libs/ardour/ardour/vestige/aeffectx.h
index 14ecb5ea6e..29fdb9a145 100755
--- a/libs/ardour/ardour/vestige/aeffectx.h
+++ b/libs/ardour/ardour/vestige/aeffectx.h
@@ -30,99 +30,106 @@
( ( (int) c ) << 8 ) | \
( ( (int) d ) << 0 ) )
-const int audioMasterAutomate = 0;
-const int audioMasterVersion = 1;
-const int audioMasterCurrentId = 2;
-const int audioMasterIdle = 3;
-const int audioMasterPinConnected = 4;
+#define audioMasterAutomate 0
+#define audioMasterVersion 1
+#define audioMasterCurrentId 2
+#define audioMasterIdle 3
+#define audioMasterPinConnected 4
// unsupported? 5
-const int audioMasterWantMidi = 6;
-const int audioMasterGetTime = 7;
-const int audioMasterProcessEvents = 8;
-const int audioMasterSetTime = 9;
-const int audioMasterTempoAt = 10;
-const int audioMasterGetNumAutomatableParameters = 11;
-const int audioMasterGetParameterQuantization = 12;
-const int audioMasterIOChanged = 13;
-const int audioMasterNeedIdle = 14;
-const int audioMasterSizeWindow = 15;
-const int audioMasterGetSampleRate = 16;
-const int audioMasterGetBlockSize = 17;
-const int audioMasterGetInputLatency = 18;
-const int audioMasterGetOutputLatency = 19;
-const int audioMasterGetPreviousPlug = 20;
-const int audioMasterGetNextPlug = 21;
-const int audioMasterWillReplaceOrAccumulate = 22;
-const int audioMasterGetCurrentProcessLevel = 23;
-const int audioMasterGetAutomationState = 24;
-const int audioMasterOfflineStart = 25;
-const int audioMasterOfflineRead = 26;
-const int audioMasterOfflineWrite = 27;
-const int audioMasterOfflineGetCurrentPass = 28;
-const int audioMasterOfflineGetCurrentMetaPass = 29;
-const int audioMasterSetOutputSampleRate = 30;
+#define audioMasterWantMidi 6
+#define audioMasterGetTime 7
+#define audioMasterProcessEvents 8
+#define audioMasterSetTime 9
+#define audioMasterTempoAt 10
+#define audioMasterGetNumAutomatableParameters 11
+#define audioMasterGetParameterQuantization 12
+#define audioMasterIOChanged 13
+#define audioMasterNeedIdle 14
+#define audioMasterSizeWindow 15
+#define audioMasterGetSampleRate 16
+#define audioMasterGetBlockSize 17
+#define audioMasterGetInputLatency 18
+#define audioMasterGetOutputLatency 19
+#define audioMasterGetPreviousPlug 20
+#define audioMasterGetNextPlug 21
+#define audioMasterWillReplaceOrAccumulate 22
+#define audioMasterGetCurrentProcessLevel 23
+#define audioMasterGetAutomationState 24
+#define audioMasterOfflineStart 25
+#define audioMasterOfflineRead 26
+#define audioMasterOfflineWrite 27
+#define audioMasterOfflineGetCurrentPass 28
+#define audioMasterOfflineGetCurrentMetaPass 29
+#define audioMasterSetOutputSampleRate 30
// unsupported? 31
-const int audioMasterGetSpeakerArrangement = 31; // deprecated in 2.4?
-const int audioMasterGetVendorString = 32;
-const int audioMasterGetProductString = 33;
-const int audioMasterGetVendorVersion = 34;
-const int audioMasterVendorSpecific = 35;
-const int audioMasterSetIcon = 36;
-const int audioMasterCanDo = 37;
-const int audioMasterGetLanguage = 38;
-const int audioMasterOpenWindow = 39;
-const int audioMasterCloseWindow = 40;
-const int audioMasterGetDirectory = 41;
-const int audioMasterUpdateDisplay = 42;
-const int audioMasterBeginEdit = 43;
-const int audioMasterEndEdit = 44;
-const int audioMasterOpenFileSelector = 45;
-const int audioMasterCloseFileSelector = 46; // currently unused
-const int audioMasterEditFile = 47; // currently unused
-const int audioMasterGetChunkFile = 48; // currently unused
-const int audioMasterGetInputSpeakerArrangement = 49; // currently unused
-
-const int effFlagsHasEditor = 1;
-const int effFlagsCanReplacing = 1 << 4; // very likely
-const int effFlagsIsSynth = 1 << 8; // currently unused
-
-const int effOpen = 0;
-const int effClose = 1; // currently unused
-const int effSetProgram = 2; // currently unused
-const int effGetProgram = 3; // currently unused
-const int effGetProgramName = 5; // currently unused
-const int effGetParamName = 8; // currently unused
-const int effSetSampleRate = 10;
-const int effSetBlockSize = 11;
-const int effMainsChanged = 12;
-const int effEditGetRect = 13;
-const int effEditOpen = 14;
-const int effEditClose = 15;
-const int effEditIdle = 19;
-const int effEditTop = 20;
-const int effProcessEvents = 25;
-const int effGetEffectName = 45;
-const int effGetParameterProperties = 47; // missing
-const int effGetVendorString = 47;
-const int effGetProductString = 48;
-const int effGetVendorVersion = 49;
-const int effCanDo = 51; // currently unused
-const int effGetVstVersion = 58; // currently unused
-
-const int kEffectMagic = CCONST( 'V', 's', 't', 'P' );
-const int kVstLangEnglish = 1;
-const int kVstMidiType = 1;
-const int kVstParameterUsesFloatStep = 1 << 2;
-const int kVstTempoValid = 1 << 10;
-const int kVstTransportPlaying = 1 << 1;
-
-
-class RemoteVstPlugin;
-
-
-class VstMidiEvent
+#define audioMasterGetSpeakerArrangement 31 // deprecated in 2.4?
+#define audioMasterGetVendorString 32
+#define audioMasterGetProductString 33
+#define audioMasterGetVendorVersion 34
+#define audioMasterVendorSpecific 35
+#define audioMasterSetIcon 36
+#define audioMasterCanDo 37
+#define audioMasterGetLanguage 38
+#define audioMasterOpenWindow 39
+#define audioMasterCloseWindow 40
+#define audioMasterGetDirectory 41
+#define audioMasterUpdateDisplay 42
+#define audioMasterBeginEdit 43
+#define audioMasterEndEdit 44
+#define audioMasterOpenFileSelector 45
+#define audioMasterCloseFileSelector 46 // currently unused
+#define audioMasterEditFile 47 // currently unused
+#define audioMasterGetChunkFile 48 // currently unused
+#define audioMasterGetInputSpeakerArrangement 49 // currently unused
+
+#define effFlagsHasEditor 1
+#define effFlagsCanReplacing (1 << 4) // very likely
+#define effFlagsIsSynth (1 << 8) // currently unused
+
+#define effOpen 0
+#define effClose 1 // currently unused
+#define effSetProgram 2 // currently unused
+#define effGetProgram 3 // currently unused
+#define effGetProgramName 5 // currently unused
+#define effGetParamName 8 // currently unused
+#define effSetSampleRate 10
+#define effSetBlockSize 11
+#define effMainsChanged 12
+#define effEditGetRect 13
+#define effEditOpen 14
+#define effEditClose 15
+#define effEditIdle 19
+#define effEditTop 20
+#define effProcessEvents 25
+#define effGetEffectName 45
+#define effGetParameterProperties 47 // missing
+#define effGetVendorString 47
+#define effGetProductString 48
+#define effGetVendorVersion 49
+#define effCanDo 51 // currently unused
+#define effGetVstVersion 58 // currently unused
+
+#define kEffectMagic (CCONST( 'V', 's', 't', 'P' ))
+#define kVstLangEnglish 1
+#define kVstMidiType 1
+#define kVstParameterUsesFloatStep (1 << 2)
+#define kVstTempoValid (1 << 10)
+#define kVstTransportPlaying (1 << 1)
+
+
+struct RemoteVstPlugin;
+
+#define kVstNanosValid (1 << 8)
+#define kVstPpqPosValid (1 << 9)
+#define kVstTempoValid (1 << 10)
+#define kVstBarsValid (1 << 11)
+#define kVstCyclePosValid (1 << 12)
+#define kVstTimeSigValid (1 << 13)
+#define kVstSmpteValid (1 << 14)
+#define kVstClockValid (1 << 15)
+
+struct _VstMidiEvent
{
-public:
// 00
int type;
// 04
@@ -145,40 +152,34 @@ public:
char reserved1;
// 1f?
char reserved2;
+};
-} ;
-
-
+typedef struct _VstMidiEvent VstMidiEvent;
-class VstEvent
+struct _VstEvent
{
- char dump[sizeof( VstMidiEvent )];
+ char dump[sizeof (VstMidiEvent)];
-} ;
+};
+typedef struct _VstEvent VstEvent;
-
-
-class VstEvents
+struct _VstEvents
{
-public:
// 00
int numEvents;
// 04
void *reserved;
// 08
VstEvent * events[];
+};
-} ;
-
-
-
+typedef struct _VstEvents VstEvents;
// Not finished, neither really used
-class VstParameterProperties
+struct _VstParameterProperties
{
-public:
float stepFloat;
char label[64];
int flags;
@@ -189,26 +190,23 @@ public:
int category;
char categoryLabel[24];
char empty[128];
+};
-} ;
-
+typedef struct _VstParameterProperties VstParameterProperties;
-
-
-class AEffect
+struct _AEffect
{
-public:
// Never use virtual functions!!!
// 00-03
int magic;
// dispatcher 04-07
- intptr_t (* dispatcher)( AEffect * , int , int , intptr_t, void * , float );
+ intptr_t (* dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
// process, quite sure 08-0b
- void (* process)( AEffect * , float * * , float * * , int );
+ void (* process) (struct _AEffect *, float **, float **, int);
// setParameter 0c-0f
- void (* setParameter)( AEffect * , int , float );
+ void (* setParameter) (struct _AEffect *, int, float);
// getParameter 10-13
- float (* getParameter)( AEffect * , int );
+ float (* getParameter) (struct _AEffect *, int);
// programs 14-17
int numPrograms;
// Params 18-1b
@@ -235,16 +233,13 @@ public:
// Don't know 4c-4f
char unknown1[4];
// processReplacing 50-53
- void (* processReplacing)( AEffect * , float * * , float * * , int );
-
-} ;
+ void (* processReplacing) (struct _AEffect *, float **, float **, int);
+};
+typedef struct _AEffect AEffect;
-
-
-class VstTimeInfo
+struct _VstTimeInfo
{
-public:
// 00
double samplePos;
// 08
@@ -263,12 +258,10 @@ public:
char empty3[4 + 4 + 4];
// 54
int flags;
+};
-} ;
-
-
-
-typedef intptr_t (* audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float );
+typedef struct _VstTimeInfo VstTimeInfo;
+typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);
#endif
diff --git a/libs/ardour/ardour/vstfx.h b/libs/ardour/ardour/vstfx.h
index 33cac1d1ca..7ddc5c39ec 100755
--- a/libs/ardour/ardour/vstfx.h
+++ b/libs/ardour/ardour/vstfx.h
@@ -51,7 +51,7 @@ struct _VSTFXInfo
/*The AEffect which contains the info about a plugin instance*/
-typedef struct AEffect * (*main_entry_t)(audioMasterCallback);
+typedef AEffect * (*main_entry_t) (audioMasterCallback);
/*A handle used to identify a plugin to vstfx*/
@@ -73,7 +73,7 @@ struct _VSTFXHandle
struct _VSTFX
{
- struct AEffect* plugin;
+ AEffect* plugin;
int window; /* The plugin's parent X11 XWindow */
int plugin_ui_window; /*The ID of the plugin UI window created by the plugin*/
int xid; /* X11 XWindow */
diff --git a/libs/ardour/ardour/windows_vst_plugin.h b/libs/ardour/ardour/windows_vst_plugin.h
index 5e6d906184..e4b23fc46e 100644
--- a/libs/ardour/ardour/windows_vst_plugin.h
+++ b/libs/ardour/ardour/windows_vst_plugin.h
@@ -31,10 +31,11 @@
#include "ardour/plugin.h"
struct _FSTHandle;
-struct _FST;
typedef struct _FSTHandle FSTHandle;
+struct _FST;
typedef struct _FST FST;
-class AEffect;
+struct _AEffect;
+typedef struct _AEffect AEffect;
namespace ARDOUR {
class AudioEngine;
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc
index b57047dfee..4fc335a080 100644
--- a/libs/ardour/buffer_set.cc
+++ b/libs/ardour/buffer_set.cc
@@ -37,11 +37,7 @@
#include "ardour/lv2_plugin.h"
#include "ardour/lv2_event_buffer.h"
#endif
-#ifdef WINDOWS_VST_SUPPORT
-#include "vestige/aeffectx.h"
-#endif
-
-#ifdef LXVST_SUPPORT
+#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT
#include "ardour/vestige/aeffectx.h"
#endif
diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc
index 3e3a6d36d2..f5d6c7c10a 100644
--- a/libs/ardour/session_vst.cc
+++ b/libs/ardour/session_vst.cc
@@ -21,11 +21,11 @@
#include <cstdio>
#include <fst.h>
-#include <fst/vestige/aeffectx.h>
#include "ardour/session.h"
#include "ardour/tempo.h"
#include "ardour/windows_vst_plugin.h"
+#include "ardour/vestige/aeffectx.h"
#include "i18n.h"
diff --git a/libs/ardour/vstfxinfofile.cc b/libs/ardour/vstfxinfofile.cc
index f98361fa18..9c613c654f 100755
--- a/libs/ardour/vstfxinfofile.cc
+++ b/libs/ardour/vstfxinfofile.cc
@@ -257,7 +257,7 @@ static FILE* vstfx_infofile_for_write (char* dllpath)
static int vstfx_can_midi(VSTFX *vstfx)
{
- struct AEffect *plugin = vstfx->plugin;
+ AEffect *plugin = vstfx->plugin;
int vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, 0, 0.0f);
@@ -276,7 +276,7 @@ static VSTFXInfo* vstfx_info_from_plugin(VSTFX *vstfx)
VSTFXInfo* info = (VSTFXInfo*) malloc(sizeof(VSTFXInfo));
- struct AEffect *plugin;
+ AEffect *plugin;
int i;
/*We need to init the creator because some plugins
@@ -346,7 +346,8 @@ static VSTFXInfo* vstfx_info_from_plugin(VSTFX *vstfx)
/* A simple 'dummy' audiomaster callback which should be ok,
we will only be instantiating the plugin in order to get its info*/
-static intptr_t simple_master_callback(struct AEffect *, int32_t opcode, int32_t, intptr_t, void *, float)
+static intptr_t
+simple_master_callback (AEffect *, int32_t opcode, int32_t, intptr_t, void *, float)
{
if (opcode == audioMasterVersion)
return 2;
diff --git a/libs/ardour/windows_vst_plugin.cc b/libs/ardour/windows_vst_plugin.cc
index 8e94fd6b3a..73aa839ac6 100644
--- a/libs/ardour/windows_vst_plugin.cc
+++ b/libs/ardour/windows_vst_plugin.cc
@@ -619,7 +619,7 @@ WindowsVSTPlugin::unique_id() const
{
char buf[32];
- snprintf (buf, sizeof (buf), "%d", *((int32_t*) &_plugin->unused_id));
+ snprintf (buf, sizeof (buf), "%d", *((int32_t*) &_plugin->uniqueID));
return string (buf);
}
diff --git a/libs/fst/fst.h b/libs/fst/fst.h
index 15ba72d66f..f4482ec377 100644
--- a/libs/fst/fst.h
+++ b/libs/fst/fst.h
@@ -6,6 +6,7 @@
#include <pthread.h>
#include "ardour/vst_types.h"
+#include "ardour/vestige/aeffectx.h"
/**
* Display FST error message.
@@ -27,8 +28,6 @@ void fst_set_error_function (void (*func)(const char *));
void fst_error (const char *fmt, ...);
-#include <vestige/aeffectx.h>
-
typedef struct _FST FST;
typedef struct _FSTHandle FSTHandle;
typedef struct _FSTInfo FSTInfo;
@@ -55,7 +54,7 @@ struct _FSTInfo
char **ParamLabels;
};
-typedef struct AEffect * (*main_entry_t)(audioMasterCallback);
+typedef AEffect * (*main_entry_t)(audioMasterCallback);
struct _FSTHandle
{
@@ -70,7 +69,7 @@ struct _FSTHandle
struct _FST
{
- struct AEffect* plugin;
+ AEffect* plugin;
void* window; /* win32 HWND */
int xid; /* X11 XWindow */
FSTHandle* handle;
diff --git a/libs/fst/fstinfofile.c b/libs/fst/fstinfofile.c
index 63f0c35cc2..d848d3ae34 100644
--- a/libs/fst/fstinfofile.c
+++ b/libs/fst/fstinfofile.c
@@ -145,8 +145,10 @@ static int fst_info_file_is_valid( char *dllpath ) {
return TRUE;
}
-static int fst_can_midi( FST *fst ) {
- struct AEffect *plugin = fst->plugin;
+static int
+fst_can_midi (FST *fst)
+{
+ AEffect* plugin = fst->plugin;
int vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0.0f);
if (vst_version >= 2) {
@@ -160,11 +162,13 @@ static int fst_can_midi( FST *fst ) {
return FALSE;
}
-static FSTInfo *fst_info_from_plugin( FST *fst ) {
- FSTInfo *info = (FSTInfo *) malloc( sizeof( FSTInfo ) );
- struct AEffect *plugin;
- int i;
- char creator[65];
+static FSTInfo *
+fst_info_from_plugin (FST* fst)
+{
+ FSTInfo* info = (FSTInfo *) malloc( sizeof( FSTInfo ) );
+ AEffect* plugin;
+ int i;
+ char creator[65];
if( ! fst ) {
fst_error( "fst is NULL\n" );
@@ -184,7 +188,7 @@ static FSTInfo *fst_info_from_plugin( FST *fst ) {
info->creator = strdup (creator);
}
- info->UniqueID = *((int32_t *) &plugin->unused_id);
+ info->UniqueID = *((int32_t *) &plugin->uniqueID);
info->Category = strdup( "None" ); // FIXME:
info->numInputs = plugin->numInputs;
@@ -213,7 +217,7 @@ static FSTInfo *fst_info_from_plugin( FST *fst ) {
// most simple one :) could be sufficient....
static intptr_t
-simple_master_callback (struct AEffect *fx, int32_t opcode, int32_t index, intptr_t value, void *ptr, float opt)
+simple_master_callback (AEffect *fx, int32_t opcode, int32_t index, intptr_t value, void *ptr, float opt)
{
if (opcode == audioMasterVersion) {
return 2;
diff --git a/libs/fst/vsti.c b/libs/fst/vsti.c
index 6a64f9c5e4..a9f5076775 100644
--- a/libs/fst/vsti.c
+++ b/libs/fst/vsti.c
@@ -30,9 +30,9 @@
#include <fcntl.h>
#include <stdbool.h>
#include <jackvst.h>
-#include <vestige/aeffectx.h>
#include <pthread.h>
#include <sched.h>
+#include "ardour/vestige/aeffectx.h"
snd_seq_t *
create_sequencer (const char* client_name, bool isinput)
@@ -66,17 +66,17 @@ create_sequencer (const char* client_name, bool isinput)
static void
queue_midi (JackVST *jvst, int val1, int val2, int val3)
{
- struct VstMidiEvent *pevent;
+ VstMidiEvent *pevent;
jack_ringbuffer_data_t vec[2];
jack_ringbuffer_get_write_vector (jvst->event_queue, vec);
- if (vec[0].len < sizeof (struct VstMidiEvent)) {
+ if (vec[0].len < sizeof (VstMidiEvent)) {
fst_error ("event queue has no write space");
return;
}
- pevent = (struct VstMidiEvent *) vec[0].buf;
+ pevent = (VstMidiEvent *) vec[0].buf;
// printf("note: %d\n",note);
@@ -97,7 +97,7 @@ queue_midi (JackVST *jvst, int val1, int val2, int val3)
//printf("Sending: %x %x %x\n",val1,val2,val3);
- jack_ringbuffer_write_advance (jvst->event_queue, sizeof (struct VstMidiEvent));
+ jack_ringbuffer_write_advance (jvst->event_queue, sizeof (VstMidiEvent));
}
void *midireceiver(void *arg)