[packages/freewheeling] update to fluidsynth 2 API

jajcus jajcus at pld-linux.org
Tue Nov 20 19:30:40 CET 2018


commit cfaed93c7648908b6e2c58e8704da35c9c65ef13
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Tue Nov 20 19:30:09 2018 +0100

    update to fluidsynth 2 API
    
    Release: 2

 fluidsynth2.patch | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 freewheeling.spec |  4 ++-
 2 files changed, 80 insertions(+), 1 deletion(-)
---
diff --git a/freewheeling.spec b/freewheeling.spec
index 013cfdb..5770a54 100644
--- a/freewheeling.spec
+++ b/freewheeling.spec
@@ -1,12 +1,13 @@
 Summary:	Freewheeling Live Looper
 Name:		freewheeling
 Version:	0.6.4
-Release:	1
+Release:	2
 License:	GPL v2
 Group:		Applications
 Source0:	https://github.com/free-wheeling/freewheeling/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	7a76624759929fe819d3a0d0dc8c0bb3
 Patch0:		config.patch
+Patch1:		fluidsynth2.patch
 URL:		https://github.com/free-wheeling/freewheeling/
 BuildRequires:	SDL-devel
 BuildRequires:	SDL_gfx-devel
@@ -33,6 +34,7 @@ interface for instrumentalists to capture audio loops in real-time.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 export CFLAGS="%{rpmcflags} -I/usr/include/SDL"
diff --git a/fluidsynth2.patch b/fluidsynth2.patch
new file mode 100644
index 0000000..7d86ae5
--- /dev/null
+++ b/fluidsynth2.patch
@@ -0,0 +1,77 @@
+diff -dur freewheeling-0.6.4.orig/src/fweelin_browser.h freewheeling-0.6.4/src/fweelin_browser.h
+--- freewheeling-0.6.4.orig/src/fweelin_browser.h	2017-04-03 21:19:44.000000000 +0200
++++ freewheeling-0.6.4/src/fweelin_browser.h	2018-11-20 19:22:05.157793326 +0100
+@@ -52,7 +52,7 @@
+ class BrowserItem {
+  public:
+   // Initialize a browser item with name n
+-  BrowserItem(char *n = 0, char default_name = 1) : 
++  BrowserItem(const char *n = 0, char default_name = 1) : 
+     default_name(default_name), next(0), prev(0) {
+     if (n == 0)
+       name = 0;
+@@ -415,7 +415,7 @@
+ public:
+ 
+   PatchItem (int id = 0, int bank = 0, int prog = 0, int channel = 0,
+-             char *name = 0, char bypasscc = 0, int bypasschannel = -1, float bypasstime1 = 0.0, float bypasstime2 = 10.0) :
++             const char *name = 0, char bypasscc = 0, int bypasschannel = -1, float bypasstime1 = 0.0, float bypasstime2 = 10.0) :
+     BrowserItem(name), id(id), bank(bank), prog(prog), channel(channel),
+     bypasscc(bypasscc), bypasschannel(bypasschannel), bypasstime1(bypasstime1), bypasstime2(bypasstime2), 
+     zones(0), numzones(0) {};
+diff -dur freewheeling-0.6.4.orig/src/fweelin_fluidsynth.cc freewheeling-0.6.4/src/fweelin_fluidsynth.cc
+--- freewheeling-0.6.4.orig/src/fweelin_fluidsynth.cc	2017-04-03 21:19:44.000000000 +0200
++++ freewheeling-0.6.4/src/fweelin_fluidsynth.cc	2018-11-20 19:21:42.736622350 +0100
+@@ -33,12 +33,6 @@
+ 
+ #include "fweelin_fluidsynth.h"
+ 
+-#define fluid_sfont_iteration_start(_sf) (*(_sf)->iteration_start)(_sf)
+-#define fluid_sfont_iteration_next(_sf,_pr) (*(_sf)->iteration_next)(_sf,_pr)
+-#define fluid_preset_get_name(_preset) (*(_preset)->get_name)(_preset)
+-#define fluid_preset_get_banknum(_preset) (*(_preset)->get_banknum)(_preset)
+-#define fluid_preset_get_num(_preset) (*(_preset)->get_num)(_preset)
+-
+ void FluidSynthParam_Int::Send(fluid_settings_t *settings) {
+   printf("FLUID: Setting parameter '%s' = '%d'\n",name,val);
+   fluid_settings_setint(settings, name, val);
+@@ -91,11 +85,11 @@
+     double pitches[12];
+     for (int i = 0; i < 12; i++)
+       pitches[i] = tuning;
+-    fluid_synth_create_octave_tuning(synth, 0, 0, "DETUNE", pitches);
++    fluid_synth_activate_octave_tuning(synth, 0, 0, "DETUNE", pitches, true);
+ 
+     // Select tuning
+     for (int i = 0; i < MAX_MIDI_CHANNELS; i++) 
+-      fluid_synth_select_tuning(synth, i, 0, 0);
++      fluid_synth_activate_tuning(synth, i, 0, 0, true);
+   } else 
+     printf("FLUID: Using default tuning\n");
+ 
+@@ -160,7 +154,7 @@
+ 
+ // Sets up our internal patch list based on loaded soundfonts
+ void FluidSynthProcessor::SetupPatches() {
+-  fluid_preset_t preset;
++  fluid_preset_t *preset;
+ 
+   PatchBrowser *br = (PatchBrowser *) app->getBROWSER(B_Patch);
+ 
+@@ -174,12 +168,12 @@
+     for (int i = 0; i < sfcnt; i++) {
+       fluid_sfont_t *curfont = fluid_synth_get_sfont(synth,i);
+       fluid_sfont_iteration_start(curfont);
+-      while (fluid_sfont_iteration_next(curfont, &preset))
++      while ((preset = fluid_sfont_iteration_next(curfont)))
+         br->AddItem(new PatchItem(fluid_sfont_get_id(curfont),
+-                                  fluid_preset_get_banknum(&preset),
+-                                  fluid_preset_get_num(&preset),
++                                  fluid_preset_get_banknum(preset),
++                                  fluid_preset_get_num(preset),
+                                   fluidchan,
+-                                  fluid_preset_get_name(&preset)));
++                                  fluid_preset_get_name(preset)));
+ 
+       if (i+1 < sfcnt) {
+         // End of soundfont- put in a divider
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/freewheeling.git/commitdiff/cfaed93c7648908b6e2c58e8704da35c9c65ef13



More information about the pld-cvs-commit mailing list