X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tools%2Fardour_fluidsynth.diff;h=64bc813a6efe31a6c817cabbeaf993a8711e0657;hb=f28b03c305229b0de657e9a767b193b45ca9433a;hp=4aa408338ba6ae8f5370a3fad8892ac39d064485;hpb=bd4424a74e6118e72fb855937ebbbaaf5ac134e7;p=ardour.git diff --git a/tools/ardour_fluidsynth.diff b/tools/ardour_fluidsynth.diff index 4aa408338b..64bc813a6e 100644 --- a/tools/ardour_fluidsynth.diff +++ b/tools/ardour_fluidsynth.diff @@ -1,73 +1,74 @@ -diff --git b/libs/fluidsynth/src/fluid_defsfont.c a/libs/fluidsynth/src/fluid_defsfont.c -index 3eea95c..c395218 100644 ---- b/libs/fluidsynth/src/fluid_defsfont.c -+++ a/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); - } +diff --git b/libs/fluidsynth/fluidsynth/synth.h a/libs/fluidsynth/fluidsynth/synth.h +index 1a0046fe1..a4afb9094 100644 +--- b/libs/fluidsynth/fluidsynth/synth.h ++++ a/libs/fluidsynth/fluidsynth/synth.h +@@ -265,7 +265,7 @@ FLUIDSYNTH_API int fluid_synth_write_s16(fluid_synth_t *synth, int len, + FLUIDSYNTH_API int fluid_synth_write_float(fluid_synth_t *synth, int len, + void *lout, int loff, int lincr, + void *rout, int roff, int rincr); +-FLUID_DEPRECATED FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len, ++FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len, + float **left, float **right, + float **fx_left, float **fx_right); + FLUIDSYNTH_API int fluid_synth_process(fluid_synth_t *synth, int len, +@@ -310,7 +310,9 @@ FLUIDSYNTH_API int fluid_synth_set_custom_filter(fluid_synth_t *, int type, int -+#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; - } + /* LADSPA */ + ++#ifdef LADSPA + FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth); +#endif - fluid_preset_t* - fluid_defsfont_sfont_get_preset(fluid_sfont_t* sfont, unsigned int bank, unsigned int prenum) + + /* API: Poly mono mode */ +diff --git b/libs/fluidsynth/fluidsynth/types.h a/libs/fluidsynth/fluidsynth/types.h +index 47ef18336..5ad29281a 100644 +--- b/libs/fluidsynth/fluidsynth/types.h ++++ a/libs/fluidsynth/fluidsynth/types.h +@@ -56,7 +56,9 @@ typedef struct _fluid_sequencer_t fluid_sequencer_t; /**< Sequencer i + typedef struct _fluid_ramsfont_t fluid_ramsfont_t; /**< RAM SoundFont */ + typedef struct _fluid_rampreset_t fluid_rampreset_t; /**< RAM SoundFont preset */ + typedef struct _fluid_cmd_handler_t fluid_cmd_handler_t; /**< Shell Command Handler */ ++#ifdef LADSPA + typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t; /**< LADSPA effects instance */ ++#endif + typedef struct _fluid_file_callbacks_t fluid_file_callbacks_t; /**< Callback struct to perform custom file loading of soundfonts */ + + typedef int fluid_istream_t; /**< Input stream descriptor */ diff --git b/libs/fluidsynth/src/fluid_hash.c a/libs/fluidsynth/src/fluid_hash.c -index a063e29..9d5a920 100644 +index 37b0a06a4..b6586895b 100644 --- b/libs/fluidsynth/src/fluid_hash.c +++ a/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; +@@ -991,6 +991,7 @@ fluid_hashtable_remove_all(fluid_hashtable_t *hashtable) + fluid_hashtable_maybe_resize(hashtable); } +#if 0 /** - * fluid_hashtable_foreach_remove: + * fluid_hashtable_steal_all: * @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); +@@ -1008,6 +1009,7 @@ fluid_hashtable_steal_all(fluid_hashtable_t *hashtable) + fluid_hashtable_remove_all_nodes(hashtable, FALSE); + fluid_hashtable_maybe_resize(hashtable); } +#endif - /** - * fluid_hashtable_foreach_steal: + /* + * fluid_hashtable_foreach_remove_or_steal: diff --git b/libs/fluidsynth/src/fluid_midi.c a/libs/fluidsynth/src/fluid_midi.c -index 5ceab01..171952f 100644 +index c05f994ce..bdf72dd68 100644 --- b/libs/fluidsynth/src/fluid_midi.c +++ a/libs/fluidsynth/src/fluid_midi.c -@@ -34,7 +34,7 @@ static int fluid_midi_event_length(unsigned char event); - static char* fluid_file_read_full(fluid_file fp, size_t* length); - #define READ_FULL_INITIAL_BUFLEN 1024 +@@ -75,7 +75,7 @@ static int fluid_midi_file_read_tracklen(fluid_midi_file *mf); + static int fluid_midi_file_eot(fluid_midi_file *mf); + static int fluid_midi_file_get_division(fluid_midi_file *midifile); - +#if 0 // disable file I/O with Ardour /*************************************************************** * * MIDIFILE -@@ -760,6 +760,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile) +@@ -1011,6 +1011,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile) { return midifile->division; } @@ -75,7 +76,7 @@ index 5ceab01..171952f 100644 /****************************************************** * -@@ -1030,7 +1031,7 @@ fluid_midi_event_set_sysex(fluid_midi_event_t *evt, void *data, int size, int dy +@@ -1330,7 +1331,7 @@ static void fluid_midi_event_set_sysex_LOCAL(fluid_midi_event_t *evt, int type, * * fluid_track_t */ @@ -84,206 +85,196 @@ index 5ceab01..171952f 100644 /* * new_fluid_track */ -@@ -1118,7 +1119,7 @@ fluid_track_get_duration(fluid_track_t *track) - /* - * 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; -@@ -1533,7 +1534,7 @@ fluid_player_load(fluid_player_t *player, fluid_playlist_item *item) - return FLUID_OK; - } +@@ -2434,3 +2435,4 @@ fluid_midi_event_length(unsigned char event) --void -+static void - fluid_player_advancefile(fluid_player_t *player) - { - if (player->playlist == NULL) { -@@ -1553,7 +1554,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; -@@ -1938,3 +1939,4 @@ fluid_midi_event_length(unsigned char event) - } return 1; } +#endif diff --git b/libs/fluidsynth/src/fluid_rev.c a/libs/fluidsynth/src/fluid_rev.c -index 51b0e79..166007d 100644 +index 8a58d1e85..51b4faa25 100644 --- b/libs/fluidsynth/src/fluid_rev.c +++ a/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); +@@ -51,7 +51,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) + 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; + allpass->bufidx = 0; +@@ -59,7 +59,7 @@ fluid_allpass_setbuffer(fluid_allpass *allpass, int size) + allpass->bufsize = size; } -void +static void - fluid_allpass_release(fluid_allpass* allpass) + fluid_allpass_release(fluid_allpass *allpass) { - FLUID_FREE(allpass->buffer); + FLUID_FREE(allpass->buffer); diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.c a/libs/fluidsynth/src/fluid_rvoice_mixer.c -index 4672cb8..d5369aa 100644 +index 3b264e4d9..8c5254f26 100644 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.c +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.c -@@ -24,12 +24,12 @@ +@@ -24,11 +24,9 @@ #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 + #include "fluid_synth.h" +- -#define ENABLE_MIXER_THREADS 1 +#undef ENABLE_MIXER_THREADS // Ardour does the multithreading -- synth.cpu-cores defaults to 1 // If less than x voices, the thread overhead is larger than the gain, // so don't activate the thread(s). diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.h a/libs/fluidsynth/src/fluid_rvoice_mixer.h -index eeb49ec..d4e41ca 100644 +index 4ee072e4b..1b3fceb34 100644 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.h +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.h -@@ -24,7 +24,7 @@ +@@ -24,7 +24,6 @@ #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 b/libs/fluidsynth/src/fluid_settings.c a/libs/fluidsynth/src/fluid_settings.c -index 78725fb..56de8c7 100644 +index d77d5ed79..05423384e 100644 --- b/libs/fluidsynth/src/fluid_settings.c +++ a/libs/fluidsynth/src/fluid_settings.c -@@ -22,9 +22,9 @@ +@@ -21,9 +21,6 @@ #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); +@@ -328,11 +325,13 @@ fluid_settings_init(fluid_settings_t *settings) + fluid_return_if_fail(settings != NULL); - fluid_synth_settings(settings); + fluid_synth_settings(settings); +#if 0 - fluid_shell_settings(settings); - fluid_player_settings(settings); - fluid_file_renderer_settings(settings); - fluid_audio_driver_settings(settings); - fluid_midi_driver_settings(settings); + fluid_shell_settings(settings); + fluid_player_settings(settings); + fluid_file_renderer_settings(settings); + fluid_audio_driver_settings(settings); + fluid_midi_driver_settings(settings); +#endif } static int diff --git b/libs/fluidsynth/src/fluid_synth.c a/libs/fluidsynth/src/fluid_synth.c -index 84ee289..a12260c 100644 +index a40ba2eaa..e8845632f 100644 --- b/libs/fluidsynth/src/fluid_synth.c +++ a/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 +@@ -267,7 +267,7 @@ void fluid_version(int *major, int *minor, int *micro) + * @return FluidSynth version string, which is internal and should not be + * modified or freed. */ --void fluid_sample_timer_process(fluid_synth_t* synth) -+static void fluid_sample_timer_process(fluid_synth_t* synth) +-char * ++const char * + fluid_version_str(void) { - fluid_sample_timer_t* st; - long msec; + return FLUIDSYNTH_VERSION; +@@ -6435,6 +6435,7 @@ int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type) + FLUID_API_RETURN(FLUID_OK); + } + ++#ifdef LADSPA + /** + * Return the LADSPA effects instance used by FluidSynth + * +@@ -6447,6 +6448,7 @@ fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth) + + return synth->ladspa_fx; + } ++#endif + + /** + * Configure a general-purpose IIR biquad filter. diff --git b/libs/fluidsynth/src/fluid_synth.h a/libs/fluidsynth/src/fluid_synth.h -index 3af336d..019a8e0 100644 +index 95e2c2e5f..96dc54574 100644 --- b/libs/fluidsynth/src/fluid_synth.h +++ a/libs/fluidsynth/src/fluid_synth.h -@@ -37,8 +37,8 @@ +@@ -33,8 +33,6 @@ #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" + /*************************************************************** +@@ -165,7 +163,9 @@ struct _fluid_synth_t + + fluid_mod_t *default_mod; /**< the (dynamic) list of default modulators */ + ++#ifdef LADSPA + fluid_ladspa_fx_t *ladspa_fx; /**< Effects unit for LADSPA support */ ++#endif + enum fluid_iir_filter_type custom_filter_type; /**< filter type of the user-defined filter currently used for all voices */ + enum fluid_iir_filter_flags custom_filter_flags; /**< filter type of the user-defined filter currently used for all voices */ + }; diff --git b/libs/fluidsynth/src/fluid_sys.c a/libs/fluidsynth/src/fluid_sys.c -index ee7d8d9..328f255 100644 +index 5a4a2dd93..c9662f778 100644 --- b/libs/fluidsynth/src/fluid_sys.c +++ a/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) +@@ -202,9 +202,10 @@ fluid_log(int level, const char *fmt, ...) + * @param delim String of delimiter chars. + * @return Pointer to the next token or NULL if no more tokens. + */ +-char *fluid_strtok(char **str, char *delim) ++char *fluid_strtok(char **str, const char *delim) { - fluid_timer_t *timer; -@@ -950,6 +950,7 @@ fluid_ostream_printf (fluid_ostream_t out, char* format, ...) - #endif - } +- char *s, *d, *token; ++ char *s, *token; ++ const char *d; + char c; -+#if 0 // Ardour says: no, thanks - int fluid_server_socket_join(fluid_server_socket_t *server_socket) - { - return fluid_thread_join (server_socket->thread); -@@ -1294,3 +1295,4 @@ int delete_fluid_server_socket(fluid_server_socket_t *server_socket) - } + if(str == NULL || delim == NULL || !*delim) +diff --git b/libs/fluidsynth/src/fluid_sys.h a/libs/fluidsynth/src/fluid_sys.h +index 47cc95c11..d95f6159f 100644 +--- b/libs/fluidsynth/src/fluid_sys.h ++++ a/libs/fluidsynth/src/fluid_sys.h +@@ -91,7 +91,7 @@ else \ + /* + * Utility functions + */ +-char *fluid_strtok(char **str, char *delim); ++char *fluid_strtok(char **str, const char *delim); - #endif -+#endif -diff --git b/libs/fluidsynth/src/fluid_tuning.c a/libs/fluidsynth/src/fluid_tuning.c -index cc440aa..8977ed6 100644 ---- b/libs/fluidsynth/src/fluid_tuning.c -+++ a/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; - } + #if defined(__OS2__) diff --git b/libs/fluidsynth/src/fluidsynth_priv.h a/libs/fluidsynth/src/fluidsynth_priv.h -index faf2772..74b9f4b 100644 +index 41e398398..d500f6174 100644 --- b/libs/fluidsynth/src/fluidsynth_priv.h +++ a/libs/fluidsynth/src/fluidsynth_priv.h -@@ -28,14 +28,6 @@ +@@ -26,10 +26,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 +@@ -133,8 +129,9 @@ typedef guint64 uint64_t; + #endif + + #if defined(WIN32) && HAVE_WINDOWS_H +-#include +-#include /* Provides also socklen_t */ ++//#include ++//#include /* Provides also socklen_t */ ++#include + + /* WIN32 special defines */ + #define DSOUND_SUPPORT 1