]> git.sesse.net Git - nageru/commitdiff
Split the MIDI mapping proto file in two; one that will be shared with Futatabi soon...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 8 Jan 2019 23:24:26 +0000 (00:24 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 8 Jan 2019 23:24:26 +0000 (00:24 +0100)
meson.build
nageru/mainwindow.cpp
nageru/midi_mapper.cpp
nageru/midi_mapping_dialog.cpp
nageru/nageru_midi_mapping.proto [moved from nageru/midi_mapping.proto with 93% similarity]
shared/meson.build
shared/midi_mapping.proto [new file with mode: 0644]

index 461c12559dc58dcfeb942203eda8b90d0d45319d..fa6d40f5967723352192b7579a90f26c1fc4ac47 100644 (file)
@@ -159,9 +159,9 @@ endif
 # Protobuf compilation.
 gen = generator(protoc, \
        output    : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
-       arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/nageru', '--cpp_out=@BUILD_DIR@', '@INPUT@'])
-proto_generated = gen.process(['nageru/state.proto', 'nageru/midi_mapping.proto', 'nageru/json.proto'])
-protobuf_lib = static_library('protobufs', proto_generated, dependencies: nageru_deps, include_directories: nageru_include_dirs)
+       arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/nageru', '--cpp_out=@BUILD_DIR@', '-I@CURRENT_SOURCE_DIR@/shared', '@INPUT@'])
+proto_generated = gen.process(['nageru/state.proto', 'nageru/json.proto', 'nageru/nageru_midi_mapping.proto'])
+protobuf_lib = static_library('nageru_protobufs', proto_generated, dependencies: nageru_deps, include_directories: nageru_include_dirs)
 protobuf_hdrs = declare_dependency(sources: proto_generated)
 nageru_link_with += protobuf_lib
 
index 61e775d51eb75cf329defd56d7c4b68fdabdc320..d436040f0cede55578b095a7d3eeea1f8a780142 100644 (file)
@@ -57,7 +57,7 @@
 #include "input_mapping.h"
 #include "input_mapping_dialog.h"
 #include "lrameter.h"
-#include "midi_mapping.pb.h"
+#include "nageru_midi_mapping.pb.h"
 #include "midi_mapping_dialog.h"
 #include "mixer.h"
 #include "nonlinear_fader.h"
index 7457fbb53f99082a292c5c8699e6fd01e28fd103..dac78f1773e8e3d1f0e60082f9888c51ff9e1a91 100644 (file)
@@ -19,7 +19,7 @@
 #include <thread>
 
 #include "audio_mixer.h"
-#include "midi_mapping.pb.h"
+#include "nageru_midi_mapping.pb.h"
 #include "shared/midi_mapper_util.h"
 #include "shared/text_proto.h"
 
index a3286b41dd3102d677661bc5efd465635181f8df..d099e688a8c266314c84342d557edb763926b6c6 100644 (file)
@@ -19,7 +19,7 @@
 #include <string>
 
 #include "midi_mapper.h"
-#include "midi_mapping.pb.h"
+#include "nageru_midi_mapping.pb.h"
 #include "shared/post_to_main_thread.h"
 #include "ui_midi_mapping.h"
 
similarity index 93%
rename from nageru/midi_mapping.proto
rename to nageru/nageru_midi_mapping.proto
index b3da1f057b0a6c70f8def5f84ae51e195db8e3a6..6eb8001ba4e00dd539297347aa50ebcb257780f0 100644 (file)
@@ -4,19 +4,7 @@
 
 syntax = "proto2";
 
-// A single, given controller mapping.
-message MIDIControllerProto {
-       required int32 controller_number = 1;
-       // TODO: Add flags like invert here if/when we need them.
-}
-
-message MIDIButtonProto {
-       required int32 note_number = 1;
-}
-
-message MIDILightProto {
-       required int32 note_number = 1;
-}
+import "midi_mapping.proto";
 
 // All the mappings for a given a bus.
 message MIDIMappingBusProto {
index 90711c02f1f17a8043e2be55fbcab61479894951..082e4f515ed305f771a1c9dec406ef6482870400 100644 (file)
@@ -10,7 +10,16 @@ qt_files = qt5.preprocess(
        ui_files: ['aboutdialog.ui'],
        dependencies: shared_qt5deps)
 
+# Protobuf compilation.
+gen = generator(protoc, \
+        output    : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
+        arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@'])
+proto_generated = gen.process(['midi_mapping.proto'])
+protobuf_lib = static_library('protobufs', proto_generated, dependencies: [protobufdep])
+protobuf_hdrs = declare_dependency(sources: proto_generated)
+
 srcs = ['memcpy_interleaved.cpp', 'metacube2.cpp', 'ffmpeg_raii.cpp', 'mux.cpp', 'metrics.cpp', 'context.cpp', 'httpd.cpp', 'disk_space_estimator.cpp', 'read_file.cpp', 'text_proto.cpp', 'midi_device.cpp']
+srcs += proto_generated
 
 # Qt objects.
 srcs += qt_files
@@ -18,8 +27,9 @@ srcs += ['aboutdialog.cpp']
 
 shared = static_library('shared', srcs, include_directories: top_include, dependencies: [shared_qt5deps, libmicrohttpddep, protobufdep, alsadep])
 shareddep = declare_dependency(
+   sources: proto_generated,
    include_directories: top_include,
-   link_with: shared)
+   link_with: [shared, protobuf_lib])
 
 bin2h = executable('bin2h', 'bin2h.cpp')
 bin2h_gen = generator(bin2h, \
diff --git a/shared/midi_mapping.proto b/shared/midi_mapping.proto
new file mode 100644 (file)
index 0000000..95ac590
--- /dev/null
@@ -0,0 +1,19 @@
+// Mappings from MIDI controllers to the UI. (We don't really build
+// a more complicated data structure than this in Nageru itself either;
+// we just edit and match directly against the protobuf.)
+
+syntax = "proto2";
+
+// A single, given controller mapping.
+message MIDIControllerProto {
+       required int32 controller_number = 1;
+       // TODO: Add flags like invert here if/when we need them.
+}
+
+message MIDIButtonProto {
+       required int32 note_number = 1;
+}
+
+message MIDILightProto {
+       required int32 note_number = 1;
+}