libfluidsynth  2.3.5
Miscellaneous

Miscellaneous utility functions and defines. More...

Macros

#define FLUID_FAILED   (-1)
 Value that indicates failure, used by most libfluidsynth functions. More...
 
#define FLUID_OK   (0)
 Value that indicates success, used by most libfluidsynth functions. More...
 
#define FLUIDSYNTH_VERSION   "2.3.5"
 String constant of libfluidsynth version.
 
#define FLUIDSYNTH_VERSION_MAJOR   2
 libfluidsynth major version integer constant.
 
#define FLUIDSYNTH_VERSION_MICRO   5
 libfluidsynth micro version integer constant.
 
#define FLUIDSYNTH_VERSION_MINOR   3
 libfluidsynth minor version integer constant.
 

Functions

void fluid_free (void *ptr)
 Wrapper for free() that satisfies at least C90 requirements. More...
 
int fluid_is_midifile (const char *filename)
 Check if a file is a MIDI file. More...
 
int fluid_is_soundfont (const char *filename)
 Check if a file is a SoundFont file. More...
 
void fluid_version (int *major, int *minor, int *micro)
 Get FluidSynth runtime version. More...
 
char * fluid_version_str (void)
 Get FluidSynth runtime version as a string. More...
 

Detailed Description

Miscellaneous utility functions and defines.

Macro Definition Documentation

◆ FLUID_FAILED

#define FLUID_FAILED   (-1)

Value that indicates failure, used by most libfluidsynth functions.

Note
See FLUID_OK for more details.
Since
1.1.0
Examples
example.c, fluidsynth_fx.c, fluidsynth_process.c, and fluidsynth_sfload_mem.c.

◆ FLUID_OK

#define FLUID_OK   (0)

Value that indicates success, used by most libfluidsynth functions.

Note
This was not publicly defined prior to libfluidsynth 1.1.0. When writing code which should also be compatible with older versions, something like the following can be used:
#include <fluidsynth.h>
#ifndef FLUID_OK
#define FLUID_OK (0)
#define FLUID_FAILED (-1)
#endif
Since
1.1.0
Examples
fluidsynth_fx.c, fluidsynth_register_adriver.c, and fluidsynth_sfload_mem.c.

Function Documentation

◆ fluid_free()

void fluid_free ( void *  ptr)

Wrapper for free() that satisfies at least C90 requirements.

Parameters
ptrPointer to memory region that should be freed
Note
Only use this function when the API documentation explicitly says so. Otherwise use adequate delete_fluid_* functions.
Warning
Calling ::free() on memory that is advised to be freed with fluid_free() results in undefined behaviour! (cf.: "Potential Errors Passing CRT Objects Across DLL Boundaries" found in MS Docs)
Since
2.0.7

◆ fluid_is_midifile()

int fluid_is_midifile ( const char *  filename)

Check if a file is a MIDI file.

Parameters
filenamePath to the file to check
Returns
TRUE if it could be a MIDI file, FALSE otherwise

The current implementation only checks for the "MThd" header in the file. It is useful only to distinguish between SoundFont and MIDI files.

◆ fluid_is_soundfont()

int fluid_is_soundfont ( const char *  filename)

Check if a file is a SoundFont file.

Parameters
filenamePath to the file to check
Returns
TRUE if it could be a SF2, SF3 or DLS file, FALSE otherwise

If fluidsynth was built with DLS support, this function will also identify DLS files.

Note
This function only checks whether header(s) in the RIFF chunk are present. A call to fluid_synth_sfload() might still fail.

◆ fluid_version()

void fluid_version ( int *  major,
int *  minor,
int *  micro 
)

Get FluidSynth runtime version.

Parameters
majorLocation to store major number
minorLocation to store minor number
microLocation to store micro number

◆ fluid_version_str()

char* fluid_version_str ( void  )

Get FluidSynth runtime version as a string.

Returns
FluidSynth version string, which is internal and should not be modified or freed.