diff options
Diffstat (limited to 'src/midimapper.cc')
-rw-r--r-- | src/midimapper.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/midimapper.cc b/src/midimapper.cc index 12c1452..62b9d87 100644 --- a/src/midimapper.cc +++ b/src/midimapper.cc @@ -42,7 +42,7 @@ int MidiMapper::lookup(int note, int controller) return -1; } - if(controller >= 0 && midimultimap.count(note) > 1) + if(controller >= 0 && !controlthreshmap[note].empty()) { // find instrument where controller is above threshold with smallest distance to threshold int diff = 10000; @@ -62,13 +62,12 @@ int MidiMapper::lookup(int note, int controller) return instrmap_it->second; } -void MidiMapper::swap(instrmap_t& instrmap, midimap_t& midimap, midimultimap_t& midimultimap, controlthreshmap_t& controlthreshmap) +void MidiMapper::swap(instrmap_t& instrmap, midimap_t& midimap, controlthreshmap_t& controlthreshmap) { std::lock_guard<std::mutex> guard(mutex); std::swap(this->instrmap, instrmap); std::swap(this->midimap, midimap); - std::swap(this->midimultimap, midimultimap); std::swap(this->controlthreshmap, controlthreshmap); } |