mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-22 07:30:50 +00:00
src/Makefile.am: Added -Wl,--as-needed to cut down on dependencies.
src/ fluid_synth.c: Declared functions as static which are local, removed useless fluid_synth_verify_settings function. src/fluid_synth.h: Removed declarations which are now static. src/fluid_voice.c: Declared functions as static which are local. src/fluid_voice.h: Removed declarations which are now static, added note concerning fluid_voice_gen_value being declared but not used.
This commit is contained in:
parent
20949ac440
commit
22edb56803
5 changed files with 74 additions and 57 deletions
|
@ -139,5 +139,6 @@ libfluidsynth_la_CPPFLAGS = $(LIBFLUID_CPPFLAGS)
|
|||
|
||||
fluidsynth_SOURCES = fluidsynth.c
|
||||
fluidsynth_LDADD = libfluidsynth.la
|
||||
fluidsynth_LDFLAGS = -Wl,--as-needed
|
||||
fluidsynth_CPPFLAGS = $(FLUIDSYNTH_CPPFLAGS)
|
||||
|
||||
|
|
|
@ -35,6 +35,36 @@
|
|||
extern int feenableexcept (int excepts);
|
||||
#endif
|
||||
|
||||
static void fluid_synth_init(void);
|
||||
static fluid_preset_t*
|
||||
fluid_synth_get_preset(fluid_synth_t* synth, unsigned int sfontnum,
|
||||
unsigned int banknum, unsigned int prognum);
|
||||
static fluid_preset_t*
|
||||
fluid_synth_get_preset2(fluid_synth_t* synth, char* sfont_name,
|
||||
unsigned int banknum, unsigned int prognum);
|
||||
static void fluid_synth_update_presets(fluid_synth_t* synth);
|
||||
static int fluid_synth_update_gain(fluid_synth_t* synth,
|
||||
char* name, double value);
|
||||
static int fluid_synth_update_polyphony(fluid_synth_t* synth,
|
||||
char* name, int value);
|
||||
static void init_dither(void);
|
||||
static inline int roundi (float x);
|
||||
static int fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out);
|
||||
static fluid_voice_t* fluid_synth_free_voice_by_kill(fluid_synth_t* synth);
|
||||
static void fluid_synth_kill_by_exclusive_class(fluid_synth_t* synth,
|
||||
fluid_voice_t* new_voice);
|
||||
static int fluid_synth_sfunload_callback(void* data, unsigned int msec);
|
||||
static void fluid_synth_sfunload_macos9(fluid_synth_t* synth);
|
||||
static void fluid_synth_release_voice_on_same_note(fluid_synth_t* synth,
|
||||
int chan, int key);
|
||||
static fluid_tuning_t* fluid_synth_get_tuning(fluid_synth_t* synth,
|
||||
int bank, int prog);
|
||||
static fluid_tuning_t* fluid_synth_create_tuning(fluid_synth_t* synth, int bank,
|
||||
int prog, char* name);
|
||||
static fluid_bank_offset_t* fluid_synth_get_bank_offset0(fluid_synth_t* synth,
|
||||
int sfont_id);
|
||||
static void fluid_synth_remove_bank_offset(fluid_synth_t* synth, int sfont_id);
|
||||
|
||||
|
||||
fluid_sfloader_t* new_fluid_defsfloader(void);
|
||||
|
||||
|
@ -157,7 +187,7 @@ char* fluid_version_str(void)
|
|||
* Does all the initialization for this module.
|
||||
*/
|
||||
static void
|
||||
fluid_synth_init()
|
||||
fluid_synth_init(void)
|
||||
{
|
||||
fluid_synth_initialized++;
|
||||
|
||||
|
@ -325,11 +355,6 @@ fluid_synth_init()
|
|||
}
|
||||
|
||||
|
||||
int fluid_synth_verify_settings(fluid_settings_t *settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* FLUID SAMPLE TIMERS
|
||||
* Timers that use written audio data as timing reference
|
||||
|
@ -417,8 +442,6 @@ new_fluid_synth(fluid_settings_t *settings)
|
|||
fluid_synth_init();
|
||||
}
|
||||
|
||||
fluid_synth_verify_settings(settings);
|
||||
|
||||
/* allocate a new synthesizer object */
|
||||
synth = FLUID_NEW(fluid_synth_t);
|
||||
if (synth == NULL) {
|
||||
|
@ -1196,7 +1219,7 @@ fluid_synth_get_pitch_wheel_sens(fluid_synth_t* synth, int chan, int* pval)
|
|||
/*
|
||||
* fluid_synth_get_preset
|
||||
*/
|
||||
fluid_preset_t*
|
||||
static fluid_preset_t*
|
||||
fluid_synth_get_preset(fluid_synth_t* synth, unsigned int sfontnum,
|
||||
unsigned int banknum, unsigned int prognum)
|
||||
{
|
||||
|
@ -1220,7 +1243,7 @@ fluid_synth_get_preset(fluid_synth_t* synth, unsigned int sfontnum,
|
|||
/*
|
||||
* fluid_synth_get_preset2
|
||||
*/
|
||||
fluid_preset_t*
|
||||
static fluid_preset_t*
|
||||
fluid_synth_get_preset2(fluid_synth_t* synth, char* sfont_name,
|
||||
unsigned int banknum, unsigned int prognum)
|
||||
{
|
||||
|
@ -1470,9 +1493,12 @@ int fluid_synth_program_select2(fluid_synth_t* synth,
|
|||
}
|
||||
|
||||
/*
|
||||
* fluid_synth_update_presets
|
||||
* This function assures that every MIDI channels has a valid preset
|
||||
* (NULL is okay). This function is called after a SoundFont is
|
||||
* unloaded or reloaded.
|
||||
*/
|
||||
void fluid_synth_update_presets(fluid_synth_t* synth)
|
||||
static void
|
||||
fluid_synth_update_presets(fluid_synth_t* synth)
|
||||
{
|
||||
int chan;
|
||||
fluid_channel_t* channel;
|
||||
|
@ -1491,7 +1517,8 @@ void fluid_synth_update_presets(fluid_synth_t* synth)
|
|||
/*
|
||||
* fluid_synth_update_gain
|
||||
*/
|
||||
int fluid_synth_update_gain(fluid_synth_t* synth, char* name, double value)
|
||||
static int
|
||||
fluid_synth_update_gain(fluid_synth_t* synth, char* name, double value)
|
||||
{
|
||||
fluid_synth_set_gain(synth, (float) value);
|
||||
return 0;
|
||||
|
@ -1526,7 +1553,8 @@ float fluid_synth_get_gain(fluid_synth_t* synth)
|
|||
/*
|
||||
* fluid_synth_update_polyphony
|
||||
*/
|
||||
int fluid_synth_update_polyphony(fluid_synth_t* synth, char* name, int value)
|
||||
static int
|
||||
fluid_synth_update_polyphony(fluid_synth_t* synth, char* name, int value)
|
||||
{
|
||||
fluid_synth_set_polyphony(synth, value);
|
||||
return 0;
|
||||
|
@ -1824,7 +1852,8 @@ fluid_synth_write_float(fluid_synth_t* synth, int len,
|
|||
|
||||
static float rand_table[DITHER_CHANNELS][DITHER_SIZE];
|
||||
|
||||
static void init_dither(void)
|
||||
static void
|
||||
init_dither(void)
|
||||
{
|
||||
float d, dp;
|
||||
int c, i;
|
||||
|
@ -1967,7 +1996,7 @@ fluid_synth_dither_s16(int *dither_index, int len, float* lin, float* rin,
|
|||
/*
|
||||
* fluid_synth_one_block
|
||||
*/
|
||||
int
|
||||
static int
|
||||
fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out)
|
||||
{
|
||||
int i, auchan;
|
||||
|
@ -2110,7 +2139,7 @@ fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out)
|
|||
* selects a voice for killing. the selection algorithm is a refinement
|
||||
* of the algorithm previously in fluid_synth_alloc_voice.
|
||||
*/
|
||||
fluid_voice_t*
|
||||
static fluid_voice_t*
|
||||
fluid_synth_free_voice_by_kill(fluid_synth_t* synth)
|
||||
{
|
||||
int i;
|
||||
|
@ -2265,7 +2294,8 @@ fluid_synth_alloc_voice(fluid_synth_t* synth, fluid_sample_t* sample, int chan,
|
|||
/*
|
||||
* fluid_synth_kill_by_exclusive_class
|
||||
*/
|
||||
void fluid_synth_kill_by_exclusive_class(fluid_synth_t* synth, fluid_voice_t* new_voice)
|
||||
static void
|
||||
fluid_synth_kill_by_exclusive_class(fluid_synth_t* synth, fluid_voice_t* new_voice)
|
||||
{
|
||||
/** Kill all voices on a given channel, which belong into
|
||||
excl_class. This function is called by a SoundFont's preset in
|
||||
|
@ -2398,7 +2428,8 @@ fluid_synth_sfload(fluid_synth_t* synth, const char* filename, int reset_presets
|
|||
/*
|
||||
* fluid_synth_sfunload_callback
|
||||
*/
|
||||
static int fluid_synth_sfunload_callback(void* data, unsigned int msec)
|
||||
static int
|
||||
fluid_synth_sfunload_callback(void* data, unsigned int msec)
|
||||
{
|
||||
fluid_sfont_t* sfont = (fluid_sfont_t*) data;
|
||||
int r = delete_fluid_sfont(sfont);
|
||||
|
@ -2411,7 +2442,8 @@ static int fluid_synth_sfunload_callback(void* data, unsigned int msec)
|
|||
/*
|
||||
* fluid_synth_sfunload_macos9
|
||||
*/
|
||||
void fluid_synth_sfunload_macos9(fluid_synth_t* synth)
|
||||
static void
|
||||
fluid_synth_sfunload_macos9(fluid_synth_t* synth)
|
||||
{
|
||||
#if defined(MACOS9)
|
||||
fluid_list_t *list, *next;
|
||||
|
@ -2727,7 +2759,9 @@ double fluid_synth_get_reverb_width(fluid_synth_t* synth)
|
|||
* several voice processes, for example a stereo sample. Don't
|
||||
* release those...
|
||||
*/
|
||||
void fluid_synth_release_voice_on_same_note(fluid_synth_t* synth, int chan, int key){
|
||||
static void
|
||||
fluid_synth_release_voice_on_same_note(fluid_synth_t* synth, int chan, int key)
|
||||
{
|
||||
int i;
|
||||
fluid_voice_t* voice;
|
||||
|
||||
|
@ -3236,7 +3270,7 @@ int fluid_synth_stop(fluid_synth_t* synth, unsigned int id)
|
|||
return status;
|
||||
}
|
||||
|
||||
fluid_bank_offset_t*
|
||||
static fluid_bank_offset_t*
|
||||
fluid_synth_get_bank_offset0(fluid_synth_t* synth, int sfont_id)
|
||||
{
|
||||
fluid_list_t* list = synth->bank_offsets;
|
||||
|
@ -3286,7 +3320,7 @@ fluid_synth_get_bank_offset(fluid_synth_t* synth, int sfont_id)
|
|||
return (bank_offset == NULL)? 0 : bank_offset->offset;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
fluid_synth_remove_bank_offset(fluid_synth_t* synth, int sfont_id)
|
||||
{
|
||||
fluid_bank_offset_t* bank_offset;
|
||||
|
|
|
@ -171,13 +171,6 @@ int fluid_synth_getint(fluid_synth_t* synth, char* name, int* val);
|
|||
|
||||
int fluid_synth_set_reverb_preset(fluid_synth_t* synth, int num);
|
||||
|
||||
int fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out);
|
||||
|
||||
fluid_preset_t* fluid_synth_get_preset(fluid_synth_t* synth,
|
||||
unsigned int sfontnum,
|
||||
unsigned int banknum,
|
||||
unsigned int prognum);
|
||||
|
||||
fluid_preset_t* fluid_synth_find_preset(fluid_synth_t* synth,
|
||||
unsigned int banknum,
|
||||
unsigned int prognum);
|
||||
|
@ -188,24 +181,9 @@ int fluid_synth_modulate_voices(fluid_synth_t* synth, int chan, int is_cc, int c
|
|||
int fluid_synth_modulate_voices_all(fluid_synth_t* synth, int chan);
|
||||
int fluid_synth_damp_voices(fluid_synth_t* synth, int chan);
|
||||
int fluid_synth_kill_voice(fluid_synth_t* synth, fluid_voice_t * voice);
|
||||
void fluid_synth_kill_by_exclusive_class(fluid_synth_t* synth, fluid_voice_t* voice);
|
||||
void fluid_synth_release_voice_on_same_note(fluid_synth_t* synth, int chan, int key);
|
||||
void fluid_synth_sfunload_macos9(fluid_synth_t* synth);
|
||||
|
||||
void fluid_synth_print_voice(fluid_synth_t* synth);
|
||||
|
||||
/** This function assures that every MIDI channels has a valid preset
|
||||
* (NULL is okay). This function is called after a SoundFont is
|
||||
* unloaded or reloaded. */
|
||||
void fluid_synth_update_presets(fluid_synth_t* synth);
|
||||
|
||||
|
||||
int fluid_synth_update_gain(fluid_synth_t* synth, char* name, double value);
|
||||
int fluid_synth_update_polyphony(fluid_synth_t* synth, char* name, int value);
|
||||
|
||||
fluid_bank_offset_t* fluid_synth_get_bank_offset0(fluid_synth_t* synth, int sfont_id);
|
||||
void fluid_synth_remove_bank_offset(fluid_synth_t* synth, int sfont_id);
|
||||
|
||||
void fluid_synth_dither_s16(int *dither_index, int len, float* lin, float* rin,
|
||||
void* lout, int loff, int lincr,
|
||||
void* rout, int roff, int rincr);
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
/* min vol envelope release (to stop clicks) in SoundFont timecents */
|
||||
#define FLUID_MIN_VOLENVRELEASE -7200.0f /* ~16ms */
|
||||
|
||||
|
||||
static int fluid_voice_calculate_runtime_synthesis_parameters(fluid_voice_t* voice);
|
||||
static int calculate_hold_decay_buffers(fluid_voice_t* voice, int gen_base,
|
||||
int gen_key2base, int is_decay);
|
||||
static inline void fluid_voice_effects (fluid_voice_t *voice, int count,
|
||||
fluid_real_t* dsp_left_buf,
|
||||
fluid_real_t* dsp_right_buf,
|
||||
fluid_real_t* dsp_reverb_buf,
|
||||
fluid_real_t* dsp_chorus_buf);
|
||||
static fluid_real_t
|
||||
fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice);
|
||||
static void fluid_voice_check_sample_sanity(fluid_voice_t* voice);
|
||||
|
||||
/*
|
||||
* new_fluid_voice
|
||||
*/
|
||||
|
@ -817,7 +823,7 @@ void fluid_voice_start(fluid_voice_t* voice)
|
|||
* conversion will be done in the DSP function. This is the case, for
|
||||
* example, for the pitch since it is modulated by the controllers in
|
||||
* cents. */
|
||||
int
|
||||
static int
|
||||
fluid_voice_calculate_runtime_synthesis_parameters(fluid_voice_t* voice)
|
||||
{
|
||||
fluid_real_t x;
|
||||
|
@ -950,8 +956,9 @@ fluid_voice_calculate_runtime_synthesis_parameters(fluid_voice_t* voice)
|
|||
/*
|
||||
* calculate_hold_decay_buffers
|
||||
*/
|
||||
int calculate_hold_decay_buffers(fluid_voice_t* voice, int gen_base,
|
||||
int gen_key2base, int is_decay)
|
||||
static int
|
||||
calculate_hold_decay_buffers(fluid_voice_t* voice, int gen_base,
|
||||
int gen_key2base, int is_decay)
|
||||
{
|
||||
/* Purpose:
|
||||
*
|
||||
|
@ -1738,7 +1745,8 @@ int fluid_voice_is_playing(fluid_voice_t* voice)
|
|||
* all modulators have been run on the voice once. Also,
|
||||
* voice->attenuation has to be initialized.
|
||||
*/
|
||||
fluid_real_t fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice)
|
||||
static fluid_real_t
|
||||
fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice)
|
||||
{
|
||||
int i;
|
||||
fluid_mod_t* mod;
|
||||
|
@ -1792,7 +1800,8 @@ fluid_real_t fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice
|
|||
* Make sure, that sample start / end point and loop points are in
|
||||
* proper order. When starting up, calculate the initial phase.
|
||||
*/
|
||||
void fluid_voice_check_sample_sanity(fluid_voice_t* voice)
|
||||
static void
|
||||
fluid_voice_check_sample_sanity(fluid_voice_t* voice)
|
||||
{
|
||||
int min_index_nonloop=(int) voice->sample->start;
|
||||
int max_index_nonloop=(int) voice->sample->end;
|
||||
|
|
|
@ -244,14 +244,8 @@ void fluid_voice_update_param(fluid_voice_t* voice, int gen);
|
|||
|
||||
int fluid_voice_noteoff(fluid_voice_t* voice);
|
||||
int fluid_voice_off(fluid_voice_t* voice);
|
||||
int fluid_voice_calculate_runtime_synthesis_parameters(fluid_voice_t* voice);
|
||||
fluid_channel_t* fluid_voice_get_channel(fluid_voice_t* voice);
|
||||
int calculate_hold_decay_buffers(fluid_voice_t* voice, int gen_base,
|
||||
int gen_key2base, int is_decay);
|
||||
int fluid_voice_kill_excl(fluid_voice_t* voice);
|
||||
fluid_real_t fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice);
|
||||
fluid_real_t fluid_voice_determine_amplitude_that_reaches_noise_floor_for_sample(fluid_voice_t* voice);
|
||||
void fluid_voice_check_sample_sanity(fluid_voice_t* voice);
|
||||
|
||||
#define fluid_voice_set_id(_voice, _id) { (_voice)->id = (_id); }
|
||||
#define fluid_voice_get_chan(_voice) (_voice)->chan
|
||||
|
@ -269,6 +263,7 @@ void fluid_voice_check_sample_sanity(fluid_voice_t* voice);
|
|||
#define _SAMPLEMODE(voice) ((int)(voice)->gen[GEN_SAMPLEMODE].val)
|
||||
|
||||
|
||||
/* FIXME - Josh Green - This doesn't seem to be used anywhere */
|
||||
fluid_real_t fluid_voice_gen_value(fluid_voice_t* voice, int num);
|
||||
|
||||
#define _GEN(_voice, _n) \
|
||||
|
|
Loading…
Reference in a new issue