-
Notifications
You must be signed in to change notification settings - Fork 4
/
schema.proto
225 lines (189 loc) · 5.79 KB
/
schema.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
syntax = "proto3";
import "nanopb.proto";
// wrapper for all messages
message Packet {
oneof content {
// Frames with pixel data.
Frame frame = 2;
WFrame w_frame = 3;
RGBFrame rgb_frame = 4;
// Frames with audio data
AudioFrame audio_frame = 5;
SynthFrame synth_frame = 10;
// Events from the input controllers
InputEvent input_event = 6;
InputLightEvent input_light_event = 15;
// Events around controlling apps
ControlEvent control_event = 9;
// ** Internal use only **
FirmwareConfig firmware_config = 1;
RGBFrame rgb_frame_part1 = 7;
RGBFrame rgb_frame_part2 = 8;
SoundToLightControlEvent sound_to_light_control_event = 11;
}
}
// Frame with one byte per pixel and an RGB palette that defines the colors.
message Frame {
bytes data = 1 [(nanopb).max_size = 640]; // Selects pixel colors from the palette. First pixel is top left. One panel after the other.
bytes palette = 2 [(nanopb).max_size = 192]; // Series of RGB values. 8bit per color.
uint32 easing_interval = 3; // Optional. In milliseconds. Fade this frame over the previous one with an easing curve. Colors are blended in gamma corrected RGB space.
}
// The same as the frame but with access to the white component in the palette (RGBW).
message WFrame {
bytes data = 1 [(nanopb).max_size = 640]; // Selects pixel colors from the palette. First pixel is top left. One panel after the other.
bytes palette = 2 [(nanopb).max_size = 256]; // Series of RGBW values. 8bit per color.
uint32 easing_interval = 3; // Optional. In milliseconds. Fade this frame over the previous one with an easing curve. Colors are blended in gamma corrected RGB space.
}
// Frame with 3 bytes per pixel (RGB) and no color palette
// not yet implemented
message RGBFrame {
bytes data = 1 [(nanopb).max_size = 1920]; // Series of RGB values. 8bit per color. First pixel is top left. One panel after the other.
uint32 easing_interval = 2; // Optional. In milliseconds. Fade this frame over the previous one with an easing curve. Colors are blended in gamma corrected RGB space.
}
message RGBWFrame {
bytes data = 1 [(nanopb).max_size = 2560]; // Series of RGBW values. 8bit per color. First pixel is top left. One panel after the other.
uint32 easing_interval = 2;
}
// AudioFrame with uri of the sample to be played and the channel number
message AudioFrame {
string uri = 1; // supports file://<path>, http(s)://<url> with .wav or .aiff files
uint32 channel = 2;
bool stop = 3; // stops playback on specified channel if true
}
enum SynthWaveform {
SINE = 0;
SAW = 1;
SQUARE = 2;
}
enum SynthFilterType {
BANDPASS = 0;
HIGHPASS = 1;
LOWPASS = 2;
}
message SynthAdsrConfig {
float attack = 1;
float decay = 2;
float sustain = 3;
float release = 4;
}
message SynthReverbConfig {
float room_size = 1;
float width = 2;
float damping = 3;
float freeze_mode = 4;
float wet_level = 5;
}
message SynthConfig {
SynthWaveform wave_form = 1;
float gain = 2;
SynthAdsrConfig adsr_config = 3;
SynthAdsrConfig filter_adsr_config = 4;
SynthFilterType filter_type = 5;
float cutoff = 6;
float resonance = 7;
SynthReverbConfig reverb_config = 8;
}
enum SynthEventType {
CONFIG = 0;
NOTE_ON = 1;
NOTE_OFF = 2;
}
message SynthFrame {
SynthEventType event_type = 1;
uint32 channel = 2;
uint32 note = 3;
float velocity = 4;
float duration_ms = 5;
SynthConfig config = 6;
}
message InputLightEvent {
InputType type = 1;
int32 duration = 2; // in milliseconds
}
message InputEvent {
InputType type = 1;
int32 value = 3; // 0 or 1 for buttons, -1 to 1 for directions
}
enum InputType {
BUTTON_1 = 0;
BUTTON_2 = 1;
BUTTON_3 = 2;
BUTTON_4 = 3;
BUTTON_5 = 4;
BUTTON_6 = 5;
BUTTON_7 = 6;
BUTTON_8 = 7;
BUTTON_9 = 8;
BUTTON_10 = 9;
AXIS_X_1 = 10;
AXIS_Y_1 = 11;
AXIS_X_2 = 12;
AXIS_Y_2 = 13;
BUTTON_A_1 = 14;
BUTTON_A_2 = 15;
BUTTON_MENU = 16;
}
message ControlEvent {
ControlEventType type = 1;
}
enum ControlEventType{
APP_SELECTED = 0; // Emitted by octopus when an app is displayed
APP_DESELECTED = 1; // Emitted by octopus when the app is no longer displayed
APP_STARTED = 2; // Emitted by apps when they start
APP_STOPPED = 3; // Emitted by apps when they are finished. Eg to signal that the next app can be selected.
}
message SoundToLightControlEvent {
float bass = 1;
float mid = 2;
float high = 3;
}
message FirmwareConfig {
uint32 luminance = 1;
EasingMode easing_mode = 2;
bool show_test_frame = 3;
uint32 config_phash = 4;
bool enable_calibration = 5;
}
enum EasingMode {
LINEAR = 0;
EASE_IN_QUAD = 1;
EASE_OUT_QUAD = 2;
EASE_IN_OUT_QUAD = 3;
EASE_IN_CUBIC = 4;
EASE_OUT_CUBIC = 5;
EASE_IN_OUT_CUBIC = 6;
EASE_IN_QUART = 7;
EASE_OUT_QUART = 8;
EASE_IN_OUT_QUART = 9;
EASE_IN_QUINT = 10;
EASE_OUT_QUINT = 11;
EASE_IN_OUT_QUINT = 12;
EASE_IN_EXPO = 13;
EASE_OUT_EXPO = 14;
EASE_IN_OUT_EXPO = 15;
}
// From Firmware to Octopus, internal use only
message FirmwarePacket {
oneof content {
FirmwareInfo firmware_info = 1;
RemoteLog remote_log = 2;
}
}
message FirmwareInfo {
string hostname = 1 [(nanopb).max_length = 20];
string build_time = 2 [(nanopb).max_length = 20];
uint32 panel_index = 3;
uint32 frames_per_second = 4;
uint32 config_phash = 5;
string mac = 6 [(nanopb).max_length = 17];
string ipv4 = 7 [(nanopb).max_length = 15];
string ipv6_local = 8 [(nanopb).max_length = 39];
string ipv6_global = 9 [(nanopb).max_length = 39];
uint32 packets_per_second = 10;
uint64 uptime = 11;
uint32 heap_size = 12;
uint32 free_heap = 13;
}
message RemoteLog {
string message = 1 [(nanopb).max_length = 100];
}