summaryrefslogtreecommitdiff
path: root/tools/ardour_fluidsynth.diff
blob: 64bc813a6efe31a6c817cabbeaf993a8711e0657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
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
 
 /* LADSPA */
 
+#ifdef LADSPA
 FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth);
+#endif
 
 
 /* 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 37b0a06a4..b6586895b 100644
--- b/libs/fluidsynth/src/fluid_hash.c
+++ a/libs/fluidsynth/src/fluid_hash.c
@@ -991,6 +991,7 @@ fluid_hashtable_remove_all(fluid_hashtable_t *hashtable)
     fluid_hashtable_maybe_resize(hashtable);
 }
 
+#if 0
 /**
  * fluid_hashtable_steal_all:
  * @hashtable: a #fluid_hashtable_t.
@@ -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_remove_or_steal:
diff --git b/libs/fluidsynth/src/fluid_midi.c a/libs/fluidsynth/src/fluid_midi.c
index c05f994ce..bdf72dd68 100644
--- b/libs/fluidsynth/src/fluid_midi.c
+++ a/libs/fluidsynth/src/fluid_midi.c
@@ -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
@@ -1011,6 +1011,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile)
 {
     return midifile->division;
 }
+#endif
 
 /******************************************************
  *
@@ -1330,7 +1331,7 @@ static void fluid_midi_event_set_sysex_LOCAL(fluid_midi_event_t *evt, int type,
  *
  *     fluid_track_t
  */
-
+#if 0 // disable fluid file player in Ardour
 /*
  * new_fluid_track
  */
@@ -2434,3 +2435,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 8a58d1e85..51b4faa25 100644
--- b/libs/fluidsynth/src/fluid_rev.c
+++ a/libs/fluidsynth/src/fluid_rev.c
@@ -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)
 {
     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_FREE(allpass->buffer);
diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.c a/libs/fluidsynth/src/fluid_rvoice_mixer.c
index 3b264e4d9..8c5254f26 100644
--- b/libs/fluidsynth/src/fluid_rvoice_mixer.c
+++ a/libs/fluidsynth/src/fluid_rvoice_mixer.c
@@ -24,11 +24,9 @@
 #include "fluid_rev.h"
 #include "fluid_chorus.h"
 #include "fluidsynth_priv.h"
-#include "fluid_ladspa.h"
 #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 4ee072e4b..1b3fceb34 100644
--- b/libs/fluidsynth/src/fluid_rvoice_mixer.h
+++ a/libs/fluidsynth/src/fluid_rvoice_mixer.h
@@ -24,7 +24,6 @@
 
 #include "fluidsynth_priv.h"
 #include "fluid_rvoice.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 d77d5ed79..05423384e 100644
--- b/libs/fluidsynth/src/fluid_settings.c
+++ a/libs/fluidsynth/src/fluid_settings.c
@@ -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_settings.h"
 #include "fluid_midi.h"
 
@@ -328,11 +325,13 @@ fluid_settings_init(fluid_settings_t *settings)
     fluid_return_if_fail(settings != NULL);
 
     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);
+#endif
 }
 
 static int
diff --git b/libs/fluidsynth/src/fluid_synth.c a/libs/fluidsynth/src/fluid_synth.c
index a40ba2eaa..e8845632f 100644
--- b/libs/fluidsynth/src/fluid_synth.c
+++ a/libs/fluidsynth/src/fluid_synth.c
@@ -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.
  */
-char *
+const char *
 fluid_version_str(void)
 {
     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 95e2c2e5f..96dc54574 100644
--- b/libs/fluidsynth/src/fluid_synth.h
+++ a/libs/fluidsynth/src/fluid_synth.h
@@ -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_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 5a4a2dd93..c9662f778 100644
--- b/libs/fluidsynth/src/fluid_sys.c
+++ a/libs/fluidsynth/src/fluid_sys.c
@@ -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)
 {
-    char *s, *d, *token;
+    char *s,  *token;
+		const char *d;
     char c;
 
     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);
 
 
 #if defined(__OS2__)
diff --git b/libs/fluidsynth/src/fluidsynth_priv.h a/libs/fluidsynth/src/fluidsynth_priv.h
index 41e398398..d500f6174 100644
--- b/libs/fluidsynth/src/fluidsynth_priv.h
+++ a/libs/fluidsynth/src/fluidsynth_priv.h
@@ -26,10 +26,6 @@
 
 #include "config.h"
 
-#if defined(__POWERPC__) && !(defined(__APPLE__) && defined(__MACH__))
-#include "config_maxmsp43.h"
-#endif
-
 #if HAVE_STRING_H
 #include <string.h>
 #endif
@@ -133,8 +129,9 @@ typedef guint64  uint64_t;
 #endif
 
 #if defined(WIN32) &&  HAVE_WINDOWS_H
-#include <winsock2.h>
-#include <ws2tcpip.h>	/* Provides also socklen_t */
+//#include <winsock2.h>
+//#include <ws2tcpip.h>	/* Provides also socklen_t */
+#include <windows.h>
 
 /* WIN32 special defines */
 #define DSOUND_SUPPORT 1