#include "midi_mapper.h"
-#include "audio_mixer.h"
-#include "midi_mapping.pb.h"
-
#include <alsa/asoundlib.h>
-#include <google/protobuf/text_format.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/text_format.h>
+#include <poll.h>
+#include <stdint.h>
+#include <stdio.h>
#include <sys/eventfd.h>
-
+#include <unistd.h>
+#include <algorithm>
#include <functional>
#include <thread>
+#include "audio_mixer.h"
+#include "midi_mapping.pb.h"
+
using namespace google::protobuf;
using namespace std;
using namespace std::placeholders;
bind(&ControllerReceiver::toggle_compressor, receiver, _1));
match_button(note, MIDIMappingBusProto::kClearPeakFieldNumber, MIDIMappingProto::kClearPeakBankFieldNumber,
bind(&ControllerReceiver::clear_peak, receiver, _1));
+ match_button(note, MIDIMappingBusProto::kToggleMuteFieldNumber, MIDIMappingProto::kClearPeakBankFieldNumber,
+ bind(&ControllerReceiver::toggle_mute, receiver, _1));
match_button(note, MIDIMappingBusProto::kToggleLimiterFieldNumber, MIDIMappingProto::kToggleLimiterBankFieldNumber,
bind(&ControllerReceiver::toggle_limiter, receiver));
match_button(note, MIDIMappingBusProto::kToggleAutoMakeupGainFieldNumber, MIDIMappingProto::kToggleAutoMakeupGainBankFieldNumber,
bus_idx, MIDIMappingBusProto::kCompressorThresholdFieldNumber, MIDIMappingProto::kCompressorThresholdBankFieldNumber));
receiver->highlight_fader(bus_idx, has_active_controller(
bus_idx, MIDIMappingBusProto::kFaderFieldNumber, MIDIMappingProto::kFaderBankFieldNumber));
+ receiver->highlight_mute(bus_idx, has_active_controller(
+ bus_idx, MIDIMappingBusProto::kToggleMuteFieldNumber, MIDIMappingProto::kToggleMuteBankFieldNumber));
receiver->highlight_toggle_locut(bus_idx, has_active_controller(
bus_idx, MIDIMappingBusProto::kToggleLocutFieldNumber, MIDIMappingProto::kToggleLocutBankFieldNumber));
receiver->highlight_toggle_auto_gain_staging(bus_idx, has_active_controller(
}
unsigned num_buses = min<unsigned>(global_audio_mixer->num_buses(), mapping_proto->bus_mapping_size());
for (unsigned bus_idx = 0; bus_idx < num_buses; ++bus_idx) {
+ if (global_audio_mixer->get_mute(bus_idx)) {
+ activate_lights(bus_idx, MIDIMappingBusProto::kIsMutedFieldNumber, &active_lights);
+ }
if (global_audio_mixer->get_locut_enabled(bus_idx)) {
activate_lights(bus_idx, MIDIMappingBusProto::kLocutIsOnFieldNumber, &active_lights);
}