View | Details | Raw Unified | Return to bug 233500
Collapse All | Expand All

(-)files/patch-source_FluidPlug.c (+49 lines)
Line 0 Link Here
1
--- source/FluidPlug.c.orig	2018-12-08 10:34:10 UTC
2
+++ source/FluidPlug.c
3
@@ -130,12 +130,20 @@ static LV2_Handle lv2_instantiate(const struct _LV2_De
4
         goto cleanup_synth;
5
 
6
     size_t count;
7
+#if FLUIDSYNTH_VERSION_MAJOR < 2
8
     fluid_preset_t preset;
9
 
10
     sfont->iteration_start(sfont);
11
     for (count = 0; sfont->iteration_next(sfont, &preset) != 0;)
12
         ++count;
13
+#else
14
+    fluid_preset_t *preset = NULL;
15
 
16
+    fluid_sfont_iteration_start(sfont);
17
+    for (count = 0; (preset = fluid_sfont_iteration_next(sfont)) != NULL;)
18
+        ++count;
19
+#endif
20
+
21
     if (count == 0)
22
         goto cleanup_synth;
23
 
24
@@ -144,6 +152,7 @@ static LV2_Handle lv2_instantiate(const struct _LV2_De
25
     if (programs == NULL)
26
         goto cleanup_synth;
27
 
28
+#if FLUIDSYNTH_VERSION_MAJOR < 2
29
     sfont->iteration_start(sfont);
30
     for (count = 0; sfont->iteration_next(sfont, &preset) != 0;)
31
     {
32
@@ -153,6 +162,17 @@ static LV2_Handle lv2_instantiate(const struct _LV2_De
33
         };
34
         programs[count++] = bp;
35
     }
36
+#else
37
+    fluid_sfont_iteration_start(sfont);
38
+    for (count = 0; (preset = fluid_sfont_iteration_next(sfont)) != NULL;)
39
+    {
40
+        const BankProgram bp = {
41
+            fluid_preset_get_banknum(preset),
42
+            fluid_preset_get_num(preset)
43
+        };
44
+        programs[count++] = bp;
45
+    }
46
+#endif
47
 
48
     fluid_synth_program_select(synth, 0, synthId, programs[0].bank, programs[0].prog);
49
 

Return to bug 233500