libfluidsynth 1.1.1
Defines | Functions

misc.h File Reference

Miscellaneous utility functions and defines. More...

Defines

#define FLUID_OK   (0)
 Value that indicates success, used by most libfluidsynth functions.
#define FLUID_FAILED   (-1)
 Value that indicates failure, used by most libfluidsynth functions.

Functions

FLUIDSYNTH_API int fluid_is_soundfont (const char *filename)
 Check if a file is a SoundFont file.
FLUIDSYNTH_API int fluid_is_midifile (const char *filename)
 Check if a file is a MIDI file.

Detailed Description

Miscellaneous utility functions and defines.


Define Documentation

#define FLUID_OK   (0)

Value that indicates success, used by most libfluidsynth functions.

Since:
1.1.0

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
#define FLUID_FAILED   (-1)

Value that indicates failure, used by most libfluidsynth functions.

Since:
1.1.0

NOTE: See FLUID_OK for more details.


Function Documentation

FLUIDSYNTH_API 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 SoundFont, FALSE otherwise

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

FLUIDSYNTH_API 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.