X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fmidi_mapper.cpp;h=1d5d79e4ba85e9d9388f73bd94ecdc60d7840281;hb=9921f1fe12f5a7dadab7e84069fa8591d5c5663d;hp=93e367a77aa1ad0987c1a0f40e38372f90c0f14f;hpb=f1a8ab7eb34a89a104093c3931b1d51fcb2684e6;p=nageru diff --git a/futatabi/midi_mapper.cpp b/futatabi/midi_mapper.cpp index 93e367a..1d5d79e 100644 --- a/futatabi/midi_mapper.cpp +++ b/futatabi/midi_mapper.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -245,6 +246,15 @@ void MIDIMapper::update_lights_lock_held() activate_mapped_light(camera, CameraMIDIMappingProto::kIsCurrentFieldNumber, &active_lights); } + // Master speed light. + if (mapping_proto->has_master_speed_light()) { + unsigned controller = mapping_proto->master_speed_light().controller_number(); + unsigned min = mapping_proto->master_speed_light_min(); + unsigned max = mapping_proto->master_speed_light_max(); + int speed_light_value = lrintf((max - min) * current_speed / 2.0f) + min; + active_lights[MIDIDevice::LightKey{MIDIDevice::LightKey::CONTROLLER, controller}] = speed_light_value; + } + // These are always enabled right now. activate_mapped_light(*mapping_proto, MIDIMappingProto::kCueInEnabledFieldNumber, &active_lights); activate_mapped_light(*mapping_proto, MIDIMappingProto::kCueOutEnabledFieldNumber, &active_lights);