fix LTC slave latency compensation typo
[ardour.git] / libs / fst / fstinfofile.c
index 63f0c35cc20645d4bd5b9779a99a0d78f77de910..4b5e95c2d1c03e7c2ec7acca1390edd5e83a7235 100644 (file)
@@ -31,22 +31,23 @@ static char *read_string( FILE *fp ) {
     }
 }
 
-static FSTInfo *load_fst_info_file( char *filename ) {
-
-    FSTInfo *info = (FSTInfo *) malloc( sizeof( FSTInfo ) );
-    FILE *fp;
-    int i;
-
-
-    if( info == NULL )
-       return NULL;
+static VSTInfo *
+load_fst_info_file (char* filename)
+{
+       VSTInfo *info = (VSTInfo *) malloc (sizeof (VSTInfo));
+       FILE *fp;
+       int i;
+       
+       if (info == NULL) {
+               return NULL;
+       }
 
-    fp = fopen( filename, "r" );
-    
-    if( fp == NULL ) {
-       free( info );
-       return NULL;
-    }
+       fp = fopen( filename, "r" );
+       
+       if (fp == NULL) {
+               free (info);
+               return NULL;
+       }
 
     if( (info->name = read_string( fp )) == NULL ) goto error;
     if( (info->creator = read_string( fp )) == NULL ) goto error;
@@ -78,8 +79,9 @@ error:
     return NULL;
 }
 
-static int save_fst_info_file( FSTInfo *info, char *filename ) {
-
+static int
+save_fst_info_file (VSTInfo* info, char* filename)
+{
     FILE *fp;
     int i;
 
@@ -145,8 +147,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 (VSTState* fst)
+{
+       AEffect* plugin = fst->plugin;
        int vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0.0f);
 
        if (vst_version >= 2) {
@@ -160,11 +164,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 VSTInfo *
+fst_info_from_plugin (VSTState* fst)
+{
+       VSTInfo* info = (VSTInfo *) malloc (sizeof (VSTInfo));
+       AEffect* plugin;
+       int i;
+       char creator[65];
 
     if( ! fst ) {
        fst_error( "fst is NULL\n" );
@@ -184,7 +190,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 +219,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;
@@ -222,22 +228,23 @@ simple_master_callback (struct AEffect *fx, int32_t opcode, int32_t index, intpt
        }
 }
 
-FSTInfo *fst_get_info( char *dllpath ) {
-
-    if( fst_info_file_is_valid( dllpath ) ) {
-       FSTInfo *info;
-       char *fstpath = fst_dllpath_to_infopath( dllpath );
-
-       info = load_fst_info_file( fstpath );
-       free( fstpath );
-       return info;
+VSTInfo *
+fst_get_info (char* dllpath)
+{
+       if( fst_info_file_is_valid( dllpath ) ) {
+               VSTInfo *info;
+               char *fstpath = fst_dllpath_to_infopath( dllpath );
+               
+               info = load_fst_info_file( fstpath );
+               free( fstpath );
+               return info;
 
     } else {
 
-       FSTHandle *h;
-       FST *fst;
-       FSTInfo *info;
-       char *fstpath;
+       VSTHandle* h;
+       VSTState* fst;
+       VSTInfo* info;
+       charfstpath;
 
        if( !(h = fst_load( dllpath )) ) return NULL;
        if( !(fst = fst_instantiate( h, simple_master_callback, NULL )) ) {
@@ -262,8 +269,9 @@ FSTInfo *fst_get_info( char *dllpath ) {
     }
 }
 
-void fst_free_info( FSTInfo *info ) {
-
+void
+fst_free_info (VSTInfo *info)
+{
     int i;
 
     for( i=0; i<info->numParams; i++ ) {