-
#include "fst.h"
-#include "vst/aeffectx.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
-#include <stdlib.h>
#define MAX_STRING_LEN 256
#define FALSE 0
#define TRUE !FALSE
+extern char * strdup (const char *);
+
static char *read_string( FILE *fp ) {
char buf[MAX_STRING_LEN];
}
if( (info->name = read_string( fp )) == NULL ) goto error;
+ if( (info->creator = read_string( fp )) == NULL ) goto error;
if( 1 != fscanf( fp, "%d\n", &info->UniqueID ) ) goto error;
if( (info->Category = read_string( fp )) == NULL ) goto error;
if( 1 != fscanf( fp, "%d\n", &info->numInputs ) ) goto error;
}
fprintf( fp, "%s\n", info->name );
+ fprintf( fp, "%s\n", info->creator );
fprintf( fp, "%d\n", info->UniqueID );
fprintf( fp, "%s\n", info->Category );
fprintf( fp, "%d\n", info->numInputs );
if( strstr( dllpath, ".dll" ) == NULL ) return NULL;
retval = strdup( dllpath );
- sprintf( retval + strlen(retval) - 4, ".fst" );
+ sprintf( retval + strlen(retval) - 4, ".fsi" );
return retval;
}
}
static int fst_can_midi( FST *fst ) {
- AEffect *plugin = fst->plugin;
+ struct AEffect *plugin = fst->plugin;
int vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0.0f);
if (vst_version >= 2) {
}
static FSTInfo *fst_info_from_plugin( FST *fst ) {
FSTInfo *info = (FSTInfo *) malloc( sizeof( FSTInfo ) );
- AEffect *plugin;
+ struct AEffect *plugin;
int i;
+ char creator[65];
if( ! fst ) {
fst_error( "fst is NULL\n" );
info->name = strdup(fst->handle->name );
+ plugin->dispatcher (plugin, 47 /* effGetVendorString */, 0, 0, creator, 0);
+ if (strlen (creator) == 0) {
+ info->creator = strdup ("Unknown");
+ } else {
+ info->creator = strdup (creator);
+ }
+
+#ifdef VESTIGE_HEADER
+ info->UniqueID = *((int32_t *) &plugin->unused_id);
+#else
info->UniqueID = plugin->uniqueID;
+#endif
+
info->Category = strdup( "None" ); // FIXME:
info->numInputs = plugin->numInputs;
info->numOutputs = plugin->numOutputs;
for( i=0; i<info->numParams; i++ ) {
char name[20];
char label[9];
- plugin->dispatcher (plugin,
- effGetParamName,
- i, 0, name, 0);
-
- plugin->dispatcher (plugin,
- effGetParamLabel,
- i, 0, label, 0);
-
+ plugin->dispatcher (plugin,
+ effGetParamName,
+ i, 0, name, 0);
info->ParamNames[i] = strdup( name );
+ plugin->dispatcher (plugin,
+ 6 /* effGetParamLabel */,
+ i, 0, label, 0);
info->ParamLabels[i] = strdup( label );
}
return info;
}
// most simple one :) could be sufficient....
-static long simple_master_callback( AEffect *fx, long opcode, long index, long value, void *ptr, float opt ) {
+static long simple_master_callback( struct AEffect *fx, long opcode, long index, long value, void *ptr, float opt ) {
if( opcode == audioMasterVersion )
return 2;
else
FSTInfo *info;
char *fstpath;
- if( !(h = fst_load( dllpath )) ) {
- return NULL;
- }
+ if( !(h = fst_load( dllpath )) ) return NULL;
if( !(fst = fst_instantiate( h, simple_master_callback, NULL )) ) {
fst_unload( h );
fst_error( "instantiate failed\n" );
free( info->ParamLabels[i] );
}
free( info->name );
+ free( info->creator );
free( info->Category );
free( info );
}