Esempio n. 1
0
static FSTInfo *fst_info_from_plugin( FST *fst ) {
    FSTInfo *info = (FSTInfo *) malloc( sizeof( FSTInfo ) );
    struct AEffect *plugin;
    int i;
    char creator[65];

    if( ! fst ) {
	fst_error( "fst is NULL\n" );
	return NULL;
    }

    if( ! info ) return NULL;
    
    plugin = fst->plugin;
    

    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;
    info->numParams = plugin->numParams;
    info->wantMidi = fst_can_midi( fst ); 
    info->hasEditor = plugin->flags & effFlagsHasEditor ? TRUE : FALSE;
    info->canProcessReplacing = plugin->flags & effFlagsCanReplacing ? TRUE : FALSE;

    info->ParamNames = (char **) malloc( sizeof( char * ) * info->numParams );
    info->ParamLabels = (char **) malloc( sizeof( char * ) * info->numParams );
    for( i=0; i<info->numParams; i++ ) {
	char name[20];
	char label[9];
	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;
}
Esempio n. 2
0
static FSTInfo *fst_info_from_plugin( FST *fst ) {
    FSTInfo *info = (FSTInfo *) malloc( sizeof( FSTInfo ) );
    AEffect *plugin;
    int i;

    if( ! fst ) {
	fst_error( "fst is NULL\n" );
	return NULL;
    }

    if( ! info ) return NULL;
    
    plugin = fst->plugin;
    

    info->name = strdup(fst->handle->name ); 
    info->UniqueID = plugin->uniqueID;
    info->Category = strdup( "None" );          // FIXME:  
    info->numInputs = plugin->numInputs;
    info->numOutputs = plugin->numOutputs;
    info->numParams = plugin->numParams;
    info->wantMidi = fst_can_midi( fst ); 
    info->hasEditor = plugin->flags & effFlagsHasEditor ? TRUE : FALSE;
    info->canProcessReplacing = plugin->flags & effFlagsCanReplacing ? TRUE : FALSE;

    info->ParamNames = (char **) malloc( sizeof( char * ) * info->numParams );
    info->ParamLabels = (char **) malloc( sizeof( char * ) * info->numParams );
    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);

	info->ParamNames[i] = strdup( name );
	info->ParamLabels[i] = strdup( label );
    }
    return info;
}