X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fmidi_mapper_util.h;fp=shared%2Fmidi_mapper_util.h;h=9120fc8719998f97575193e4e739c25aa7f65f58;hb=f1a8ab7eb34a89a104093c3931b1d51fcb2684e6;hp=07f2a53b4241dd7f69b71b62e12de93e83775659;hpb=686a02a3ffed47c099c1d91d95d0d90e222d297d;p=nageru diff --git a/shared/midi_mapper_util.h b/shared/midi_mapper_util.h index 07f2a53..9120fc8 100644 --- a/shared/midi_mapper_util.h +++ b/shared/midi_mapper_util.h @@ -49,7 +49,7 @@ inline bool match_bank_helper(const Proto &msg, int bank_field_number, int bank) // Find what MIDI note the given light (as given by field_number) is mapped to, and enable it. template -void activate_mapped_light(const Proto &msg, int field_number, std::map *active_lights) +void activate_mapped_light(const Proto &msg, int field_number, std::map *active_lights) { using namespace google::protobuf; const FieldDescriptor *descriptor = msg.GetDescriptor()->FindFieldByNumber(field_number); @@ -59,7 +59,8 @@ void activate_mapped_light(const Proto &msg, int field_number, std::map(reflection->GetMessage(msg, descriptor)); - active_lights->emplace(light_proto.note_number(), light_proto.velocity()); + active_lights->emplace(MIDIDevice::LightKey{MIDIDevice::LightKey::NOTE, unsigned(light_proto.note_number())}, + light_proto.velocity()); } inline double map_controller_to_float(int controller, int val)