[haiku-commits] haiku: hrev47897 - src/kits/midi

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 23 Sep 2014 06:40:43 +0200 (CEST)

hrev47897 adds 1 changeset to branch 'master'
old head: 3b7e5b40d08a7310098c01d0c4afc7b25c522822
new head: d3c865ecd8c552d1e0de66f3497bad405b4b822e
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=d3c865e+%5E3b7e5b4

----------------------------------------------------------------------------

d3c865e: 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.

                       [ Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47897
Commit:      d3c865ecd8c552d1e0de66f3497bad405b4b822e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d3c865e
Author:      Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
Date:        Tue Sep 23 04:29:17 2014 UTC

----------------------------------------------------------------------------

1 file changed, 14 insertions(+), 2 deletions(-)
src/kits/midi/SoftSynth.cpp | 16 ++++++++++++++--

----------------------------------------------------------------------------

diff --git a/src/kits/midi/SoftSynth.cpp b/src/kits/midi/SoftSynth.cpp
index ac4190d..bc9340b 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());


Other related posts:

  • » [haiku-commits] haiku: hrev47897 - src/kits/midi - stefano . ceccherini