]> git.sesse.net Git - nageru/blobdiff - futatabi/midi_mapper.cpp
Blink the lock light if dragging the speed slider when locked.
[nageru] / futatabi / midi_mapper.cpp
index d1cfea245178246031397a423625273a602c0cca..061dd2d8c7c3371875b623438a5ce66a26d8ab27 100644 (file)
@@ -16,6 +16,7 @@
 #include <unistd.h>
 #include <algorithm>
 #include <functional>
+#include <map>
 #include <thread>
 
 #include "defs.h"
@@ -205,7 +206,7 @@ void MIDIMapper::refresh_lights()
 
 void MIDIMapper::update_lights_lock_held()
 {
-       set<unsigned> active_lights;  // Desired state.
+       map<unsigned, uint8_t> active_lights;  // Desired state.
        if (current_controller_bank == 0) {
                activate_mapped_light(*mapping_proto, MIDIMappingProto::kBank1IsSelectedFieldNumber, &active_lights);
        }
@@ -230,8 +231,10 @@ void MIDIMapper::update_lights_lock_held()
        if (play_enabled_light) {
                activate_mapped_light(*mapping_proto, MIDIMappingProto::kPlayEnabledFieldNumber, &active_lights);
        }
-       if (locked_light) {
+       if (locked_light == On) {
                activate_mapped_light(*mapping_proto, MIDIMappingProto::kLockedFieldNumber, &active_lights);
+       } else if (locked_light == Blinking) {
+               activate_mapped_light(*mapping_proto, MIDIMappingProto::kLockedBlinkingFieldNumber, &active_lights);
        }
        if (current_highlighted_camera >= 0 && current_highlighted_camera < mapping_proto->camera_size()) {
                const CameraMIDIMappingProto &camera = mapping_proto->camera(current_highlighted_camera);