diff options
author | André Nusser <andre.nusser@googlemail.com> | 2019-10-26 19:11:03 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2019-10-26 20:04:01 +0200 |
commit | 85ce939590e9f60d51952b4cc1e6af6f9820ca28 (patch) | |
tree | 25b66ce7fbed77cb3b1d3e54065c03e67f31d125 /src/drumkitloader.cc | |
parent | 6ad9b9d2ae3341bbd4914f4951070a02d3dd4d2b (diff) |
Add default midimap functionality.
Move directory.{h,cc} to src/ for this.
Diffstat (limited to 'src/drumkitloader.cc')
-rw-r--r-- | src/drumkitloader.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index 91e3dd8..6a4c9f4 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -36,6 +36,7 @@ #include "dgxmlparser.h" #include "path.h" #include "domloader.h" +#include "directory.h" #define REFSFILE "refs.conf" @@ -218,6 +219,12 @@ bool DrumKitLoader::loadkit(const std::string& file) settings.drumkit_description = kit.getDescription(); settings.drumkit_version = kit.getVersion(); settings.drumkit_samplerate = kit.getSamplerate(); + // only load the default midi map if there is one and no midimap is selected yet + if (drumkitdom.metadata.default_midimap_file != "" && settings.midimap_file == "") + { + const std::string drumkit_path = Directory::pathDirectory(settings.drumkit_file); + settings.midimap_file = drumkit_path + "/" + drumkitdom.metadata.default_midimap_file; + } loadKitAudio(kit); |