]> git.sesse.net Git - nageru/blob - midi_mapping.proto
Rename ui_foo.ui to foo.ui; seemingly, it is more standard.
[nageru] / midi_mapping.proto
1 // Mappings from MIDI controllers to the UI. (We don't really build
2 // a more complicated data structure than this in Nageru itself either;
3 // we just edit and match directly against the protobuf.)
4
5 syntax = "proto2";
6
7 // A single, given controller mapping.
8 message MIDIControllerProto {
9         required int32 controller_number = 1;
10         // TODO: Add flags like invert here if/when we need them.
11 }
12
13 message MIDIButtonProto {
14         required int32 note_number = 1;
15 }
16
17 message MIDILightProto {
18         required int32 note_number = 1;
19 }
20
21 // All the mappings for a given a bus.
22 message MIDIMappingBusProto {
23         // TODO: If we need support for lots of buses (i.e., more than the typical eight
24         // on a mixer), add a system for bus banks, like we have for controller banks.
25         // optional int32 bus_bank = 1;
26
27         optional MIDIControllerProto stereo_width = 37;
28         optional MIDIControllerProto treble = 2;
29         optional MIDIControllerProto mid = 3;
30         optional MIDIControllerProto bass = 4;
31         optional MIDIControllerProto gain = 5;
32         optional MIDIControllerProto compressor_threshold = 6;
33         optional MIDIControllerProto fader = 7;
34
35         optional MIDIButtonProto toggle_mute = 8;
36         optional MIDIButtonProto toggle_locut = 9;
37         optional MIDIButtonProto toggle_auto_gain_staging = 10;
38         optional MIDIButtonProto toggle_compressor = 11;
39         optional MIDIButtonProto clear_peak = 12;
40
41         // These are really global (controller bank change affects all buss),
42         // but it's not uncommon that we'd want one button per bus to switch banks.
43         // E.g., if the user binds the “mute” button to “next bank”, they'd want every
44         // mute button on the mixer to do that, so they need one mapping per bus.
45         optional MIDIButtonProto prev_bank = 13;
46         optional MIDIButtonProto next_bank = 14;
47         optional MIDIButtonProto select_bank_1 = 15;
48         optional MIDIButtonProto select_bank_2 = 16;
49         optional MIDIButtonProto select_bank_3 = 17;
50         optional MIDIButtonProto select_bank_4 = 18;
51         optional MIDIButtonProto select_bank_5 = 19;
52         optional MIDIButtonProto toggle_limiter = 20;
53         optional MIDIButtonProto toggle_auto_makeup_gain = 21;
54
55         // These are also global (they belong to the master bus), and unlike
56         // the bank change commands, one would usually have only one of each,
57         // but there's no reason to limit them to one each, and the editor UI
58         // becomes simpler if they are the treated the same way as the bank
59         // commands.
60         optional MIDIControllerProto locut = 22;
61         optional MIDIControllerProto limiter_threshold = 23;
62         optional MIDIControllerProto makeup_gain = 24;
63
64         // Per-bus lights.
65         optional MIDILightProto is_muted = 25;
66         optional MIDILightProto locut_is_on = 26;
67         optional MIDILightProto auto_gain_staging_is_on = 27;
68         optional MIDILightProto compressor_is_on = 28;
69         optional MIDILightProto has_peaked = 29;
70
71         // Global lights. Same logic as above for why they're in this proto.
72         optional MIDILightProto bank_1_is_selected = 30;
73         optional MIDILightProto bank_2_is_selected = 31;
74         optional MIDILightProto bank_3_is_selected = 32;
75         optional MIDILightProto bank_4_is_selected = 33;
76         optional MIDILightProto bank_5_is_selected = 34;
77         optional MIDILightProto limiter_is_on = 35;
78         optional MIDILightProto auto_makeup_gain_is_on = 36;
79 }
80
81 // The top-level protobuf, containing all the bus mappings, as well as
82 // more global settings.
83 //
84 // Since a typical mixer will have fewer physical controls than what Nageru
85 // could use, Nageru supports so-called controller banks. A mapping can
86 // optionally belong to a bank, and if so, that mapping is only active when
87 // that bank is selected. The user can then select the current bank using
88 // other mappings, typically by having some mixer button assigned to
89 // “next bank”. This yields effective multiplexing of lesser-used controls.
90 message MIDIMappingProto {
91         optional int32 num_controller_banks = 1 [default = 0];  // Max 5.
92
93         // Bus controller banks.
94         optional int32 stereo_width_bank = 19;
95         optional int32 treble_bank = 2;
96         optional int32 mid_bank = 3;
97         optional int32 bass_bank = 4;
98         optional int32 gain_bank = 5;
99         optional int32 compressor_threshold_bank = 6;
100         optional int32 fader_bank = 7;
101
102         // Bus button banks.
103         optional int32 toggle_mute_bank = 8;
104         optional int32 toggle_locut_bank = 9;
105         optional int32 toggle_auto_gain_staging_bank = 10;
106         optional int32 toggle_compressor_bank = 11;
107         optional int32 clear_peak_bank = 12;
108
109         // Global controller banks.
110         optional int32 locut_bank = 13;
111         optional int32 limiter_threshold_bank = 14;
112         optional int32 makeup_gain_bank = 15;
113
114         // Global buttons.
115         optional int32 toggle_limiter_bank = 16;
116         optional int32 toggle_auto_makeup_gain_bank = 17;
117
118         repeated MIDIMappingBusProto bus_mapping = 18;
119 }