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/audioinputenginemidi.cc | |
parent | 9555c6e2734977c82023907f82a3ae82f845720a (diff) |
Add support for referenced files through refs.conf.
Diffstat (limited to 'src/audioinputenginemidi.cc')
-rw-r--r-- | src/audioinputenginemidi.cc | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/audioinputenginemidi.cc b/src/audioinputenginemidi.cc index 82cafbf..5494462 100644 --- a/src/audioinputenginemidi.cc +++ b/src/audioinputenginemidi.cc @@ -28,15 +28,24 @@ #include "midimapparser.h" +#include "drumgizmo.h" + #include <hugin.hpp> AudioInputEngineMidi::AudioInputEngineMidi() + : refs(REFSFILE) { + refs.load(); is_valid = false; } -bool AudioInputEngineMidi::loadMidiMap(std::string f, Instruments &instruments) +bool AudioInputEngineMidi::loadMidiMap(std::string _f, Instruments &instruments) { + std::string f = _f; + if(_f.size() > 1 && _f[0] == '@') { + f = refs.getValue(_f.substr(1)); + } + file = ""; is_valid = false; @@ -57,7 +66,7 @@ bool AudioInputEngineMidi::loadMidiMap(std::string f, Instruments &instruments) mmap.instrmap[instruments[i]->name()] = i; } - file = f; + file = _f; is_valid = true; return true; @@ -72,20 +81,3 @@ bool AudioInputEngineMidi::isValid() { return is_valid; } - -#ifdef TEST_AUDIOINPUTENGINEMIDI -//Additional dependency files -//deps: -//Required cflags (autoconf vars may be used) -//cflags: -//Required link options (autoconf vars may be used) -//libs: -#include "test.h" - -TEST_BEGIN; - -// TODO: Put some testcode here (see test.h for usable macros). - -TEST_END; - -#endif/*TEST_AUDIOINPUTENGINEMIDI*/ |