// Find what MIDI note the given light (as given by field_number) is mapped to, and enable it.
template <class Proto>
-void activate_mapped_light(const Proto &msg, int field_number, std::map<unsigned, uint8_t> *active_lights)
+void activate_mapped_light(const Proto &msg, int field_number, std::map<MIDIDevice::LightKey, uint8_t> *active_lights)
{
using namespace google::protobuf;
const FieldDescriptor *descriptor = msg.GetDescriptor()->FindFieldByNumber(field_number);
}
const MIDILightProto &light_proto =
static_cast<const MIDILightProto &>(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)