libfluidsynth  1.1.8
Macros | Functions
misc.h File Reference

Miscellaneous utility functions and defines. More...

Macros

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

Functions

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

Detailed Description

Miscellaneous utility functions and defines.

Macro Definition Documentation

◆ FLUID_OK

#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
Examples:
fluidsynth_register_adriver.c.

Referenced by delete_fluid_midi_event(), delete_fluid_midi_router(), delete_fluid_player(), delete_fluid_ramsample(), delete_fluid_synth(), fluid_audio_driver_register(), fluid_cmd_handler_register(), fluid_file_renderer_process_block(), fluid_file_set_encoding_quality(), fluid_gen_set_default_values(), fluid_get_stdout(), fluid_get_sysconf(), fluid_is_soundfont(), fluid_midi_event_set_channel(), fluid_midi_event_set_control(), fluid_midi_event_set_key(), fluid_midi_event_set_pitch(), fluid_midi_event_set_program(), fluid_midi_event_set_sysex(), fluid_midi_event_set_type(), fluid_midi_event_set_value(), fluid_midi_event_set_velocity(), fluid_midi_router_add_rule(), fluid_midi_router_clear_rules(), fluid_midi_router_handle_midi_event(), fluid_midi_router_set_default_rules(), fluid_player_add(), fluid_player_add_mem(), fluid_player_get_midi_tempo(), fluid_player_join(), fluid_player_play(), fluid_player_set_loop(), fluid_player_set_midi_tempo(), fluid_player_set_playback_callback(), fluid_player_stop(), fluid_ramsfont_add_izone(), fluid_ramsfont_create_sfont(), fluid_ramsfont_izone_set_loop(), fluid_ramsfont_remove_izone(), fluid_ramsfont_set_name(), fluid_sample_set_name(), fluid_sample_set_sound_data(), fluid_synth_activate_key_tuning(), fluid_synth_activate_octave_tuning(), fluid_synth_activate_tuning(), fluid_synth_all_notes_off(), fluid_synth_all_sounds_off(), fluid_synth_alloc_voice(), fluid_synth_bank_select(), fluid_synth_cc(), fluid_synth_deactivate_tuning(), fluid_synth_get_cc(), fluid_synth_get_channel_info(), fluid_synth_get_cpu_load(), fluid_synth_get_pitch_bend(), fluid_synth_get_pitch_wheel_sens(), fluid_synth_get_program(), fluid_synth_noteoff(), fluid_synth_nwrite_float(), fluid_synth_process(), fluid_synth_program_reset(), fluid_synth_set_channel_type(), fluid_synth_set_chorus(), fluid_synth_set_gen(), fluid_synth_set_gen2(), fluid_synth_set_interp_method(), fluid_synth_set_polyphony(), fluid_synth_set_reverb(), fluid_synth_set_reverb_on(), fluid_synth_sfont_select(), fluid_synth_stop(), fluid_synth_sysex(), fluid_synth_system_reset(), fluid_synth_tune_notes(), fluid_synth_tuning_dump(), fluid_synth_write_float(), fluid_voice_gen_get(), fluid_voice_get_velocity(), fluid_voice_optimize_sample(), and fluid_voice_update_param().

◆ FLUID_FAILED

#define FLUID_FAILED   (-1)

Value that indicates failure, used by most libfluidsynth functions.

Since
1.1.0

NOTE: See FLUID_OK for more details.

Referenced by delete_fluid_midi_router(), delete_fluid_player(), fluid_audio_driver_register(), fluid_file_renderer_process_block(), fluid_file_set_encoding_quality(), fluid_get_sysconf(), fluid_log(), fluid_midi_event_set_sysex(), fluid_midi_router_add_rule(), fluid_midi_router_clear_rules(), fluid_midi_router_handle_midi_event(), fluid_midi_router_set_default_rules(), fluid_player_add(), fluid_player_add_mem(), fluid_player_play(), fluid_ramsfont_add_izone(), fluid_ramsfont_izone_set_gen(), fluid_ramsfont_izone_set_loop(), fluid_ramsfont_remove_izone(), fluid_sample_set_sound_data(), fluid_sequencer_add_midi_event_to_buffer(), fluid_sequencer_get_client_id(), fluid_sequencer_register_client(), fluid_sequencer_register_fluidsynth(), fluid_synth_activate_key_tuning(), fluid_synth_activate_octave_tuning(), fluid_synth_activate_tuning(), fluid_synth_add_sfont(), fluid_synth_all_notes_off(), fluid_synth_all_sounds_off(), fluid_synth_bank_select(), fluid_synth_cc(), fluid_synth_channel_pressure(), fluid_synth_deactivate_tuning(), fluid_synth_get_active_voice_count(), fluid_synth_get_cc(), fluid_synth_get_channel_info(), fluid_synth_get_cpu_load(), fluid_synth_get_gen(), fluid_synth_get_pitch_bend(), fluid_synth_get_pitch_wheel_sens(), fluid_synth_get_polyphony(), fluid_synth_get_program(), fluid_synth_get_settings(), fluid_synth_handle_midi_event(), fluid_synth_noteoff(), fluid_synth_noteon(), fluid_synth_pitch_bend(), fluid_synth_pitch_wheel_sens(), fluid_synth_process(), fluid_synth_program_change(), fluid_synth_program_select(), fluid_synth_program_select_by_sfont_name(), fluid_synth_set_bank_offset(), fluid_synth_set_channel_type(), fluid_synth_set_chorus(), fluid_synth_set_gen(), fluid_synth_set_gen2(), fluid_synth_set_interp_method(), fluid_synth_set_polyphony(), fluid_synth_set_reverb(), fluid_synth_set_reverb_on(), fluid_synth_sfload(), fluid_synth_sfont_select(), fluid_synth_sfreload(), fluid_synth_sfunload(), fluid_synth_start(), fluid_synth_stop(), fluid_synth_sysex(), fluid_synth_system_reset(), fluid_synth_tune_notes(), fluid_synth_tuning_dump(), and fluid_synth_unset_program().

Function Documentation

◆ fluid_is_soundfont()

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.

References FLUID_DBG, FLUID_ERR, FLUID_INFO, FLUID_OK, and FLUID_WARN.

◆ fluid_is_midifile()

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.