From d63ef52cfd1ca1867542471c3fce4ff5e47b1916 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 12 Jan 2012 16:29:31 +0100 Subject: Changed instrument list to containing pointers. --- lv2/input_lv2.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'lv2/input_lv2.cc') 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: -- cgit v1.2.3