aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/fluidsynth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'audio/softsynth/fluidsynth.cpp')
-rw-r--r--audio/softsynth/fluidsynth.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index 9b64d70f2b..860bf5b5cb 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -31,6 +31,9 @@
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
#include "audio/softsynth/emumidi.h"
+#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED)
+#include "backends/platform/ios7/ios7_common.h"
+#endif
#include <fluidsynth.h>
@@ -179,7 +182,18 @@ int MidiDriver_FluidSynth::open() {
const char *soundfont = ConfMan.get("soundfont").c_str();
+#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED)
+ // HACK: Due to the sandbox on non-jailbroken iOS devices, we need to deal
+ // with the chroot filesystem. All the path selected by the user are
+ // relative to the Document directory. So, we need to adjust the path to
+ // reflect that.
+ Common::String soundfont_fullpath = iOS7_getDocumentsDir();
+ soundfont_fullpath += soundfont;
+ _soundFont = fluid_synth_sfload(_synth, soundfont_fullpath.c_str(), 1);
+#else
_soundFont = fluid_synth_sfload(_synth, soundfont, 1);
+#endif
+
if (_soundFont == -1)
error("Failed loading custom sound font '%s'", soundfont);