diff options
author | Johannes Schickel | 2016-01-07 10:38:31 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-01-07 10:38:31 +0100 |
commit | bd1039b93ef3cb1541e9df91879c704aa894ddd9 (patch) | |
tree | 06aad88a939836932c53c27681507283376ad159 /audio/softsynth/fluidsynth.cpp | |
parent | cf5856492c6ce1820339dd76f9d3175f9f457215 (diff) | |
parent | b5ef98637c54a453a6f0ac0ca8c501ceb59924d5 (diff) | |
download | scummvm-rg350-bd1039b93ef3cb1541e9df91879c704aa894ddd9.tar.gz scummvm-rg350-bd1039b93ef3cb1541e9df91879c704aa894ddd9.tar.bz2 scummvm-rg350-bd1039b93ef3cb1541e9df91879c704aa894ddd9.zip |
Merge pull request #630 from bSr43/ios-fix
IOS: Fixes the iOS port
Diffstat (limited to 'audio/softsynth/fluidsynth.cpp')
-rw-r--r-- | audio/softsynth/fluidsynth.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp index 9b64d70f2b..4dc43499d3 100644 --- a/audio/softsynth/fluidsynth.cpp +++ b/audio/softsynth/fluidsynth.cpp @@ -31,6 +31,11 @@ #include "audio/musicplugin.h" #include "audio/mpu401.h" #include "audio/softsynth/emumidi.h" +#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED) +#include <string.h> +#include <sys/syslimits.h> +#include "backends/platform/ios7/ios7_common.h" +#endif #include <fluidsynth.h> @@ -179,7 +184,17 @@ 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); |