#include <functional>
#include <memory>
#include <mutex>
-#include <set>
#include <string>
#include <thread>
class MIDIMapper : public MIDIReceiver {
public:
+ // Converts conveniently from a bool.
+ enum LightState {
+ Off = 0,
+ On = 1,
+ Blinking = 2
+ };
+
MIDIMapper(ControllerReceiver *receiver);
virtual ~MIDIMapper();
void set_midi_mapping(const MIDIMappingProto &new_mapping);
void refresh_lights();
- void set_preview_enabled(bool enabled) {
+ void set_preview_enabled(LightState enabled) {
preview_enabled_light = enabled;
refresh_lights();
}
queue_enabled_light = enabled;
refresh_lights();
}
- void set_play_enabled(bool enabled) {
+ void set_play_enabled(LightState enabled) {
play_enabled_light = enabled;
refresh_lights();
}
- void set_locked(bool locked) {
+ void set_locked(LightState locked) {
locked_light = locked;
refresh_lights();
}
bool bank_mismatch(int bank_field_number);
void update_lights_lock_held();
- void activate_lights_all_buses(int field_number, std::set<unsigned> *active_lights);
std::atomic<bool> should_quit{false};
int should_quit_fd;
int num_controller_banks; // Under <mu>.
std::atomic<int> current_controller_bank{0};
- std::atomic<bool> preview_enabled_light{false};
+ std::atomic<LightState> preview_enabled_light{Off};
std::atomic<bool> queue_enabled_light{false};
- std::atomic<bool> play_enabled_light{false};
- std::atomic<bool> locked_light{true};
+ std::atomic<LightState> play_enabled_light{Off};
+ std::atomic<LightState> locked_light{On};
std::atomic<int> current_highlighted_camera{-1};
MIDIDevice midi_device;