Update Fluidsynth to v2.0.3
[ardour.git] / tools / fluid-patches / ardour_fluidsynth.diff
1 diff --git b/libs/fluidsynth/fluidsynth/synth.h a/libs/fluidsynth/fluidsynth/synth.h
2 index 369a2c261..87826809f 100644
3 --- b/libs/fluidsynth/fluidsynth/synth.h
4 +++ a/libs/fluidsynth/fluidsynth/synth.h
5 @@ -233,7 +233,7 @@ FLUIDSYNTH_API int fluid_synth_tuning_dump(fluid_synth_t *synth, int bank, int p
6  /* Misc */
7  
8  FLUIDSYNTH_API double fluid_synth_get_cpu_load(fluid_synth_t *synth);
9 -FLUID_DEPRECATED FLUIDSYNTH_API const char *fluid_synth_error(fluid_synth_t *synth);
10 +const char *fluid_synth_error(fluid_synth_t *synth);
11  
12  
13  /* Default modulators */
14 @@ -265,7 +265,7 @@ FLUIDSYNTH_API int fluid_synth_write_s16(fluid_synth_t *synth, int len,
15  FLUIDSYNTH_API int fluid_synth_write_float(fluid_synth_t *synth, int len,
16          void *lout, int loff, int lincr,
17          void *rout, int roff, int rincr);
18 -FLUID_DEPRECATED FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
19 +FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
20          float **left, float **right,
21          float **fx_left, float **fx_right);
22  FLUIDSYNTH_API int fluid_synth_process(fluid_synth_t *synth, int len,
23 @@ -310,7 +310,9 @@ FLUIDSYNTH_API int fluid_synth_set_custom_filter(fluid_synth_t *, int type, int
24  
25  /* LADSPA */
26  
27 +#ifdef LADSPA
28  FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth);
29 +#endif
30  
31  
32  /* API: Poly mono mode */
33 diff --git b/libs/fluidsynth/fluidsynth/types.h a/libs/fluidsynth/fluidsynth/types.h
34 index 47ef18336..5ad29281a 100644
35 --- b/libs/fluidsynth/fluidsynth/types.h
36 +++ a/libs/fluidsynth/fluidsynth/types.h
37 @@ -56,7 +56,9 @@ typedef struct _fluid_sequencer_t fluid_sequencer_t;            /**< Sequencer i
38  typedef struct _fluid_ramsfont_t fluid_ramsfont_t;              /**< RAM SoundFont */
39  typedef struct _fluid_rampreset_t fluid_rampreset_t;            /**< RAM SoundFont preset */
40  typedef struct _fluid_cmd_handler_t fluid_cmd_handler_t;        /**< Shell Command Handler */
41 +#ifdef LADSPA
42  typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t;            /**< LADSPA effects instance */
43 +#endif
44  typedef struct _fluid_file_callbacks_t fluid_file_callbacks_t;  /**< Callback struct to perform custom file loading of soundfonts */
45  
46  typedef int fluid_istream_t;    /**< Input stream descriptor */
47 diff --git b/libs/fluidsynth/src/fluid_conv.h a/libs/fluidsynth/src/fluid_conv.h
48 index 60f441c49..e6455186e 100644
49 --- b/libs/fluidsynth/src/fluid_conv.h
50 +++ a/libs/fluidsynth/src/fluid_conv.h
51 @@ -22,7 +22,7 @@
52  #define _FLUID_CONV_H
53  
54  #include "fluidsynth_priv.h"
55 -#include "utils/fluid_conv_tables.h"
56 +#include "fluid_conv_tables.h"
57  
58  fluid_real_t fluid_ct2hz_real(fluid_real_t cents);
59  fluid_real_t fluid_ct2hz(fluid_real_t cents);
60 diff --git b/libs/fluidsynth/src/fluid_hash.c a/libs/fluidsynth/src/fluid_hash.c
61 index 37b0a06a4..b6586895b 100644
62 --- b/libs/fluidsynth/src/fluid_hash.c
63 +++ a/libs/fluidsynth/src/fluid_hash.c
64 @@ -991,6 +991,7 @@ fluid_hashtable_remove_all(fluid_hashtable_t *hashtable)
65      fluid_hashtable_maybe_resize(hashtable);
66  }
67  
68 +#if 0
69  /**
70   * fluid_hashtable_steal_all:
71   * @hashtable: a #fluid_hashtable_t.
72 @@ -1008,6 +1009,7 @@ fluid_hashtable_steal_all(fluid_hashtable_t *hashtable)
73      fluid_hashtable_remove_all_nodes(hashtable, FALSE);
74      fluid_hashtable_maybe_resize(hashtable);
75  }
76 +#endif
77  
78  /*
79   * fluid_hashtable_foreach_remove_or_steal:
80 diff --git b/libs/fluidsynth/src/fluid_midi.c a/libs/fluidsynth/src/fluid_midi.c
81 index 1a394f811..8deb0b0d1 100644
82 --- b/libs/fluidsynth/src/fluid_midi.c
83 +++ a/libs/fluidsynth/src/fluid_midi.c
84 @@ -76,7 +76,7 @@ static int fluid_midi_file_read_tracklen(fluid_midi_file *mf);
85  static int fluid_midi_file_eot(fluid_midi_file *mf);
86  static int fluid_midi_file_get_division(fluid_midi_file *midifile);
87  
88 -
89 +#if 0 // disable file I/O with Ardour
90  /***************************************************************
91   *
92   *                      MIDIFILE
93 @@ -1047,6 +1047,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile)
94  {
95      return midifile->division;
96  }
97 +#endif
98  
99  /******************************************************
100   *
101 @@ -1413,7 +1414,7 @@ static void fluid_midi_event_get_sysex_LOCAL(fluid_midi_event_t *evt, void **dat
102   *
103   *     fluid_track_t
104   */
105 -
106 +#if 0 // disable fluid file player in Ardour
107  /*
108   * new_fluid_track
109   */
110 @@ -2517,3 +2518,4 @@ fluid_midi_event_length(unsigned char event)
111  
112      return 1;
113  }
114 +#endif
115 diff --git b/libs/fluidsynth/src/fluid_mod.c a/libs/fluidsynth/src/fluid_mod.c
116 index 84e97731e..5e57455d4 100644
117 --- b/libs/fluidsynth/src/fluid_mod.c
118 +++ a/libs/fluidsynth/src/fluid_mod.c
119 @@ -603,7 +603,7 @@ fluid_mod_check_cc_source(const fluid_mod_t *mod, unsigned char src1_select)
120   * @param name,if not NULL, pointer on a string displayed as a warning.
121   * @return TRUE if modulator sources src1, src2 are valid, FALSE otherwise.
122   */
123 -int fluid_mod_check_sources(const fluid_mod_t *mod, char *name)
124 +int fluid_mod_check_sources(const fluid_mod_t *mod, const char *name)
125  {
126      static const char *invalid_non_cc_src =
127          "Invalid modulator, using non-CC source %s.src%d=%d";
128 diff --git b/libs/fluidsynth/src/fluid_mod.h a/libs/fluidsynth/src/fluid_mod.h
129 index 3e7661741..ec8e967a3 100644
130 --- b/libs/fluidsynth/src/fluid_mod.h
131 +++ a/libs/fluidsynth/src/fluid_mod.h
132 @@ -44,7 +44,7 @@ struct _fluid_mod_t
133  };
134  
135  fluid_real_t fluid_mod_get_value(fluid_mod_t *mod, fluid_voice_t *voice);
136 -int fluid_mod_check_sources(const fluid_mod_t *mod, char *name);
137 +int fluid_mod_check_sources(const fluid_mod_t *mod, const char *name);
138  
139  #ifdef DEBUG
140  void fluid_dump_modulator(fluid_mod_t *mod);
141 diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.c a/libs/fluidsynth/src/fluid_rvoice_mixer.c
142 index af0ef75d1..9acc5f830 100644
143 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.c
144 +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.c
145 @@ -24,7 +24,6 @@
146  #include "fluid_rev.h"
147  #include "fluid_chorus.h"
148  #include "fluidsynth_priv.h"
149 -#include "fluid_ladspa.h"
150  #include "fluid_synth.h"
151  
152  
153 diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.h a/libs/fluidsynth/src/fluid_rvoice_mixer.h
154 index 4ee072e4b..1b3fceb34 100644
155 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.h
156 +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.h
157 @@ -24,7 +24,6 @@
158  
159  #include "fluidsynth_priv.h"
160  #include "fluid_rvoice.h"
161 -#include "fluid_ladspa.h"
162  
163  typedef struct _fluid_rvoice_mixer_t fluid_rvoice_mixer_t;
164  
165 diff --git b/libs/fluidsynth/src/fluid_settings.c a/libs/fluidsynth/src/fluid_settings.c
166 index 02be9a033..9207ab063 100644
167 --- b/libs/fluidsynth/src/fluid_settings.c
168 +++ a/libs/fluidsynth/src/fluid_settings.c
169 @@ -21,9 +21,6 @@
170  #include "fluid_sys.h"
171  #include "fluid_hash.h"
172  #include "fluid_synth.h"
173 -#include "fluid_cmd.h"
174 -#include "fluid_adriver.h"
175 -#include "fluid_mdriver.h"
176  #include "fluid_settings.h"
177  #include "fluid_midi.h"
178  
179 @@ -328,11 +325,13 @@ fluid_settings_init(fluid_settings_t *settings)
180      fluid_return_if_fail(settings != NULL);
181  
182      fluid_synth_settings(settings);
183 +#if 0
184      fluid_shell_settings(settings);
185      fluid_player_settings(settings);
186      fluid_file_renderer_settings(settings);
187      fluid_audio_driver_settings(settings);
188      fluid_midi_driver_settings(settings);
189 +#endif
190  }
191  
192  static int
193 diff --git b/libs/fluidsynth/src/fluid_synth.c a/libs/fluidsynth/src/fluid_synth.c
194 index 07bfc0427..b4524a2ac 100644
195 --- b/libs/fluidsynth/src/fluid_synth.c
196 +++ a/libs/fluidsynth/src/fluid_synth.c
197 @@ -267,7 +267,7 @@ void fluid_version(int *major, int *minor, int *micro)
198   * @return FluidSynth version string, which is internal and should not be
199   *   modified or freed.
200   */
201 -char *
202 +const char *
203  fluid_version_str(void)
204  {
205      return FLUIDSYNTH_VERSION;
206 @@ -6442,6 +6442,7 @@ int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type)
207      FLUID_API_RETURN(FLUID_OK);
208  }
209  
210 +#ifdef LADSPA
211  /**
212   * Return the LADSPA effects instance used by FluidSynth
213   *
214 @@ -6454,6 +6455,7 @@ fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth)
215  
216      return synth->ladspa_fx;
217  }
218 +#endif
219  
220  /**
221   * Configure a general-purpose IIR biquad filter.
222 diff --git b/libs/fluidsynth/src/fluid_synth.h a/libs/fluidsynth/src/fluid_synth.h
223 index 156424af1..58869730c 100644
224 --- b/libs/fluidsynth/src/fluid_synth.h
225 +++ a/libs/fluidsynth/src/fluid_synth.h
226 @@ -33,8 +33,6 @@
227  #include "fluid_rev.h"
228  #include "fluid_voice.h"
229  #include "fluid_chorus.h"
230 -#include "fluid_ladspa.h"
231 -#include "fluid_midi_router.h"
232  #include "fluid_rvoice_event.h"
233  
234  /***************************************************************
235 @@ -165,7 +163,9 @@ struct _fluid_synth_t
236  
237      fluid_mod_t *default_mod;          /**< the (dynamic) list of default modulators */
238  
239 +#ifdef LADSPA
240      fluid_ladspa_fx_t *ladspa_fx;      /**< Effects unit for LADSPA support */
241 +#endif
242      enum fluid_iir_filter_type custom_filter_type; /**< filter type of the user-defined filter currently used for all voices */
243      enum fluid_iir_filter_flags custom_filter_flags; /**< filter type of the user-defined filter currently used for all voices */
244  };
245 diff --git b/libs/fluidsynth/src/fluid_sys.c a/libs/fluidsynth/src/fluid_sys.c
246 index d686737f6..28911ee7f 100644
247 --- b/libs/fluidsynth/src/fluid_sys.c
248 +++ a/libs/fluidsynth/src/fluid_sys.c
249 @@ -202,9 +202,10 @@ fluid_log(int level, const char *fmt, ...)
250   * @param delim String of delimiter chars.
251   * @return Pointer to the next token or NULL if no more tokens.
252   */
253 -char *fluid_strtok(char **str, char *delim)
254 +char *fluid_strtok(char **str, const char *delim)
255  {
256 -    char *s, *d, *token;
257 +    char *s,  *token;
258 +               const char *d;
259      char c;
260  
261      if(str == NULL || delim == NULL || !*delim)
262 diff --git b/libs/fluidsynth/src/fluid_sys.h a/libs/fluidsynth/src/fluid_sys.h
263 index 72b323029..122938655 100644
264 --- b/libs/fluidsynth/src/fluid_sys.h
265 +++ a/libs/fluidsynth/src/fluid_sys.h
266 @@ -99,7 +99,7 @@ else \
267  /*
268   * Utility functions
269   */
270 -char *fluid_strtok(char **str, char *delim);
271 +char *fluid_strtok(char **str, const char *delim);
272  
273  
274  #if defined(__OS2__)
275 diff --git b/libs/fluidsynth/src/fluidsynth_priv.h a/libs/fluidsynth/src/fluidsynth_priv.h
276 index 4df590e21..384785fcc 100644
277 --- b/libs/fluidsynth/src/fluidsynth_priv.h
278 +++ a/libs/fluidsynth/src/fluidsynth_priv.h
279 @@ -26,10 +26,6 @@
280  
281  #include "config.h"
282  
283 -#if defined(__POWERPC__) && !(defined(__APPLE__) && defined(__MACH__))
284 -#include "config_maxmsp43.h"
285 -#endif
286 -
287  #if HAVE_STRING_H
288  #include <string.h>
289  #endif
290 @@ -133,8 +129,9 @@ typedef guint64  uint64_t;
291  #endif
292  
293  #if defined(WIN32) &&  HAVE_WINDOWS_H
294 -#include <winsock2.h>
295 -#include <ws2tcpip.h>  /* Provides also socklen_t */
296 +//#include <winsock2.h>
297 +//#include <ws2tcpip.h>        /* Provides also socklen_t */
298 +#include <windows.h>
299  
300  /* WIN32 special defines */
301  #define STDIN_FILENO 0