]> git.sesse.net Git - nageru/blobdiff - midi_mapper.cpp
Fix some missing targets in clean.
[nageru] / midi_mapper.cpp
index 8f43d21bc0de569ecf5d5ad28dcae765bca82cc8..4f8c33bf4ca25071f21e5e93f5a180159520fb41 100644 (file)
@@ -1,18 +1,25 @@
 #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;
@@ -38,7 +45,6 @@ MIDIMapper::MIDIMapper(ControllerReceiver *receiver)
 {
        should_quit_fd = eventfd(/*initval=*/0, /*flags=*/0);
        assert(should_quit_fd != -1);
-       refresh_highlights();
 }
 
 MIDIMapper::~MIDIMapper()
@@ -240,8 +246,6 @@ void MIDIMapper::handle_event(snd_seq_t *seq, snd_seq_event_t *event)
        lock_guard<mutex> lock(mu);
        switch (event->type) {
        case SND_SEQ_EVENT_CONTROLLER: {
-               printf("Controller %d changed to %d\n", event->data.control.param, event->data.control.value);
-
                const int controller = event->data.control.param;
                const float value = map_controller_to_float(event->data.control.value);
 
@@ -275,8 +279,6 @@ void MIDIMapper::handle_event(snd_seq_t *seq, snd_seq_event_t *event)
 
                receiver->note_on(note);
 
-               printf("Note: %d\n", note);
-
                for (size_t bus_idx = 0; bus_idx < size_t(mapping_proto->bus_mapping_size()); ++bus_idx) {
                        const MIDIMappingBusProto &bus_mapping = mapping_proto->bus_mapping(bus_idx);
                        if (bus_mapping.has_prev_bank() &&