Пример #1
0
void VstSynth::incInstances(int val)
      {
      _instances += val;
      if (_instances == 0 && fstHandle) {
            fst_unload(fstHandle);
            fstHandle = 0;
            }
      }
Пример #2
0
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;

    } else {

	FSTHandle *h;
	FST *fst;
	FSTInfo *info;
	char *fstpath;

	if( !(h = fst_load( dllpath )) ) {
		return NULL;
	}
	if( !(fst = fst_instantiate( h, simple_master_callback, NULL )) ) {
	    fst_unload( h );
	    fst_error( "instantiate failed\n" );
	    return NULL;
	}
	fstpath = fst_dllpath_to_infopath( dllpath );
	if( !fstpath ) {
	    fst_close( fst );
	    fst_unload( h );
	    fst_error( "get fst filename failed\n" );
	    return NULL;
	}
	info = fst_info_from_plugin( fst );
	save_fst_info_file( info, fstpath );

	free( fstpath );
	fst_close( fst );
	fst_unload( h );
	return info;
    }
}