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

(-)audio/lmms/Makefile (-2 / +1 lines)
Lines 3-10 Link Here
3
3
4
PORTNAME=	lmms
4
PORTNAME=	lmms
5
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
6
DISTVERSION=	1.2.0-rc7
6
DISTVERSION=	1.2.0-rc8
7
PORTREVISION=	3
8
PORTEPOCH=	2
7
PORTEPOCH=	2
9
CATEGORIES=	audio
8
CATEGORIES=	audio
10
9
(-)audio/lmms/distinfo (-3 / +3 lines)
Lines 1-6 Link Here
1
TIMESTAMP = 1540773254
1
TIMESTAMP = 1550559783
2
SHA256 (LMMS-lmms-v1.2.0-rc7_GH0.tar.gz) = 2efba2eda8ec3030ff6d446fd7bbe2245b38472f60c622b9e41053b1981fd592
2
SHA256 (LMMS-lmms-v1.2.0-rc8_GH0.tar.gz) = 4511687e47f6159cb2a250528bcccaa38b36b78f345466d090514214888943e8
3
SIZE (LMMS-lmms-v1.2.0-rc7_GH0.tar.gz) = 16120037
3
SIZE (LMMS-lmms-v1.2.0-rc8_GH0.tar.gz) = 16224112
4
SHA256 (rampantpixels-rpmalloc-1.3.1_GH0.tar.gz) = 9bc0013a0bf8c01540821e84fef0cef067f1d857a01ceceac36f83bd6fedc106
4
SHA256 (rampantpixels-rpmalloc-1.3.1_GH0.tar.gz) = 9bc0013a0bf8c01540821e84fef0cef067f1d857a01ceceac36f83bd6fedc106
5
SIZE (rampantpixels-rpmalloc-1.3.1_GH0.tar.gz) = 63517
5
SIZE (rampantpixels-rpmalloc-1.3.1_GH0.tar.gz) = 63517
6
SHA256 (lukas-w-qt5-x11embed-ec77d4ba40bebc0c53a016adb646b6fa65dd5faf_GH0.tar.gz) = 57213eb6da900412b182322e342366815c2cc2d3213cd948c2a7e405d6e41f06
6
SHA256 (lukas-w-qt5-x11embed-ec77d4ba40bebc0c53a016adb646b6fa65dd5faf_GH0.tar.gz) = 57213eb6da900412b182322e342366815c2cc2d3213cd948c2a7e405d6e41f06
(-)audio/lmms/files/patch-cmake_modules_BashCompletion.cmake (+13 lines)
Line 0 Link Here
1
BASHCOMP_SCRIPT doesn't really require bash.
2
3
--- cmake/modules/BashCompletion.cmake.orig	2019-02-19 07:43:51 UTC
4
+++ cmake/modules/BashCompletion.cmake
5
@@ -71,7 +71,7 @@ ELSE()
6
 		SET(BASHCOMP_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_${SCRIPT_NAME}_completion.sh")
7
 
8
 		FILE(WRITE ${BASHCOMP_SCRIPT} "\
9
-#!${BASH}\n\
10
+#!/bin/sh\n\
11
 set -e\n\
12
 if [ -w \"${BASHCOMP_PKG_PATH}\" ]; then\n\
13
   BASHCOMP_PKG_PATH=\"${BASHCOMP_PKG_PATH}\"\n\
(-)audio/lmms/files/patch-fluidsynth2 (-304 lines)
Lines 1-304 Link Here
1
From 1f7cd3ed5af6640c0e38a2dc2d9be5a9ae036dc8 Mon Sep 17 00:00:00 2001
2
From: Hyunjin Song <tteu.ingog@gmail.com>
3
Date: Sun, 28 Oct 2018 10:31:33 +0900
4
Subject: [PATCH] Allow building SF2 player with FluidSynth 2.x (#4678)
5
6
Resolves the incompatibility between FluidSynth 1.x and 2.x
7
due to some API changes by shimming some functions.
8
9
Note that 1.x and 2.x are not binary compatible.
10
--- plugins/sf2_player/fluidsynthshims.h.orig	2018-12-08 09:48:11 UTC
11
+++ plugins/sf2_player/fluidsynthshims.h
12
@@ -0,0 +1,88 @@
13
+/*
14
+ * fluidsynthshims.h - a shim header for FluidSynth 2.0 API changes
15
+ *
16
+ * Copyright (c) 2018 Hyunjin Song <tteu.ingog@gmail.com>
17
+ *
18
+ * This file is part of LMMS - https://lmms.io
19
+ *
20
+ * This program is free software; you can redistribute it and/or
21
+ * modify it under the terms of the GNU General Public
22
+ * License as published by the Free Software Foundation; either
23
+ * version 2 of the License, or (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
28
+ * General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public
31
+ * License along with this program (see COPYING); if not, write to the
32
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
33
+ * Boston, MA 02110-1301 USA.
34
+ *
35
+ */
36
+
37
+
38
+#ifndef FLUIDSYNTHSHIMS_H
39
+#define FLUIDSYNTHSHIMS_H
40
+
41
+#include <fluidsynth.h>
42
+
43
+#if FLUIDSYNTH_VERSION_MAJOR < 2
44
+
45
+inline const char* fluid_preset_get_name(fluid_preset_t* preset)
46
+{
47
+	return preset->get_name(preset);
48
+}
49
+
50
+inline int fluid_preset_get_banknum(fluid_preset_t* preset)
51
+{
52
+	return preset->get_banknum(preset);
53
+}
54
+
55
+inline int fluid_preset_get_num(fluid_preset_t* preset)
56
+{
57
+	return preset->get_num(preset);
58
+}
59
+
60
+inline fluid_sfont_t* fluid_preset_get_sfont(fluid_preset_t* preset)
61
+{
62
+	return preset->sfont;
63
+}
64
+
65
+inline char* fluid_sfont_get_name(fluid_sfont_t* sfont)
66
+{
67
+	return sfont->get_name(sfont);
68
+}
69
+
70
+inline void fluid_sfont_iteration_start(fluid_sfont_t* sfont)
71
+{
72
+	sfont->iteration_start(sfont);
73
+}
74
+
75
+// Due to the API change, we can't simply shim the 'fluid_sfont_iteration_next' function
76
+inline fluid_preset_t* fluid_sfont_iteration_next_wrapper(fluid_sfont_t* sfont, fluid_preset_t* preset)
77
+{
78
+	return sfont->iteration_next(sfont, preset) ? preset : nullptr;
79
+}
80
+
81
+#else // FLUIDSYNTH_VERSION_MAJOR < 2
82
+
83
+#define FLUID_REVERB_DEFAULT_ROOMSIZE 0.2f
84
+#define FLUID_REVERB_DEFAULT_DAMP 0.0f
85
+#define FLUID_REVERB_DEFAULT_WIDTH 0.5f
86
+#define FLUID_REVERB_DEFAULT_LEVEL 0.9f
87
+
88
+#define FLUID_CHORUS_DEFAULT_N 3
89
+#define FLUID_CHORUS_DEFAULT_LEVEL 2.0f
90
+#define FLUID_CHORUS_DEFAULT_SPEED 0.3f
91
+#define FLUID_CHORUS_DEFAULT_DEPTH 8.0f
92
+
93
+inline fluid_preset_t* fluid_sfont_iteration_next_wrapper(fluid_sfont_t* sfont, fluid_preset_t*)
94
+{
95
+	return fluid_sfont_iteration_next(sfont);
96
+}
97
+
98
+#endif // FLUIDSYNTH_VERSION_MAJOR < 2
99
+
100
+#endif // FLUIDSYNTHSHIMS_H
101
 plugins/sf2_player/fluidsynthshims.h  | 88 +++++++++++++++++++++++++++
102
 plugins/sf2_player/patches_dialog.cpp | 44 ++++++++------
103
 plugins/sf2_player/patches_dialog.h   |  2 +-
104
 plugins/sf2_player/sf2_player.cpp     | 43 ++++++++++---
105
 plugins/sf2_player/sf2_player.h       |  2 +-
106
 5 files changed, 152 insertions(+), 27 deletions(-)
107
 create mode 100644 plugins/sf2_player/fluidsynthshims.h
108
109
new file mode 100644
110
--- plugins/sf2_player/patches_dialog.cpp.orig	2018-09-25 07:47:51 UTC
111
+++ plugins/sf2_player/patches_dialog.cpp
112
@@ -143,7 +143,6 @@ void patchesDialog::setup ( fluid_synth_t * pSynth, in
113
 	m_iChan  = iChan;
114
 
115
 
116
-	fluid_preset_t preset;
117
 	QTreeWidgetItem *pBankItem = NULL;
118
 	// For all soundfonts (in reversed stack order) fill the available banks...
119
 	int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
120
@@ -151,11 +150,17 @@ void patchesDialog::setup ( fluid_synth_t * pSynth, in
121
 		fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i);
122
 		if (pSoundFont) {
123
 #ifdef CONFIG_FLUID_BANK_OFFSET
124
-			int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, pSoundFont->id);
125
+			int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, fluid_sfont_get_id(pSoundFont));
126
 #endif
127
-			pSoundFont->iteration_start(pSoundFont);
128
-			while (pSoundFont->iteration_next(pSoundFont, &preset)) {
129
-				int iBank = preset.get_banknum(&preset);
130
+			fluid_sfont_iteration_start(pSoundFont);
131
+#if FLUIDSYNTH_VERSION_MAJOR < 2
132
+			fluid_preset_t preset;
133
+			fluid_preset_t *pCurPreset = &preset;
134
+#else
135
+			fluid_preset_t *pCurPreset;
136
+#endif
137
+			while ((pCurPreset = fluid_sfont_iteration_next_wrapper(pSoundFont, pCurPreset))) {
138
+				int iBank = fluid_preset_get_banknum(pCurPreset);
139
 #ifdef CONFIG_FLUID_BANK_OFFSET
140
 				iBank += iBankOffset;
141
 #endif
142
@@ -173,9 +178,9 @@ void patchesDialog::setup ( fluid_synth_t * pSynth, in
143
 	m_iBank = 0;
144
 	fluid_preset_t *pPreset = ::fluid_synth_get_channel_preset(m_pSynth, m_iChan);
145
 	if (pPreset) {
146
-		m_iBank = pPreset->get_banknum(pPreset);
147
+		m_iBank = fluid_preset_get_banknum(pPreset);
148
 #ifdef CONFIG_FLUID_BANK_OFFSET
149
-		m_iBank += ::fluid_synth_get_bank_offset(m_pSynth, (pPreset->sfont)->id);
150
+		m_iBank += ::fluid_synth_get_bank_offset(m_pSynth, fluid_sfont_get_id(fluid_preset_get_sfont(sfont)));
151
 #endif
152
 	}
153
 
154
@@ -186,7 +191,7 @@ void patchesDialog::setup ( fluid_synth_t * pSynth, in
155
 
156
 	// Set the selected program.
157
 	if (pPreset)
158
-		m_iProg = pPreset->get_num(pPreset);
159
+		m_iProg = fluid_preset_get_num(pPreset);
160
 	QTreeWidgetItem *pProgItem = findProgItem(m_iProg);
161
 	m_progListView->setCurrentItem(pProgItem);
162
 	m_progListView->scrollToItem(pProgItem);
163
@@ -312,7 +317,6 @@ void patchesDialog::bankChanged (void)
164
 	// Clear up the program listview.
165
 	m_progListView->setSortingEnabled(false);
166
 	m_progListView->clear();
167
-	fluid_preset_t preset;
168
 	QTreeWidgetItem *pProgItem = NULL;
169
 	// For all soundfonts (in reversed stack order) fill the available programs...
170
 	int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
171
@@ -320,23 +324,29 @@ void patchesDialog::bankChanged (void)
172
 		fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i);
173
 		if (pSoundFont) {
174
 #ifdef CONFIG_FLUID_BANK_OFFSET
175
-			int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, pSoundFont->id);
176
+			int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, fluid_sfont_get_id(pSoundFont));
177
 #endif
178
-			pSoundFont->iteration_start(pSoundFont);
179
-			while (pSoundFont->iteration_next(pSoundFont, &preset)) {
180
-				int iBank = preset.get_banknum(&preset);
181
+			fluid_sfont_iteration_start(pSoundFont);
182
+#if FLUIDSYNTH_VERSION_MAJOR < 2
183
+			fluid_preset_t preset;
184
+			fluid_preset_t *pCurPreset = &preset;
185
+#else
186
+			fluid_preset_t *pCurPreset;
187
+#endif
188
+			while ((pCurPreset = fluid_sfont_iteration_next_wrapper(pSoundFont, pCurPreset))) {
189
+				int iBank = fluid_preset_get_banknum(pCurPreset);
190
 #ifdef CONFIG_FLUID_BANK_OFFSET
191
 				iBank += iBankOffset;
192
 #endif
193
-				int iProg = preset.get_num(&preset);
194
+				int iProg = fluid_preset_get_num(pCurPreset);
195
 				if (iBank == iBankSelected && !findProgItem(iProg)) {
196
 					pProgItem = new patchItem(m_progListView, pProgItem);
197
 					if (pProgItem) {
198
 						pProgItem->setText(0, QString::number(iProg));
199
-						pProgItem->setText(1, preset.get_name(&preset));
200
-						//pProgItem->setText(2, QString::number(pSoundFont->id));
201
+						pProgItem->setText(1, fluid_preset_get_name(pCurPreset));
202
+						//pProgItem->setText(2, QString::number(fluid_sfont_get_id(pSoundFont)));
203
 						//pProgItem->setText(3, QFileInfo(
204
-						//	pSoundFont->get_name(pSoundFont)).baseName());
205
+						//	fluid_sfont_get_name(pSoundFont).baseName());
206
 					}
207
 				}
208
 			}
209
--- plugins/sf2_player/patches_dialog.h.orig	2018-09-25 07:47:51 UTC
210
+++ plugins/sf2_player/patches_dialog.h
211
@@ -29,7 +29,7 @@
212
 #include "ui_patches_dialog.h"
213
 #include "LcdSpinBox.h"
214
 
215
-#include <fluidsynth.h>
216
+#include "fluidsynthshims.h"
217
 #include <QWidget>
218
 #include <QLabel>
219
 
220
--- plugins/sf2_player/sf2_player.cpp.orig	2018-09-25 07:47:51 UTC
221
+++ plugins/sf2_player/sf2_player.cpp
222
@@ -127,6 +127,29 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instr
223
 	// everytime we load a new soundfont.
224
 	m_synth = new_fluid_synth( m_settings );
225
 
226
+#if FLUIDSYNTH_VERSION_MAJOR >= 2
227
+	// Get the default values from the setting
228
+	double settingVal;
229
+
230
+	fluid_settings_getnum_default(m_settings, "synth.reverb.room-size", &settingVal);
231
+	m_reverbRoomSize.setInitValue(settingVal);
232
+	fluid_settings_getnum_default(m_settings, "synth.reverb.damping", &settingVal);
233
+	m_reverbDamping.setInitValue(settingVal);
234
+	fluid_settings_getnum_default(m_settings, "synth.reverb.width", &settingVal);
235
+	m_reverbWidth.setInitValue(settingVal);
236
+	fluid_settings_getnum_default(m_settings, "synth.reverb.level", &settingVal);
237
+	m_reverbLevel.setInitValue(settingVal);
238
+
239
+	fluid_settings_getnum_default(m_settings, "synth.chorus.nr", &settingVal);
240
+	m_chorusNum.setInitValue(settingVal);
241
+	fluid_settings_getnum_default(m_settings, "synth.chorus.level", &settingVal);
242
+	m_chorusLevel.setInitValue(settingVal);
243
+	fluid_settings_getnum_default(m_settings, "synth.chorus.speed", &settingVal);
244
+	m_chorusSpeed.setInitValue(settingVal);
245
+	fluid_settings_getnum_default(m_settings, "synth.chorus.depth", &settingVal);
246
+	m_chorusDepth.setInitValue(settingVal);
247
+#endif
248
+
249
 	loadFile( ConfigManager::inst()->defaultSoundfont() );
250
 
251
 	updateSampleRate();
252
@@ -392,7 +415,6 @@ QString sf2Instrument::getCurrentPatchName()
253
 	int iBankSelected = m_bankNum.value();
254
 	int iProgSelected = m_patchNum.value();
255
 
256
-	fluid_preset_t preset;
257
 	// For all soundfonts (in reversed stack order) fill the available programs...
258
 	int cSoundFonts = ::fluid_synth_sfcount( m_synth );
259
 	for( int i = 0; i < cSoundFonts; i++ )
260
@@ -403,21 +425,26 @@ QString sf2Instrument::getCurrentPatchName()
261
 #ifdef CONFIG_FLUID_BANK_OFFSET
262
 			int iBankOffset =
263
 				fluid_synth_get_bank_offset(
264
-						m_synth, pSoundFont->id );
265
+						m_synth, fluid_sfont_get_id(pSoundFont) );
266
 #endif
267
-			pSoundFont->iteration_start( pSoundFont );
268
-			while( pSoundFont->iteration_next( pSoundFont,
269
-								&preset ) )
270
+			fluid_sfont_iteration_start( pSoundFont );
271
+#if FLUIDSYNTH_VERSION_MAJOR < 2
272
+			fluid_preset_t preset;
273
+			fluid_preset_t *pCurPreset = &preset;
274
+#else
275
+			fluid_preset_t *pCurPreset;
276
+#endif
277
+			while ((pCurPreset = fluid_sfont_iteration_next_wrapper(pSoundFont, pCurPreset)))
278
 			{
279
-				int iBank = preset.get_banknum( &preset );
280
+				int iBank = fluid_preset_get_banknum( pCurPreset );
281
 #ifdef CONFIG_FLUID_BANK_OFFSET
282
 				iBank += iBankOffset;
283
 #endif
284
-				int iProg = preset.get_num( &preset );
285
+				int iProg = fluid_preset_get_num( pCurPreset );
286
 				if( iBank == iBankSelected && iProg ==
287
 								iProgSelected )
288
 				{
289
-					return preset.get_name( &preset );
290
+					return fluid_preset_get_name( pCurPreset );
291
 				}
292
 			}
293
 		}
294
--- plugins/sf2_player/sf2_player.h.orig	2018-09-25 07:47:51 UTC
295
+++ plugins/sf2_player/sf2_player.h
296
@@ -36,7 +36,7 @@
297
 #include "Knob.h"
298
 #include "LcdSpinBox.h"
299
 #include "LedCheckbox.h"
300
-#include "fluidsynth.h"
301
+#include "fluidsynthshims.h"
302
 #include "MemoryManager.h"
303
 
304
 class sf2InstrumentView;
(-)audio/lmms/pkg-plist (+2 lines)
Lines 272-277 Link Here
272
lib/libqx11embedcontainer.a
272
lib/libqx11embedcontainer.a
273
man/man1/lmms.1.gz
273
man/man1/lmms.1.gz
274
share/applications/lmms.desktop
274
share/applications/lmms.desktop
275
share/bash-completion/completions/lmms
275
share/icons/hicolor/128x128/apps/lmms.png
276
share/icons/hicolor/128x128/apps/lmms.png
276
share/icons/hicolor/128x128/mimetypes/application-x-lmms-project.png
277
share/icons/hicolor/128x128/mimetypes/application-x-lmms-project.png
277
share/icons/hicolor/128x128@2/apps/lmms.png
278
share/icons/hicolor/128x128@2/apps/lmms.png
Lines 312-317 Link Here
312
%%DATADIR%%/locale/fr.qm
313
%%DATADIR%%/locale/fr.qm
313
%%DATADIR%%/locale/gl.qm
314
%%DATADIR%%/locale/gl.qm
314
%%DATADIR%%/locale/hu_HU.qm
315
%%DATADIR%%/locale/hu_HU.qm
316
%%DATADIR%%/locale/id.qm
315
%%DATADIR%%/locale/it.qm
317
%%DATADIR%%/locale/it.qm
316
%%DATADIR%%/locale/ja.qm
318
%%DATADIR%%/locale/ja.qm
317
%%DATADIR%%/locale/ko.qm
319
%%DATADIR%%/locale/ko.qm

Return to bug 235854