70c2a2275a2e6caf8eaccb659190509a3b763654
[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 369a2c2615..87826809fd 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 47ef18336a..5ad29281ad 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 60f441c49f..e6455186eb 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 946a873bbf..79f83a4583 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 cd0d23ced3..c92fb2fefa 100644
82 --- b/libs/fluidsynth/src/fluid_midi.c
83 +++ a/libs/fluidsynth/src/fluid_midi.c
84 @@ -77,7 +77,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 @@ -1048,6 +1048,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile)
94  {
95      return midifile->division;
96  }
97 +#endif
98  
99  /******************************************************
100   *
101 @@ -1414,7 +1415,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 @@ -2504,3 +2505,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 47547b5b5e..57313caf42 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 3e7661741f..ec8e967a35 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 85c3fb9142..5ea08ff6fa 100644
143 --- b/libs/fluidsynth/src/fluid_rvoice_mixer.c
144 +++ a/libs/fluidsynth/src/fluid_rvoice_mixer.c
145 @@ -23,7 +23,6 @@
146  #include "fluid_sys.h"
147  #include "fluid_rev.h"
148  #include "fluid_chorus.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 4ee072e4b9..1b3fceb342 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 5b2b08748f..1811169846 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 426d3c4fc0..42064f93d6 100644
195 --- b/libs/fluidsynth/src/fluid_synth.c
196 +++ a/libs/fluidsynth/src/fluid_synth.c
197 @@ -25,7 +25,6 @@
198  #include "fluid_settings.h"
199  #include "fluid_sfont.h"
200  #include "fluid_defsfont.h"
201 -#include "fluid_instpatch.h"
202  
203  #ifdef TRAP_ON_FPE
204  #define _GNU_SOURCE
205 @@ -268,7 +267,7 @@ void fluid_version(int *major, int *minor, int *micro)
206   * @return FluidSynth version string, which is internal and should not be
207   *   modified or freed.
208   */
209 -char *
210 +const char *
211  fluid_version_str(void)
212  {
213      return FLUIDSYNTH_VERSION;
214 @@ -5509,7 +5508,7 @@ fluid_synth_set_interp_method(fluid_synth_t *synth, int chan, int interp_method)
215      }
216  
217      FLUID_API_RETURN(FLUID_OK);
218 -};
219 +}
220  
221  /**
222   * Get the total count of MIDI channels.
223 @@ -6447,6 +6446,7 @@ int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type)
224      FLUID_API_RETURN(FLUID_OK);
225  }
226  
227 +#ifdef LADSPA
228  /**
229   * Return the LADSPA effects instance used by FluidSynth
230   *
231 @@ -6459,6 +6459,7 @@ fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth)
232  
233      return synth->ladspa_fx;
234  }
235 +#endif
236  
237  /**
238   * Configure a general-purpose IIR biquad filter.
239 diff --git b/libs/fluidsynth/src/fluid_synth.h a/libs/fluidsynth/src/fluid_synth.h
240 index 0b9758bad5..fe222f7b6f 100644
241 --- b/libs/fluidsynth/src/fluid_synth.h
242 +++ a/libs/fluidsynth/src/fluid_synth.h
243 @@ -33,8 +33,6 @@
244  #include "fluid_rev.h"
245  #include "fluid_voice.h"
246  #include "fluid_chorus.h"
247 -#include "fluid_ladspa.h"
248 -#include "fluid_midi_router.h"
249  #include "fluid_rvoice_event.h"
250  
251  /***************************************************************
252 @@ -165,7 +163,9 @@ struct _fluid_synth_t
253  
254      fluid_mod_t *default_mod;          /**< the (dynamic) list of default modulators */
255  
256 +#ifdef LADSPA
257      fluid_ladspa_fx_t *ladspa_fx;      /**< Effects unit for LADSPA support */
258 +#endif
259      enum fluid_iir_filter_type custom_filter_type; /**< filter type of the user-defined filter currently used for all voices */
260      enum fluid_iir_filter_flags custom_filter_flags; /**< filter type of the user-defined filter currently used for all voices */
261  };
262 diff --git b/libs/fluidsynth/src/fluid_sys.c a/libs/fluidsynth/src/fluid_sys.c
263 index 5d123883b3..938c05cf22 100644
264 --- b/libs/fluidsynth/src/fluid_sys.c
265 +++ a/libs/fluidsynth/src/fluid_sys.c
266 @@ -205,9 +205,10 @@ fluid_log(int level, const char *fmt, ...)
267   * @param delim String of delimiter chars.
268   * @return Pointer to the next token or NULL if no more tokens.
269   */
270 -char *fluid_strtok(char **str, char *delim)
271 +char *fluid_strtok(char **str, const char *delim)
272  {
273 -    char *s, *d, *token;
274 +    char *s,  *token;
275 +               const char *d;
276      char c;
277  
278      if(str == NULL || delim == NULL || !*delim)
279 diff --git b/libs/fluidsynth/src/fluid_sys.h a/libs/fluidsynth/src/fluid_sys.h
280 index 6490359027..3bc0c5a40f 100644
281 --- b/libs/fluidsynth/src/fluid_sys.h
282 +++ a/libs/fluidsynth/src/fluid_sys.h
283 @@ -128,8 +128,9 @@ typedef guint64  uint64_t;
284  #endif
285  
286  #if defined(WIN32) &&  HAVE_WINDOWS_H
287 -#include <winsock2.h>
288 -#include <ws2tcpip.h>  /* Provides also socklen_t */
289 +//#include <winsock2.h>
290 +//#include <ws2tcpip.h>        /* Provides also socklen_t */
291 +#include <windows.h>
292  
293  /* WIN32 special defines */
294  #define STDIN_FILENO 0
295 @@ -187,7 +188,7 @@ typedef guint64  uint64_t;
296  /*
297   * Utility functions
298   */
299 -char *fluid_strtok(char **str, char *delim);
300 +char *fluid_strtok(char **str, const char *delim);
301  
302  
303  #if defined(__OS2__)