Miscellaneous utility functions and defines.
More...
Miscellaneous utility functions and defines.
◆ FLUID_FAILED
#define FLUID_FAILED (-1) |
◆ FLUID_OK
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.
◆ fluid_free()
void fluid_free |
( |
void * |
ptr | ) |
|
Wrapper for free() that satisfies at least C90 requirements.
- Parameters
-
ptr | Pointer 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
-
filename | Path 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
-
filename | Path 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
-
major | Location to store major number |
minor | Location to store minor number |
micro | Location 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.