From ac05f050238d4b51c7b6a042e25cee59dc34da80 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 23 Aug 2016 18:50:54 +0200 Subject: Import libfluidsynth into the Ardour codebase --- tools/ardour_fluidsynth.diff | 252 +++++++++++++++++++++++++++++++++++++++++++ tools/update_fluidsynth.sh | 99 +++++++++++++++++ 2 files changed, 351 insertions(+) create mode 100644 tools/ardour_fluidsynth.diff create mode 100755 tools/update_fluidsynth.sh (limited to 'tools') diff --git a/tools/ardour_fluidsynth.diff b/tools/ardour_fluidsynth.diff new file mode 100644 index 0000000000..8b9821cf33 --- /dev/null +++ b/tools/ardour_fluidsynth.diff @@ -0,0 +1,252 @@ +diff --git a/libs/fluidsynth/src/fluid_defsfont.c b/libs/fluidsynth/src/fluid_defsfont.c +index 3eea95c..c395218 100644 +--- a/libs/fluidsynth/src/fluid_defsfont.c ++++ b/libs/fluidsynth/src/fluid_defsfont.c +@@ -109,11 +109,13 @@ char* fluid_defsfont_sfont_get_name(fluid_sfont_t* sfont) + return fluid_defsfont_get_name((fluid_defsfont_t*) sfont->data); + } + ++#if 0 + fluid_sample_t* fluid_defsfont_get_sample(fluid_defsfont_t* sfont, char *s) + { + /* This function is here just to avoid an ABI/SONAME bump, see ticket #98. Should never be used. */ + return NULL; + } ++#endif + + fluid_preset_t* + fluid_defsfont_sfont_get_preset(fluid_sfont_t* sfont, unsigned int bank, unsigned int prenum) +diff --git a/libs/fluidsynth/src/fluid_hash.c b/libs/fluidsynth/src/fluid_hash.c +index a063e29..9d5a920 100644 +--- a/libs/fluidsynth/src/fluid_hash.c ++++ b/libs/fluidsynth/src/fluid_hash.c +@@ -93,7 +93,7 @@ static const guint primes[] = + + static const unsigned int nprimes = sizeof (primes) / sizeof (primes[0]); + +-unsigned int ++static unsigned int + spaced_primes_closest (unsigned int num) + { + unsigned int i; +@@ -984,6 +984,7 @@ fluid_hashtable_foreach_remove_or_steal (fluid_hashtable_t *hashtable, + return deleted; + } + ++#if 0 + /** + * fluid_hashtable_foreach_remove: + * @hashtable: a #fluid_hashtable_t. +@@ -1001,7 +1002,7 @@ fluid_hashtable_foreach_remove_or_steal (fluid_hashtable_t *hashtable, + * + * Return value: the number of key/value pairs removed. + **/ +-unsigned int ++static unsigned int + fluid_hashtable_foreach_remove (fluid_hashtable_t *hashtable, + fluid_hr_func_t func, void *user_data) + { +@@ -1010,6 +1011,7 @@ fluid_hashtable_foreach_remove (fluid_hashtable_t *hashtable, + + return fluid_hashtable_foreach_remove_or_steal (hashtable, func, user_data, TRUE); + } ++#endif + + /** + * fluid_hashtable_foreach_steal: +diff --git a/libs/fluidsynth/src/fluid_midi.c b/libs/fluidsynth/src/fluid_midi.c +index 5ceab01..1ee3dd2 100644 +--- a/libs/fluidsynth/src/fluid_midi.c ++++ b/libs/fluidsynth/src/fluid_midi.c +@@ -1115,10 +1115,11 @@ fluid_track_get_duration(fluid_track_t *track) + return time; + } + ++#if 0 + /* + * fluid_track_count_events + */ +-int ++static int + fluid_track_count_events(fluid_track_t *track, int *on, int *off) + { + fluid_midi_event_t *evt = track->first; +@@ -1132,6 +1133,7 @@ fluid_track_count_events(fluid_track_t *track, int *on, int *off) + } + return FLUID_OK; + } ++#endif + + /* + * fluid_track_add_event +@@ -1533,7 +1535,7 @@ fluid_player_load(fluid_player_t *player, fluid_playlist_item *item) + return FLUID_OK; + } + +-void ++static void + fluid_player_advancefile(fluid_player_t *player) + { + if (player->playlist == NULL) { +@@ -1553,7 +1555,7 @@ fluid_player_advancefile(fluid_player_t *player) + } + } + +-void ++static void + fluid_player_playlist_load(fluid_player_t *player, unsigned int msec) + { + fluid_playlist_item* current_playitem; +diff --git a/libs/fluidsynth/src/fluid_rev.c b/libs/fluidsynth/src/fluid_rev.c +index 51b0e79..166007d 100644 +--- a/libs/fluidsynth/src/fluid_rev.c ++++ b/libs/fluidsynth/src/fluid_rev.c +@@ -75,7 +75,7 @@ void fluid_allpass_init(fluid_allpass* allpass); + void fluid_allpass_setfeedback(fluid_allpass* allpass, fluid_real_t val); + fluid_real_t fluid_allpass_getfeedback(fluid_allpass* allpass); + +-void ++static void + fluid_allpass_setbuffer(fluid_allpass* allpass, int size) + { + allpass->bufidx = 0; +@@ -83,7 +83,7 @@ fluid_allpass_setbuffer(fluid_allpass* allpass, int size) + allpass->bufsize = size; + } + +-void ++static void + fluid_allpass_release(fluid_allpass* allpass) + { + FLUID_FREE(allpass->buffer); +diff --git a/libs/fluidsynth/src/fluid_rvoice_mixer.c b/libs/fluidsynth/src/fluid_rvoice_mixer.c +index 4672cb8..cc633f5 100644 +--- a/libs/fluidsynth/src/fluid_rvoice_mixer.c ++++ b/libs/fluidsynth/src/fluid_rvoice_mixer.c +@@ -24,7 +24,7 @@ + #include "fluid_rev.h" + #include "fluid_chorus.h" + #include "fluidsynth_priv.h" +-#include "fluid_ladspa.h" ++//#include "fluid_ladspa.h" + + #define SYNTH_REVERB_CHANNEL 0 + #define SYNTH_CHORUS_CHANNEL 1 +diff --git a/libs/fluidsynth/src/fluid_rvoice_mixer.h b/libs/fluidsynth/src/fluid_rvoice_mixer.h +index eeb49ec..d4e41ca 100644 +--- a/libs/fluidsynth/src/fluid_rvoice_mixer.h ++++ b/libs/fluidsynth/src/fluid_rvoice_mixer.h +@@ -24,7 +24,7 @@ + + #include "fluidsynth_priv.h" + #include "fluid_rvoice.h" +-#include "fluid_ladspa.h" ++//#include "fluid_ladspa.h" + + typedef struct _fluid_rvoice_mixer_t fluid_rvoice_mixer_t; + +diff --git a/libs/fluidsynth/src/fluid_settings.c b/libs/fluidsynth/src/fluid_settings.c +index 78725fb..2061c90 100644 +--- a/libs/fluidsynth/src/fluid_settings.c ++++ b/libs/fluidsynth/src/fluid_settings.c +@@ -22,9 +22,9 @@ + #include "fluid_sys.h" + #include "fluid_hash.h" + #include "fluid_synth.h" +-#include "fluid_cmd.h" +-#include "fluid_adriver.h" +-#include "fluid_mdriver.h" ++//#include "fluid_cmd.h" ++//#include "fluid_adriver.h" ++//#include "fluid_mdriver.h" + #include "fluid_settings.h" + #include "fluid_midi.h" + +@@ -294,11 +294,13 @@ fluid_settings_init(fluid_settings_t* settings) + fluid_return_if_fail (settings != NULL); + + fluid_synth_settings(settings); +- fluid_shell_settings(settings); ++ //fluid_shell_settings(settings); + fluid_player_settings(settings); ++#if 0 + fluid_file_renderer_settings(settings); + fluid_audio_driver_settings(settings); + fluid_midi_driver_settings(settings); ++#endif + } + + static int +diff --git a/libs/fluidsynth/src/fluid_synth.c b/libs/fluidsynth/src/fluid_synth.c +index 84ee289..a12260c 100644 +--- a/libs/fluidsynth/src/fluid_synth.c ++++ b/libs/fluidsynth/src/fluid_synth.c +@@ -471,7 +471,7 @@ struct _fluid_sample_timer_t + /* + * fluid_sample_timer_process - called when synth->ticks is updated + */ +-void fluid_sample_timer_process(fluid_synth_t* synth) ++static void fluid_sample_timer_process(fluid_synth_t* synth) + { + fluid_sample_timer_t* st; + long msec; +diff --git a/libs/fluidsynth/src/fluid_synth.h b/libs/fluidsynth/src/fluid_synth.h +index 3af336d..019a8e0 100644 +--- a/libs/fluidsynth/src/fluid_synth.h ++++ b/libs/fluidsynth/src/fluid_synth.h +@@ -37,8 +37,8 @@ + #include "fluid_rev.h" + #include "fluid_voice.h" + #include "fluid_chorus.h" +-#include "fluid_ladspa.h" +-#include "fluid_midi_router.h" ++//#include "fluid_ladspa.h" ++//#include "fluid_midi_router.h" + #include "fluid_sys.h" + #include "fluid_rvoice_event.h" + +diff --git a/libs/fluidsynth/src/fluid_sys.c b/libs/fluidsynth/src/fluid_sys.c +index ee7d8d9..600b04e 100644 +--- a/libs/fluidsynth/src/fluid_sys.c ++++ b/libs/fluidsynth/src/fluid_sys.c +@@ -686,7 +686,7 @@ fluid_thread_join(fluid_thread_t* thread) + } + + +-void ++static void + fluid_timer_run (void *data) + { + fluid_timer_t *timer; +diff --git a/libs/fluidsynth/src/fluid_tuning.c b/libs/fluidsynth/src/fluid_tuning.c +index cc440aa..8977ed6 100644 +--- a/libs/fluidsynth/src/fluid_tuning.c ++++ b/libs/fluidsynth/src/fluid_tuning.c +@@ -143,7 +143,7 @@ char* fluid_tuning_get_name(fluid_tuning_t* tuning) + return tuning->name; + } + +-void fluid_tuning_set_key(fluid_tuning_t* tuning, int key, double pitch) ++static void fluid_tuning_set_key(fluid_tuning_t* tuning, int key, double pitch) + { + tuning->pitch[key] = pitch; + } +diff --git a/libs/fluidsynth/src/fluidsynth_priv.h b/libs/fluidsynth/src/fluidsynth_priv.h +index faf2772..74b9f4b 100644 +--- a/libs/fluidsynth/src/fluidsynth_priv.h ++++ b/libs/fluidsynth/src/fluidsynth_priv.h +@@ -28,14 +28,6 @@ + #include "config.h" + #endif + +-#if defined(__POWERPC__) && !(defined(__APPLE__) && defined(__MACH__)) +-#include "config_maxmsp43.h" +-#endif +- +-#if defined(WIN32) && !defined(MINGW32) +-#include "config_win32.h" +-#endif +- + #if HAVE_STRING_H + #include + #endif diff --git a/tools/update_fluidsynth.sh b/tools/update_fluidsynth.sh new file mode 100755 index 0000000000..66ad7835fa --- /dev/null +++ b/tools/update_fluidsynth.sh @@ -0,0 +1,99 @@ +#!/bin/sh + +if ! test -f wscript || ! test -d gtk2_ardour || ! test -d libs/fluidsynth/;then + echo "This script needs to run from ardour's top-level src tree" + exit 1 +fi + +if test -z "`which rsync`" -o -z "`which git`"; then + echo "this script needs rsync and git" + exit 1 +fi + +ASRC=`pwd` +set -e + +TMP=`mktemp -d` +test -d "$TMP" +echo $TMP + +trap "rm -rf $TMP" EXIT + +cd $TMP +git clone git://git.code.sf.net/p/fluidsynth/code-git fs-git + +FSR=fs-git/fluidsynth/ + +rsync -auc --info=progress2 \ + ${FSR}src/midi/fluid_midi.c \ + ${FSR}src/midi/fluid_midi.h \ + ${FSR}src/rvoice/fluid_adsr_env.c \ + ${FSR}src/rvoice/fluid_adsr_env.h \ + ${FSR}src/rvoice/fluid_chorus.c \ + ${FSR}src/rvoice/fluid_chorus.h \ + ${FSR}src/rvoice/fluid_iir_filter.c \ + ${FSR}src/rvoice/fluid_iir_filter.h \ + ${FSR}src/rvoice/fluid_lfo.c \ + ${FSR}src/rvoice/fluid_lfo.h \ + ${FSR}src/rvoice/fluid_phase.h \ + ${FSR}src/rvoice/fluid_rev.c \ + ${FSR}src/rvoice/fluid_rev.h \ + ${FSR}src/rvoice/fluid_rvoice.c \ + ${FSR}src/rvoice/fluid_rvoice_dsp.c \ + ${FSR}src/rvoice/fluid_rvoice_event.c \ + ${FSR}src/rvoice/fluid_rvoice_event.h \ + ${FSR}src/rvoice/fluid_rvoice.h \ + ${FSR}src/rvoice/fluid_rvoice_mixer.c \ + ${FSR}src/rvoice/fluid_rvoice_mixer.h \ + ${FSR}src/sfloader/fluid_defsfont.c \ + ${FSR}src/sfloader/fluid_defsfont.h \ + ${FSR}src/sfloader/fluid_sfont.h \ + ${FSR}src/synth/fluid_chan.c \ + ${FSR}src/synth/fluid_chan.h \ + ${FSR}src/synth/fluid_event.c \ + ${FSR}src/synth/fluid_event_priv.h \ + ${FSR}src/synth/fluid_event_queue.h \ + ${FSR}src/synth/fluid_gen.c \ + ${FSR}src/synth/fluid_gen.h \ + ${FSR}src/synth/fluid_mod.c \ + ${FSR}src/synth/fluid_mod.h \ + ${FSR}src/synth/fluid_synth.c \ + ${FSR}src/synth/fluid_synth.h \ + ${FSR}src/synth/fluid_tuning.c \ + ${FSR}src/synth/fluid_tuning.h \ + ${FSR}src/synth/fluid_voice.c \ + ${FSR}src/synth/fluid_voice.h \ + ${FSR}src/utils/fluid_conv.c \ + ${FSR}src/utils/fluid_conv.h \ + ${FSR}src/utils/fluid_hash.c \ + ${FSR}src/utils/fluid_hash.h \ + ${FSR}src/utils/fluid_list.c \ + ${FSR}src/utils/fluid_list.h \ + ${FSR}src/utils/fluid_ringbuffer.c \ + ${FSR}src/utils/fluid_ringbuffer.h \ + ${FSR}src/utils/fluid_settings.c \ + ${FSR}src/utils/fluid_settings.h \ + ${FSR}src/utils/fluidsynth_priv.h \ + ${FSR}src/utils/fluid_sys.c \ + ${FSR}src/utils/fluid_sys.h \ + \ + "$ASRC/libs/fluidsynth/src/" + +rsync -auc --info=progress2 \ + --exclude fluidsynth.h \ + ${FSR}include/fluidsynth/event.h \ + ${FSR}include/fluidsynth/gen.h \ + ${FSR}include/fluidsynth/log.h \ + ${FSR}include/fluidsynth/midi.h \ + ${FSR}include/fluidsynth/misc.h \ + ${FSR}include/fluidsynth/mod.h \ + ${FSR}include/fluidsynth/settings.h \ + ${FSR}include/fluidsynth/sfont.h \ + ${FSR}include/fluidsynth/synth.h \ + ${FSR}include/fluidsynth/types.h \ + ${FSR}include/fluidsynth/voice.h \ + \ + "$ASRC/libs/fluidsynth/fluidsynth/" + +cd "$ASRC" +patch -p1 < tools/ardour_fluidsynth.diff -- cgit v1.2.3