summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2012-09-28 20:11:59 +0000
committerRobert Jonsson <spamatica@gmail.com>2012-09-28 20:11:59 +0000
commit6db72b766ea8bf781d0172a62f873104b2e7cab6 (patch)
treeefbf0901fba53081f4b3d76c580fe7dd648d27a8 /muse2
parentd0da68f0de3c5209c40b4d6d1277f6b942daf1af (diff)
load missing soundfonts from dialog
Diffstat (limited to 'muse2')
-rw-r--r--muse2/ChangeLog3
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp20
2 files changed, 22 insertions, 1 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index a22ef487..a8b29d58 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,6 @@
+29.09.2012:
+ - Added handling of missing soundfonts in fluidsynth load so
+ a dialog asking for replacement soundfont pops up (rj)
17.09.2012:
* Introducing: Copy On Write for waves. (Tim)
It asks to copy, to the Project Directory, any wave to be modified which is either
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index ab00606e..0fca4122 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -33,6 +33,7 @@
#include <iostream>
#include <QFileInfo>
+#include <QFileDialog>
//#include "common_defs.h"
#include "fluidsynti.h"
@@ -602,9 +603,26 @@ bool FluidSynth::pushSoundfont (const char* filename, int extid)
FS_Helper* helper = new FS_Helper;
helper->fptr = this;
- helper->filename = filename;
helper->id = extid;
+ if (QFile::exists(filename))
+ {
+ helper->filename = filename;
+ }
+ else
+ {
+
+ // TODO: Strings should be translated, this does
+ // however require the class to be derived from qobject
+ // tried in vain to make the call in the gui object
+ // could'nt get it to work due to symbol missing in .so ...
+ QString newName = QFileDialog::getOpenFileName(0,
+ QString("Can't find soundfont: %1 - Choose soundfont").arg(filename),
+ filename,
+ QString("Soundfonts (*.sf2);;All files (*)"));
+ helper->filename = newName.toStdString();
+ }
+
if (pthread_create(&fontThread, attributes, ::fontLoadThread, (void*) helper))
perror("creating thread failed:");