diff options
Diffstat (limited to 'lv2/input_lv2.cc')
-rw-r--r-- | lv2/input_lv2.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lv2/input_lv2.cc b/lv2/input_lv2.cc index 23e2c78..f2efc5e 100644 --- a/lv2/input_lv2.cc +++ b/lv2/input_lv2.cc @@ -37,16 +37,9 @@ InputLV2::~InputLV2() { } -bool InputLV2::init(Instruments &instruments) +bool InputLV2::init(Instruments &i) { - MidiMapParser p(getenv("DRUMGIZMO_MIDIMAP")); - if(p.parse()) {/*return false;*/} - mmap.midimap = p.midimap; - - for(size_t i = 0; i < instruments.size(); i++) { - mmap.instrmap[instruments[i].name()] = i; - } - + instruments = &i; return true; } @@ -114,6 +107,17 @@ void InputLV2::post() { } +void InputLV2::loadMidiMap(std::string f) +{ + MidiMapParser p(f); + if(p.parse()) {/*return false;*/} + mmap.midimap = p.midimap; + + for(size_t i = 0; i < instruments->size(); i++) { + mmap.instrmap[(*instruments)[i]->name()] = i; + } +} + #ifdef TEST_INPUT_LV2 //Additional dependency files //deps: |