|
#define | FLUID_FAILED (-1) |
| Value that indicates failure, used by most libfluidsynth functions.
|
|
#define | FLUID_OK (0) |
| Value that indicates success, used by most libfluidsynth functions.
|
|
#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.
|
|
|
void | fluid_free (void *ptr) |
| Wrapper for free() that satisfies at least C90 requirements.
|
|
int | fluid_is_midifile (const char *filename) |
| Check if a file is a MIDI file.
|
|
int | fluid_is_soundfont (const char *filename) |
| Check if a file is a SoundFont file.
|
|
void | fluid_version (int *major, int *minor, int *micro) |
| Get FluidSynth runtime version.
|
|
char * | fluid_version_str (void) |
| Get FluidSynth runtime version as a string.
|
|
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.