From d3c865ecd8c552d1e0de66f3497bad405b4b822e Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 23 Sep 2014 06:29:17 +0200 Subject: [PATCH] BSoftSynth: Also look for softsynth in B_SYSTEM_SETTINGS_DIRECTORY and B_SYNTH_DIRECTORY. Note that this will probably we changed again as we introduce a setting file to locate the softsynth. --- src/kits/midi/SoftSynth.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/kits/midi/SoftSynth.cpp b/src/kits/midi/SoftSynth.cpp index ac4190d7d7..bc9340bfa3 100644 --- a/src/kits/midi/SoftSynth.cpp +++ b/src/kits/midi/SoftSynth.cpp @@ -25,7 +25,7 @@ using namespace BPrivate; -const static char* kSynthFileName = "synth.sf2"; +const static char* kSynthFileName = "synth/synth.sf2"; struct ReverbSettings { double room, damp, width, level; @@ -105,7 +105,19 @@ BSoftSynth::SetDefaultInstrumentsFile() // in the user settings directory BPath path; if (find_directory(B_USER_SETTINGS_DIRECTORY, &path, false, NULL) == B_OK) { - path.Append("/synth/"); + path.Append(kSynthFileName); + if (BEntry(path.Path()).Exists()) + return SetInstrumentsFile(path.Path()); + } + + // Then in the system settings directory + if (find_directory(B_SYSTEM_SETTINGS_DIRECTORY, &path, false, NULL) == B_OK) { + path.Append(kSynthFileName); + if (BEntry(path.Path()).Exists()) + return SetInstrumentsFile(path.Path()); + } + + if (find_directory(B_SYNTH_DIRECTORY, &path, false, NULL) == B_OK) { path.Append(kSynthFileName); if (BEntry(path.Path()).Exists()) return SetInstrumentsFile(path.Path());