From 19e58b4cc1a722459de3110b246ac637fa6cb0d9 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 2 Oct 2023 20:59:09 +0200 Subject: remove midimultimap since it is not needed and added some test code for hi-hat choke fixing --- src/midimapper.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/midimapper.cc') 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 guard(mutex); std::swap(this->instrmap, instrmap); std::swap(this->midimap, midimap); - std::swap(this->midimultimap, midimultimap); std::swap(this->controlthreshmap, controlthreshmap); } -- cgit v1.2.3