diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-01-12 16:29:31 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-01-12 16:29:31 +0100 |
commit | d63ef52cfd1ca1867542471c3fce4ff5e47b1916 (patch) | |
tree | 65238594e054114d25d5d82ae1e32d208abaa4d6 /lv2/input_lv2.cc | |
parent | 62bd868f56a00c0340a0d1e35626ffbef10f5db0 (diff) |
Changed instrument list to containing pointers.
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: |