Update Fluidsynth to 2.0.1
[ardour.git] / tools / ardour_fluidsynth.diff
1 diff --git b/libs/fluidsynth/fluidsynth/synth.h a/libs/fluidsynth/fluidsynth/synth.h
2 index 1a0046fe1..a4afb9094 100644
3 --- b/libs/fluidsynth/fluidsynth/synth.h
4 +++ a/libs/fluidsynth/fluidsynth/synth.h
5 @@ -265,7 +265,7 @@ FLUIDSYNTH_API int fluid_synth_write_s16(fluid_synth_t *synth, int len,
6  FLUIDSYNTH_API int fluid_synth_write_float(fluid_synth_t *synth, int len,
7          void *lout, int loff, int lincr,
8          void *rout, int roff, int rincr);
9 -FLUID_DEPRECATED FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
10 +FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
11          float **left, float **right,
12          float **fx_left, float **fx_right);
13  FLUIDSYNTH_API int fluid_synth_process(fluid_synth_t *synth, int len,
14 @@ -310,7 +310,9 @@ FLUIDSYNTH_API int fluid_synth_set_custom_filter(fluid_synth_t *, int type, int
15  
16  /* LADSPA */
17  
18 +#ifdef LADSPA
19  FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth);
20 +#endif
21  
22  
23  /* API: Poly mono mode */
24 diff --git b/libs/fluidsynth/fluidsynth/types.h a/libs/fluidsynth/fluidsynth/types.h
25 index 47ef18336..5ad29281a 100644
26 --- b/libs/fluidsynth/fluidsynth/types.h
27 +++ a/libs/fluidsynth/fluidsynth/types.h
28 @@ -56,7 +56,9 @@ typedef struct _fluid_sequencer_t fluid_sequencer_t;            /**< Sequencer i
29  typedef struct _fluid_ramsfont_t fluid_ramsfont_t;              /**< RAM SoundFont */
30  typedef struct _fluid_rampreset_t fluid_rampreset_t;            /**< RAM SoundFont preset */
31  typedef struct _fluid_cmd_handler_t fluid_cmd_handler_t;        /**< Shell Command Handler */
32 +#ifdef LADSPA
33  typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t;            /**< LADSPA effects instance */
34 +#endif
35  typedef struct _fluid_file_callbacks_t fluid_file_callbacks_t;  /**< Callback struct to perform custom file loading of soundfonts */
36  
37  typedef int fluid_istream_t;    /**< Input stream descriptor */
38 diff --git b/libs/fluidsynth/src/fluid_hash.c a/libs/fluidsynth/src/fluid_hash.c
39 index 37b0a06a4..b6586895b 100644
40 --- b/libs/fluidsynth/src/fluid_hash.c
41 +++ a/libs/fluidsynth/src/fluid_hash.c
42 @@ -991,6 +991,7 @@ fluid_hashtable_remove_all(fluid_hashtable_t *hashtable)
43      fluid_hashtable_maybe_resize(hashtable);
44  }
45  
46 +#if 0
47  /**
48   * fluid_hashtable_steal_all:
49   * @hashtable: a #fluid_hashtable_t.
50 @@ -1008,6 +1009,7 @@ fluid_hashtable_steal_all(fluid_hashtable_t *hashtable)
51      fluid_hashtable_remove_all_nodes(hashtable, FALSE);
52      fluid_hashtable_maybe_resize(hashtable);
53  }
54 +#endif
55  
56  /*
57   * fluid_hashtable_foreach_remove_or_steal:
58 diff --git b/libs/fluidsynth/src/fluid_midi.c a/libs/fluidsynth/src/fluid_midi.c
59 index c05f994ce..bdf72dd68 100644
60 --- b/libs/fluidsynth/src/fluid_midi.c
61 +++ a/libs/fluidsynth/src/fluid_midi.c
62 @@ -75,7 +75,7 @@ static int fluid_midi_file_read_tracklen(fluid_midi_file *mf);
63  static int fluid_midi_file_eot(fluid_midi_file *mf);
64  static int fluid_midi_file_get_division(fluid_midi_file *midifile);
65  
66 -
67 +#if 0 // disable file I/O with Ardour
68  /***************************************************************
69   *
70   *                      MIDIFILE
71 @@ -1011,6 +1011,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile)
72  {
73      return midifile->division;
74  }
75 +#endif
76  
77  /******************************************************
78   *
79 @@ -1330,7 +1331,7 @@ static void fluid_midi_event_set_sysex_LOCAL(fluid_midi_event_t *evt, int type,
80   *
81   *     fluid_track_t
82   */
83 -
84 +#if 0 // disable fluid file player in Ardour
85  /*
86   * new_fluid_track
87   */
88 @@ -2434,3 +2435,4 @@ fluid_midi_event_length(unsigned char event)
89  
90      return 1;
91  }
92 +#endif
93 diff --git b/libs/fluidsynth/src/fluid_rev.c a/libs/fluidsynth/src/fluid_rev.c
94 index 8a58d1e85..51b4faa25 100644
95 --- b/libs/fluidsynth/src/fluid_rev.c
96 +++ a/libs/fluidsynth/src/fluid_rev.c
97 @@ -51,7 +51,7 @@ void fluid_allpass_init(fluid_allpass *allpass);
98  void fluid_allpass_setfeedback(fluid_allpass *allpass, fluid_real_t val);
99  fluid_real_t fluid_allpass_getfeedback(fluid_allpass *allpass);
100  
101 -void
102 +static void
103  fluid_allpass_setbuffer(fluid_allpass *allpass, int size)
104  {
105      allpass->bufidx = 0;
106 @@ -59,7 +59,7 @@ fluid_allpass_setbuffer(fluid_allpass *allpass, int size)
107      allpass->bufsize = size;
108  }
109  
110 -void
111 +static void
112  fluid_allpass_release(fluid_allpass *allpass)
113  {
114      FLUID_FREE(allpass->buffer);
115 diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.c a/libs/fluidsynth/src/fluid_rvoice_mixer.c
116 index 3b264e4d9..8c5254f26 100644
117 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.c
118 +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.c
119 @@ -24,11 +24,9 @@
120  #include "fluid_rev.h"
121  #include "fluid_chorus.h"
122  #include "fluidsynth_priv.h"
123 -#include "fluid_ladspa.h"
124  #include "fluid_synth.h"
125  
126 -
127 -#define ENABLE_MIXER_THREADS 1
128 +#undef ENABLE_MIXER_THREADS // Ardour does the multithreading -- synth.cpu-cores defaults to 1
129  
130  // If less than x voices, the thread overhead is larger than the gain,
131  // so don't activate the thread(s).
132 diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.h a/libs/fluidsynth/src/fluid_rvoice_mixer.h
133 index 4ee072e4b..1b3fceb34 100644
134 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.h
135 +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.h
136 @@ -24,7 +24,6 @@
137  
138  #include "fluidsynth_priv.h"
139  #include "fluid_rvoice.h"
140 -#include "fluid_ladspa.h"
141  
142  typedef struct _fluid_rvoice_mixer_t fluid_rvoice_mixer_t;
143  
144 diff --git b/libs/fluidsynth/src/fluid_settings.c a/libs/fluidsynth/src/fluid_settings.c
145 index d77d5ed79..05423384e 100644
146 --- b/libs/fluidsynth/src/fluid_settings.c
147 +++ a/libs/fluidsynth/src/fluid_settings.c
148 @@ -21,9 +21,6 @@
149  #include "fluid_sys.h"
150  #include "fluid_hash.h"
151  #include "fluid_synth.h"
152 -#include "fluid_cmd.h"
153 -#include "fluid_adriver.h"
154 -#include "fluid_mdriver.h"
155  #include "fluid_settings.h"
156  #include "fluid_midi.h"
157  
158 @@ -328,11 +325,13 @@ fluid_settings_init(fluid_settings_t *settings)
159      fluid_return_if_fail(settings != NULL);
160  
161      fluid_synth_settings(settings);
162 +#if 0
163      fluid_shell_settings(settings);
164      fluid_player_settings(settings);
165      fluid_file_renderer_settings(settings);
166      fluid_audio_driver_settings(settings);
167      fluid_midi_driver_settings(settings);
168 +#endif
169  }
170  
171  static int
172 diff --git b/libs/fluidsynth/src/fluid_synth.c a/libs/fluidsynth/src/fluid_synth.c
173 index a40ba2eaa..e8845632f 100644
174 --- b/libs/fluidsynth/src/fluid_synth.c
175 +++ a/libs/fluidsynth/src/fluid_synth.c
176 @@ -267,7 +267,7 @@ void fluid_version(int *major, int *minor, int *micro)
177   * @return FluidSynth version string, which is internal and should not be
178   *   modified or freed.
179   */
180 -char *
181 +const char *
182  fluid_version_str(void)
183  {
184      return FLUIDSYNTH_VERSION;
185 @@ -6435,6 +6435,7 @@ int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type)
186      FLUID_API_RETURN(FLUID_OK);
187  }
188  
189 +#ifdef LADSPA
190  /**
191   * Return the LADSPA effects instance used by FluidSynth
192   *
193 @@ -6447,6 +6448,7 @@ fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth)
194  
195      return synth->ladspa_fx;
196  }
197 +#endif
198  
199  /**
200   * Configure a general-purpose IIR biquad filter.
201 diff --git b/libs/fluidsynth/src/fluid_synth.h a/libs/fluidsynth/src/fluid_synth.h
202 index 95e2c2e5f..96dc54574 100644
203 --- b/libs/fluidsynth/src/fluid_synth.h
204 +++ a/libs/fluidsynth/src/fluid_synth.h
205 @@ -33,8 +33,6 @@
206  #include "fluid_rev.h"
207  #include "fluid_voice.h"
208  #include "fluid_chorus.h"
209 -#include "fluid_ladspa.h"
210 -#include "fluid_midi_router.h"
211  #include "fluid_rvoice_event.h"
212  
213  /***************************************************************
214 @@ -165,7 +163,9 @@ struct _fluid_synth_t
215  
216      fluid_mod_t *default_mod;          /**< the (dynamic) list of default modulators */
217  
218 +#ifdef LADSPA
219      fluid_ladspa_fx_t *ladspa_fx;      /**< Effects unit for LADSPA support */
220 +#endif
221      enum fluid_iir_filter_type custom_filter_type; /**< filter type of the user-defined filter currently used for all voices */
222      enum fluid_iir_filter_flags custom_filter_flags; /**< filter type of the user-defined filter currently used for all voices */
223  };
224 diff --git b/libs/fluidsynth/src/fluid_sys.c a/libs/fluidsynth/src/fluid_sys.c
225 index 5a4a2dd93..c9662f778 100644
226 --- b/libs/fluidsynth/src/fluid_sys.c
227 +++ a/libs/fluidsynth/src/fluid_sys.c
228 @@ -202,9 +202,10 @@ fluid_log(int level, const char *fmt, ...)
229   * @param delim String of delimiter chars.
230   * @return Pointer to the next token or NULL if no more tokens.
231   */
232 -char *fluid_strtok(char **str, char *delim)
233 +char *fluid_strtok(char **str, const char *delim)
234  {
235 -    char *s, *d, *token;
236 +    char *s,  *token;
237 +               const char *d;
238      char c;
239  
240      if(str == NULL || delim == NULL || !*delim)
241 diff --git b/libs/fluidsynth/src/fluid_sys.h a/libs/fluidsynth/src/fluid_sys.h
242 index 47cc95c11..d95f6159f 100644
243 --- b/libs/fluidsynth/src/fluid_sys.h
244 +++ a/libs/fluidsynth/src/fluid_sys.h
245 @@ -91,7 +91,7 @@ else \
246  /*
247   * Utility functions
248   */
249 -char *fluid_strtok(char **str, char *delim);
250 +char *fluid_strtok(char **str, const char *delim);
251  
252  
253  #if defined(__OS2__)
254 diff --git b/libs/fluidsynth/src/fluidsynth_priv.h a/libs/fluidsynth/src/fluidsynth_priv.h
255 index 41e398398..d500f6174 100644
256 --- b/libs/fluidsynth/src/fluidsynth_priv.h
257 +++ a/libs/fluidsynth/src/fluidsynth_priv.h
258 @@ -26,10 +26,6 @@
259  
260  #include "config.h"
261  
262 -#if defined(__POWERPC__) && !(defined(__APPLE__) && defined(__MACH__))
263 -#include "config_maxmsp43.h"
264 -#endif
265 -
266  #if HAVE_STRING_H
267  #include <string.h>
268  #endif
269 @@ -133,8 +129,9 @@ typedef guint64  uint64_t;
270  #endif
271  
272  #if defined(WIN32) &&  HAVE_WINDOWS_H
273 -#include <winsock2.h>
274 -#include <ws2tcpip.h>  /* Provides also socklen_t */
275 +//#include <winsock2.h>
276 +//#include <ws2tcpip.h>        /* Provides also socklen_t */
277 +#include <windows.h>
278  
279  /* WIN32 special defines */
280  #define DSOUND_SUPPORT 1