diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-05-15 17:36:41 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-05-15 17:36:41 +0200 |
commit | ceda77eb38f0b0824f03348f5291e3a42d8f7306 (patch) | |
tree | 16682304793c6eb75c8e1c6bb37dc6d468503b1a /src/drumkitparser.cc | |
parent | 9555c6e2734977c82023907f82a3ae82f845720a (diff) |
Add support for referenced files through refs.conf.
Diffstat (limited to 'src/drumkitparser.cc')
-rw-r--r-- | src/drumkitparser.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index 2c21c52..00232b2 100644 --- a/src/drumkitparser.cc +++ b/src/drumkitparser.cc @@ -32,10 +32,20 @@ #include "instrumentparser.h" #include "path.h" +#include "drumgizmo.h" -DrumKitParser::DrumKitParser(const std::string &kitfile, DrumKit &k) +DrumKitParser::DrumKitParser(const std::string &file, DrumKit &k) : kit(k) + , refs(REFSFILE) { + refs.load(); + + std::string kitfile = file; + + if(file.size() > 1 && file[0] == '@') { + kitfile = refs.getValue(file.substr(1)); + } + // instr = NULL; path = getPath(kitfile); @@ -45,7 +55,7 @@ DrumKitParser::DrumKitParser(const std::string &kitfile, DrumKit &k) if(!fd) return; - kit._file = kitfile; + kit._file = file; } DrumKitParser::~DrumKitParser() |