Skip to main content

mx_remote_ffi/
bits.rs

1// Author: Lars Op den Kamp (lars@opdenkamp-it.nl)
2// Copyright (c) 2026 Op den Kamp IT Solutions
3
4//! The names behind the words the API hands over as plain integers.
5//!
6//! A feature word, a status word and a key code all cross the boundary as the
7//! integer the wire carried, because firmware sets bits and sends values this
8//! library has no name for and folding those onto a known set would lose them.
9//! What a caller needs alongside is the names, so that every consumer does not
10//! end up keeping its own copy of each bit position - which is the drift these
11//! definitions exist to end.
12//!
13//! The values are spelled out rather than derived from the core crate's own
14//! constants: cbindgen transliterates a constant's expression into the header
15//! and cannot evaluate a call, so `DeviceFeature::IR_RX.bits()` would reach C
16//! as text it cannot compile. `constants_match_the_core_crate` in
17//! `tests/abi.rs` is what holds the two copies to the same values, and
18//! `every_core_bit_has_a_name_here` is what stops one being added on one side
19//! alone.
20
21use mx_remote::{BayStatus, MxrSignalType};
22
23use crate::abi::guard;
24
25/// The signal format a device reports, packed into one 16-bit word.
26///
27/// Read it with the `mxr_signal_type_*` functions rather than by shifting it
28/// directly: the bit depth in it is an index into a table rather than a depth,
29/// and two different encodings both mean "nothing configured".
30pub type mxr_signal_type_t = u16;
31
32// ---- what a device says it can do, in `mxr_device_info_t::features` ----
33
34/// Receives infrared.
35pub const MXR_FEATURE_IR_RX: u32 = 1 << 0;
36
37/// Transmits infrared.
38pub const MXR_FEATURE_IR_TX: u32 = 1 << 1;
39
40/// Speaks CEC.
41pub const MXR_FEATURE_CEC: u32 = 1 << 2;
42
43/// Acts as a OneIP stream source.
44pub const MXR_FEATURE_V2IP_SOURCE: u32 = 1 << 3;
45
46/// Acts as a OneIP stream sink.
47pub const MXR_FEATURE_V2IP_SINK: u32 = 1 << 4;
48
49/// Routes video.
50pub const MXR_FEATURE_VIDEO_ROUTING: u32 = 1 << 5;
51
52/// Routes audio.
53pub const MXR_FEATURE_AUDIO_ROUTING: u32 = 1 << 6;
54
55/// Controls volume.
56pub const MXR_FEATURE_VOLUME_CONTROL: u32 = 1 << 7;
57
58/// Supports audio return.
59pub const MXR_FEATURE_AUDIO_RETURN: u32 = 1 << 8;
60
61/// Passes remote-control commands through.
62pub const MXR_FEATURE_REMOTE_CONTROL: u32 = 1 << 9;
63
64/// Installer setup has been completed.
65pub const MXR_FEATURE_SETUP_COMPLETED: u32 = 1 << 10;
66
67/// Is the master of its mesh.
68pub const MXR_FEATURE_MESH_MASTER: u32 = 1 << 11;
69
70/// Has a notification pending.
71pub const MXR_FEATURE_STATUS_NOTIFY: u32 = 1 << 12;
72
73/// Has a warning pending.
74pub const MXR_FEATURE_STATUS_WARNING: u32 = 1 << 13;
75
76/// Has an error pending.
77pub const MXR_FEATURE_STATUS_ERROR: u32 = 1 << 14;
78
79/// Is about to reboot.
80pub const MXR_FEATURE_STATUS_REBOOT: u32 = 1 << 15;
81
82/// Is a member of a mesh.
83pub const MXR_FEATURE_MESH_MEMBER: u32 = 1 << 16;
84
85/// Is an audio amplifier.
86pub const MXR_FEATURE_AUDIO_AMPLIFIER: u32 = 1 << 17;
87
88/// Is still booting.
89pub const MXR_FEATURE_BOOTING: u32 = 1 << 18;
90
91/// Is a management client rather than a device.
92pub const MXR_FEATURE_MANAGER: u32 = 1 << 19;
93
94/// Is in power-save mode.
95pub const MXR_FEATURE_STATUS_POWER_SAVE: u32 = 1 << 20;
96
97/// Supports meshing.
98pub const MXR_FEATURE_MESH: u32 = 1 << 21;
99
100/// Is a multiviewer.
101pub const MXR_FEATURE_MULTIVIEWER: u32 = 1 << 22;
102
103/// Has crashed since it last booted.
104pub const MXR_FEATURE_STATUS_CRASHED: u32 = 1 << 23;
105
106/// Supports video walls.
107pub const MXR_FEATURE_VIDEO_WALL: u32 = 1 << 24;
108
109/// Initialises the configuration it broadcasts.
110///
111/// Firmware without this bit sends a device configuration built over
112/// uninitialised memory, so fields it did not mean to write carry junk.
113pub const MXR_FEATURE_CONFIG_INITIALISED: u32 = 1 << 25;
114
115/// Receives one or more peers only by broadcast, because its multicast receive
116/// path is faulty.
117pub const MXR_FEATURE_STATUS_MCAST_FAULT: u32 = 1 << 26;
118
119/// Powers its video processor down in power save. A device without it refuses
120/// to enter power save.
121pub const MXR_FEATURE_POWER_SAVE: u32 = 1 << 27;
122
123/// Tags its uplink by the VLAN configuration it reports, and takes one written
124/// to it.
125pub const MXR_FEATURE_VLAN: u32 = 1 << 28;
126
127/// Copies the overlay settings and logos of another unit when asked.
128pub const MXR_FEATURE_OSD_SYNC: u32 = 1 << 29;
129
130/// Is downloading or installing a firmware or video processor upgrade.
131/// `MXR_FEATURE_STATUS_REBOOT` follows when it reboots to complete it.
132pub const MXR_FEATURE_STATUS_UPGRADING: u32 = 1 << 30;
133
134/// Flips on every reboot, so a peer that sees it change knows the device restarted.
135pub const MXR_FEATURE_BOOT_BIT: u32 = 1 << 31;
136
137// ---- what a bay is wired for, in `mxr_bay_info_t::features` ----
138
139/// HDMI output.
140pub const MXR_BAY_HDMI_OUT: u32 = 1 << 0;
141
142/// HDMI input.
143pub const MXR_BAY_HDMI_IN: u32 = 1 << 1;
144
145/// Digital audio output.
146pub const MXR_BAY_AUDIO_DIG_OUT: u32 = 1 << 2;
147
148/// Digital audio input.
149pub const MXR_BAY_AUDIO_DIG_IN: u32 = 1 << 3;
150
151/// Analogue audio output.
152pub const MXR_BAY_AUDIO_ANA_OUT: u32 = 1 << 4;
153
154/// Analogue audio input.
155pub const MXR_BAY_AUDIO_ANA_IN: u32 = 1 << 5;
156
157/// Infrared input.
158pub const MXR_BAY_IR_IN: u32 = 1 << 6;
159
160/// Infrared output.
161pub const MXR_BAY_IR_OUT: u32 = 1 << 7;
162
163/// Amplified audio output.
164pub const MXR_BAY_AUDIO_AMP_OUT: u32 = 1 << 8;
165
166/// Remote-control output.
167pub const MXR_BAY_RC_OUT: u32 = 1 << 9;
168
169/// Remote-control input.
170pub const MXR_BAY_RC_IN: u32 = 1 << 10;
171
172/// Dolby decoding.
173pub const MXR_BAY_DOLBY: u32 = 1 << 11;
174
175/// Switches itself off when idle.
176pub const MXR_BAY_AUTO_OFF: u32 = 1 << 12;
177
178/// Is a remote OneIP source.
179pub const MXR_BAY_V2IP_SOURCE_REMOTE: u32 = 1 << 13;
180
181/// Is a remote OneIP sink.
182pub const MXR_BAY_V2IP_SINK_REMOTE: u32 = 1 << 14;
183
184/// Is a local OneIP source.
185pub const MXR_BAY_V2IP_SOURCE_LOCAL: u32 = 1 << 15;
186
187/// Is a local OneIP sink.
188pub const MXR_BAY_V2IP_SINK_LOCAL: u32 = 1 << 16;
189
190// ---- the live status of a bay, in `mxr_signal_details_t::status` ----
191//
192// Bits 16-19 and 22-23 are bit-fields rather than flags. Read them with
193// `mxr_bay_status_rc_type()` and `mxr_bay_status_hdcp()`.
194
195/// The bay reports a fault.
196pub const MXR_BAY_STATUS_FAULT: u32 = 1 << 0;
197
198/// The bay is hidden from the user interface.
199pub const MXR_BAY_STATUS_HIDDEN: u32 = 1 << 1;
200
201/// The amplifier zone the bay drives is powered on.
202pub const MXR_BAY_STATUS_POWERED: u32 = 1 << 2;
203
204/// A signal is present.
205pub const MXR_BAY_STATUS_SIGNAL_DETECTED: u32 = 1 << 3;
206
207/// Hot-plug detect is asserted.
208pub const MXR_BAY_STATUS_HPD_DETECTED: u32 = 1 << 4;
209
210/// The signal is scrambled.
211pub const MXR_BAY_STATUS_SIGNAL_SCRAMBLE: u32 = 1 << 5;
212
213/// An HDBaseT link is up.
214pub const MXR_BAY_STATUS_HDBT_CONNECTED: u32 = 1 << 6;
215
216/// A CEC device answered.
217pub const MXR_BAY_STATUS_CEC_DETECTED: u32 = 1 << 7;
218
219/// The attached device was powered on.
220pub const MXR_BAY_STATUS_POWERED_ON: u32 = 1 << 8;
221
222/// The attached device was powered off.
223pub const MXR_BAY_STATUS_POWERED_OFF: u32 = 1 << 9;
224
225/// Audio return over HDMI is active.
226pub const MXR_BAY_STATUS_AUDIO_ARC_HDMI: u32 = 1 << 10;
227
228/// Audio return over optical is active.
229pub const MXR_BAY_STATUS_AUDIO_ARC_OPTIC: u32 = 1 << 11;
230
231/// Audio return over analogue is active.
232pub const MXR_BAY_STATUS_AUDIO_ARC_ANALOG: u32 = 1 << 12;
233
234/// The bay is offline.
235pub const MXR_BAY_STATUS_OFFLINE: u32 = 1 << 13;
236
237/// The OneIP decoder is disabled.
238pub const MXR_BAY_STATUS_DECODER_DISABLE: u32 = 1 << 14;
239
240/// The OneIP encoder is disabled.
241pub const MXR_BAY_STATUS_ENCODER_DISABLE: u32 = 1 << 15;
242
243/// CEC is switched off for this bay.
244pub const MXR_BAY_STATUS_CEC_DISABLED: u32 = 1 << 20;
245
246/// The OneIP encoder reports an error.
247pub const MXR_BAY_STATUS_ENCODER_ERROR: u32 = 1 << 21;
248
249/// The bay's name was generated - a default, or taken from CEC or the EDID -
250/// rather than set by a user. A device that predates this bit never sets it,
251/// so a clear bit does not prove a user set the name.
252pub const MXR_BAY_STATUS_AUTO_NAME: u32 = 1 << 24;
253
254// ---- what an audio endpoint can do, in `mxr_audio_endpoint_t::features` ----
255
256/// Accepts audio.
257pub const MXR_AUDIO_INPUT: u32 = 1 << 0;
258
259/// Produces audio.
260pub const MXR_AUDIO_OUTPUT: u32 = 1 << 1;
261
262/// Sends a OneIP audio stream.
263pub const MXR_AUDIO_V2IP_TX: u32 = 1 << 2;
264
265/// Receives a OneIP audio stream.
266pub const MXR_AUDIO_V2IP_RX: u32 = 1 << 3;
267
268/// Carries HDMI audio.
269pub const MXR_AUDIO_HDMI: u32 = 1 << 4;
270
271/// Is an analogue RCA connector.
272pub const MXR_AUDIO_RCA: u32 = 1 << 5;
273
274/// Is an S/PDIF connector.
275pub const MXR_AUDIO_SPDIF: u32 = 1 << 6;
276
277/// Drives a trigger output.
278pub const MXR_AUDIO_TRIGGER: u32 = 1 << 7;
279
280/// Can be muted.
281pub const MXR_AUDIO_MUTE: u32 = 1 << 8;
282
283/// Can be routed to as an input.
284pub const MXR_AUDIO_ROUTE_INPUT: u32 = 1 << 9;
285
286/// Can be routed from as an output.
287pub const MXR_AUDIO_ROUTE_OUTPUT: u32 = 1 << 10;
288
289/// Accepts "no input" as a route.
290pub const MXR_AUDIO_ROUTE_IN_NONE: u32 = 1 << 11;
291
292/// Is an amplifier output.
293pub const MXR_AUDIO_AMP_OUTPUT: u32 = 1 << 12;
294
295/// Has a volume control.
296pub const MXR_AUDIO_VOLUME_CONTROL: u32 = 1 << 13;
297
298/// Has a gain control.
299pub const MXR_AUDIO_GAIN_CONTROL: u32 = 1 << 14;
300
301/// Keeps its audio source when the video route changes, while locked.
302pub const MXR_AUDIO_AUDIO_LOCK: u32 = 1 << 15;
303
304// ---- remote-control keys, for `mxr_send_key()` ----
305//
306// A key above the last named here is sent as it is given: the range from
307// `MXR_KEY_CUSTOM_CEC` carries a raw CEC user-control code and the one from
308// `MXR_KEY_CUSTOM_SKY` a raw Sky code, each as the base plus the code.
309
310/// Digit 0.
311pub const MXR_KEY_NUM0: u16 = 0;
312
313/// Digit 1.
314pub const MXR_KEY_NUM1: u16 = 1;
315
316/// Digit 2.
317pub const MXR_KEY_NUM2: u16 = 2;
318
319/// Digit 3.
320pub const MXR_KEY_NUM3: u16 = 3;
321
322/// Digit 4.
323pub const MXR_KEY_NUM4: u16 = 4;
324
325/// Digit 5.
326pub const MXR_KEY_NUM5: u16 = 5;
327
328/// Digit 6.
329pub const MXR_KEY_NUM6: u16 = 6;
330
331/// Digit 7.
332pub const MXR_KEY_NUM7: u16 = 7;
333
334/// Digit 8.
335pub const MXR_KEY_NUM8: u16 = 8;
336
337/// Digit 9.
338pub const MXR_KEY_NUM9: u16 = 9;
339
340/// Confirm the highlighted item.
341pub const MXR_KEY_SELECT: u16 = 10;
342
343/// Go back one step.
344pub const MXR_KEY_BACK: u16 = 11;
345
346/// Navigate up.
347pub const MXR_KEY_UP: u16 = 12;
348
349/// Navigate down.
350pub const MXR_KEY_DOWN: u16 = 13;
351
352/// Navigate left.
353pub const MXR_KEY_LEFT: u16 = 14;
354
355/// Navigate right.
356pub const MXR_KEY_RIGHT: u16 = 15;
357
358/// Open the main menu.
359pub const MXR_KEY_MENU: u16 = 16;
360
361/// Open the content menu.
362pub const MXR_KEY_CONTENT_MENU: u16 = 17;
363
364/// Next channel.
365pub const MXR_KEY_CHANNEL_UP: u16 = 18;
366
367/// Previous channel.
368pub const MXR_KEY_CHANNEL_DOWN: u16 = 19;
369
370/// Start playback.
371pub const MXR_KEY_PLAY: u16 = 20;
372
373/// Pause playback.
374pub const MXR_KEY_PAUSE: u16 = 21;
375
376/// Stop playback.
377pub const MXR_KEY_STOP: u16 = 22;
378
379/// Start recording.
380pub const MXR_KEY_RECORD: u16 = 23;
381
382/// Fast forward.
383pub const MXR_KEY_FAST_FORWARD: u16 = 24;
384
385/// Rewind.
386pub const MXR_KEY_REWIND: u16 = 25;
387
388/// Red colour key.
389pub const MXR_KEY_RED: u16 = 26;
390
391/// Green colour key.
392pub const MXR_KEY_GREEN: u16 = 27;
393
394/// Yellow colour key.
395pub const MXR_KEY_YELLOW: u16 = 28;
396
397/// Blue colour key.
398pub const MXR_KEY_BLUE: u16 = 29;
399
400/// Open help.
401pub const MXR_KEY_HELP: u16 = 30;
402
403/// Show information.
404pub const MXR_KEY_INFORMATION: u16 = 31;
405
406/// Open teletext.
407pub const MXR_KEY_TEXT: u16 = 32;
408
409/// Open the programme guide.
410pub const MXR_KEY_GUIDE: u16 = 33;
411
412/// Open video on demand.
413pub const MXR_KEY_VIDEO_ON_DEMAND: u16 = 34;
414
415/// Return to the previous channel.
416pub const MXR_KEY_PREVIOUS_CHANNEL: u16 = 80;
417
418/// Toggle 3D mode.
419pub const MXR_KEY_MODE_3D: u16 = 81;
420
421/// Toggle subtitles.
422pub const MXR_KEY_SUBTITLE: u16 = 82;
423
424/// Select an audio track.
425pub const MXR_KEY_SOUND_SELECT: u16 = 83;
426
427/// Select an input.
428pub const MXR_KEY_INPUT_SELECT: u16 = 84;
429
430/// Eject the medium.
431pub const MXR_KEY_EJECT: u16 = 85;
432
433/// Next chapter.
434pub const MXR_KEY_NEXT_CHAPTER: u16 = 86;
435
436/// Previous chapter.
437pub const MXR_KEY_PREV_CHAPTER: u16 = 87;
438
439/// Open interactive services.
440pub const MXR_KEY_INTERACTIVE: u16 = 128;
441
442/// Open search.
443pub const MXR_KEY_SEARCH: u16 = 129;
444
445/// Sky home key.
446pub const MXR_KEY_SKY: u16 = 130;
447
448/// Base of the range carrying a raw CEC user-control code.
449pub const MXR_KEY_CUSTOM_CEC: u16 = 1280;
450
451/// Base of the range carrying a raw Sky key code.
452pub const MXR_KEY_CUSTOM_SKY: u16 = 2048;
453
454// ---- multiviewer settings, for the `mxr_set_multiviewer_*` calls ----
455//
456// The same values come back in `mxr_multiviewer_status_t`, whose fields are
457// the wire's bytes rather than a decoded set: a multiviewer running firmware
458// newer than this library reports a mode named here by none of these, and
459// passing it through is what lets a caller see it at all.
460
461/// The multiviewer reports no window layout.
462pub const MXR_MV_VIEW_MODE_UNKNOWN: u8 = 0;
463
464/// One full-screen window.
465pub const MXR_MV_VIEW_MODE_SINGLE: u8 = 1;
466
467/// Picture in picture.
468pub const MXR_MV_VIEW_MODE_PIP: u8 = 2;
469
470/// Two windows, large.
471pub const MXR_MV_VIEW_MODE_TWO_SCREEN_LARGE: u8 = 3;
472
473/// Two windows, small.
474pub const MXR_MV_VIEW_MODE_TWO_SCREEN_SMALL: u8 = 4;
475
476/// Three windows, large.
477pub const MXR_MV_VIEW_MODE_THREE_SCREEN_LARGE: u8 = 5;
478
479/// Three windows, small.
480pub const MXR_MV_VIEW_MODE_THREE_SCREEN_SMALL: u8 = 6;
481
482/// Four windows, equal size.
483pub const MXR_MV_VIEW_MODE_FOUR_SCREEN_EQUAL: u8 = 7;
484
485/// Four windows, small.
486pub const MXR_MV_VIEW_MODE_FOUR_SCREEN_SMALL: u8 = 8;
487
488/// The multiviewer reports no picture-in-picture position.
489pub const MXR_MV_PIP_POSITION_UNKNOWN: u8 = 0;
490
491/// Top left.
492pub const MXR_MV_PIP_POSITION_LEFT_TOP: u8 = 1;
493
494/// Bottom left.
495pub const MXR_MV_PIP_POSITION_LEFT_BOTTOM: u8 = 2;
496
497/// Top right.
498pub const MXR_MV_PIP_POSITION_RIGHT_TOP: u8 = 3;
499
500/// Bottom right.
501pub const MXR_MV_PIP_POSITION_RIGHT_BOTTOM: u8 = 4;
502
503/// The multiviewer reports no picture-in-picture size.
504pub const MXR_MV_PIP_SIZE_UNKNOWN: u8 = 0;
505
506/// Small.
507pub const MXR_MV_PIP_SIZE_SMALL: u8 = 1;
508
509/// Medium.
510pub const MXR_MV_PIP_SIZE_MEDIUM: u8 = 2;
511
512/// Large.
513pub const MXR_MV_PIP_SIZE_LARGE: u8 = 3;
514
515/// The multiviewer reports no output mode.
516pub const MXR_MV_OUTPUT_UNKNOWN: u8 = 0;
517
518/// 4096x2160p60.
519pub const MXR_MV_OUTPUT_DCI4K_P60: u8 = 1;
520
521/// 4096x2160p50.
522pub const MXR_MV_OUTPUT_DCI4K_P50: u8 = 2;
523
524/// 3840x2160p60.
525pub const MXR_MV_OUTPUT_UHD_P60: u8 = 3;
526
527/// 3840x2160p50.
528pub const MXR_MV_OUTPUT_UHD_P50: u8 = 4;
529
530/// 3840x2160p30.
531pub const MXR_MV_OUTPUT_UHD_P30: u8 = 5;
532
533/// 3840x2160p25.
534pub const MXR_MV_OUTPUT_UHD_P25: u8 = 6;
535
536/// 1920x1200p60, reduced blanking.
537pub const MXR_MV_OUTPUT_WUXGA_P60_RB: u8 = 7;
538
539/// 1920x1080p60.
540pub const MXR_MV_OUTPUT_HD1080_P60: u8 = 8;
541
542/// 1920x1080p50.
543pub const MXR_MV_OUTPUT_HD1080_P50: u8 = 9;
544
545/// 1360x768p60.
546pub const MXR_MV_OUTPUT_WXGA_P60: u8 = 10;
547
548/// 1280x800p60.
549pub const MXR_MV_OUTPUT_WXGA800_P60: u8 = 11;
550
551/// 1280x720p60.
552pub const MXR_MV_OUTPUT_HD720_P60: u8 = 12;
553
554/// 1280x720p50.
555pub const MXR_MV_OUTPUT_HD720_P50: u8 = 13;
556
557/// 1024x768p60.
558pub const MXR_MV_OUTPUT_XGA_P60: u8 = 14;
559
560/// The multiviewer reports no HDCP mode.
561pub const MXR_MV_HDCP_UNKNOWN: u8 = 0;
562
563/// HDCP 1.4.
564pub const MXR_MV_HDCP_V14: u8 = 1;
565
566/// HDCP 2.2.
567pub const MXR_MV_HDCP_V22: u8 = 2;
568
569/// Content protection off.
570pub const MXR_MV_HDCP_OFF: u8 = 3;
571
572/// The multiviewer reports no EDID template.
573pub const MXR_MV_EDID_UNKNOWN: u8 = 0;
574
575/// 4K2K60 4:4:4, stereo 2.0.
576pub const MXR_MV_EDID_4K2K60_444_STEREO: u8 = 1;
577
578/// 4K2K60 4:4:4, Dolby/DTS 5.1.
579pub const MXR_MV_EDID_4K2K60_444_DOLBY_DTS_51: u8 = 2;
580
581/// 4K2K60 4:4:4, HD audio 7.1.
582pub const MXR_MV_EDID_4K2K60_444_HD_AUDIO_71: u8 = 3;
583
584/// 4K2K30 4:4:4, stereo 2.0.
585pub const MXR_MV_EDID_4K2K30_444_STEREO: u8 = 4;
586
587/// 4K2K30 4:4:4, Dolby/DTS 5.1.
588pub const MXR_MV_EDID_4K2K30_444_DOLBY_DTS_51: u8 = 5;
589
590/// 4K2K30 4:4:4, HD audio 7.1.
591pub const MXR_MV_EDID_4K2K30_444_HD_AUDIO_71: u8 = 6;
592
593/// 1080p, stereo 2.0.
594pub const MXR_MV_EDID_1080P_STEREO: u8 = 7;
595
596/// 1080p, Dolby/DTS 5.1.
597pub const MXR_MV_EDID_1080P_DOLBY_DTS_51: u8 = 8;
598
599/// 1080p, HD audio 7.1.
600pub const MXR_MV_EDID_1080P_HD_AUDIO_71: u8 = 9;
601
602/// 1920x1200, stereo 2.0.
603pub const MXR_MV_EDID_1920X1200_STEREO: u8 = 10;
604
605/// 1680x1050, stereo 2.0.
606pub const MXR_MV_EDID_1680X1050_STEREO: u8 = 11;
607
608/// 1600x1200, stereo 2.0.
609pub const MXR_MV_EDID_1600X1200_STEREO: u8 = 12;
610
611/// 1440x900, stereo 2.0.
612pub const MXR_MV_EDID_1440X900_STEREO: u8 = 13;
613
614/// 1360x768, stereo 2.0.
615pub const MXR_MV_EDID_1360X768_STEREO: u8 = 14;
616
617/// 1280x1024, stereo 2.0.
618pub const MXR_MV_EDID_1280X1024_STEREO: u8 = 15;
619
620/// 1024x768, stereo 2.0.
621pub const MXR_MV_EDID_1024X768_STEREO: u8 = 16;
622
623/// 720p, stereo 2.0.
624pub const MXR_MV_EDID_720P_STEREO: u8 = 17;
625
626/// Whatever the display connected to the HDMI output presents. The template a
627/// multiviewer leaves the factory with.
628pub const MXR_MV_EDID_COPY_OUTPUT: u8 = 18;
629
630/// The EDID loaded onto the device.
631pub const MXR_MV_EDID_CUSTOM: u8 = 19;
632
633/// The multiviewer reports no IT-content mode.
634pub const MXR_MV_ITC_UNKNOWN: u8 = 0;
635
636/// Video content.
637pub const MXR_MV_ITC_VIDEO: u8 = 1;
638
639/// PC content.
640pub const MXR_MV_ITC_PC: u8 = 2;
641
642/// The multiviewer reports no aspect ratio.
643pub const MXR_MV_ASPECT_UNKNOWN: u8 = 0;
644
645/// Fill the window.
646pub const MXR_MV_ASPECT_FULL: u8 = 1;
647
648/// 16:9.
649pub const MXR_MV_ASPECT_RATIO_16_9: u8 = 2;
650
651/// Off.
652pub const MXR_MV_BOOL_OFF: u8 = 0;
653
654/// On.
655pub const MXR_MV_BOOL_ON: u8 = 1;
656
657/// The multiviewer reports no value.
658pub const MXR_MV_BOOL_UNKNOWN: u8 = 255;
659
660/// The multiviewer reports no source.
661pub const MXR_MV_SOURCE_UNKNOWN: u8 = 0;
662
663/// Input 1.
664pub const MXR_MV_SOURCE_INPUT_1: u8 = 1;
665
666/// Input 2.
667pub const MXR_MV_SOURCE_INPUT_2: u8 = 2;
668
669/// Input 3.
670pub const MXR_MV_SOURCE_INPUT_3: u8 = 3;
671
672/// Input 4.
673pub const MXR_MV_SOURCE_INPUT_4: u8 = 4;
674
675// ---- OneIP device settings, in `mxr_v2ip_device_settings_t` ----
676
677/// Disables the decoder while the display is off.
678pub const MXR_V2IP_SETTING_SINK_CHECK_POWER: u32 = 1 << 0;
679
680/// Disables the HDMI output while there is no signal.
681pub const MXR_V2IP_SETTING_SINK_OFF_NO_SIGNAL: u32 = 1 << 1;
682
683/// Sends infrared modulated.
684pub const MXR_V2IP_SETTING_IR_TX_MODULATED: u32 = 1 << 2;
685
686/// Lights the status LED.
687pub const MXR_V2IP_SETTING_STATUS_LED: u32 = 1 << 3;
688
689/// Lights the network port LEDs.
690pub const MXR_V2IP_SETTING_NETWORK_LED: u32 = 1 << 4;
691
692/// Runs the fan in quiet mode.
693pub const MXR_V2IP_SETTING_FAN_QUIET: u32 = 1 << 5;
694
695/// Accepts CEC combo keys.
696pub const MXR_V2IP_SETTING_CEC_COMBO_KEYS: u32 = 1 << 6;
697
698/// Accepts CEC combo keys for the device's own input.
699pub const MXR_V2IP_SETTING_CEC_COMBO_INPUT: u32 = 1 << 7;
700
701/// The global infrared port's profile, carried in `ir_profile`.
702pub const MXR_V2IP_SETTING_IR_PROFILE: u32 = 1 << 8;
703
704/// The output infrared port's profile, carried in `ir_profile_sink`.
705pub const MXR_V2IP_SETTING_IR_PROFILE_SINK: u32 = 1 << 9;
706
707/// The stored infrared profiles, carried in `ir_profiles`. Never written.
708pub const MXR_V2IP_SETTING_IR_PROFILES: u32 = 1 << 10;
709
710/// The idle minutes before the device powers down, carried in
711/// `mxr_v2ip_power_save_t.auto_minutes`.
712pub const MXR_V2IP_SETTING_AUTO_POWER_SAVE: u32 = 1 << 11;
713
714/// The daily power save windows, carried in `mxr_v2ip_power_save_t`'s `start`
715/// and `end`.
716pub const MXR_V2IP_SETTING_POWER_SAVE_SCHEDULE: u32 = 1 << 12;
717
718/// The device's clock has been set, on/off. Never written.
719pub const MXR_V2IP_SETTING_CLOCK_SET: u32 = 1 << 13;
720
721/// The PTP mode, carried in `mxr_v2ip_ptp_settings_t`'s `mode`.
722pub const MXR_V2IP_SETTING_PTP_MODE: u32 = 1 << 14;
723
724/// The PTP domain, carried in `mxr_v2ip_ptp_settings_t`'s `domain`.
725pub const MXR_V2IP_SETTING_PTP_DOMAIN: u32 = 1 << 15;
726
727/// The PTP grandmaster priority1, carried in `mxr_v2ip_ptp_settings_t`'s
728/// `priority1`.
729pub const MXR_V2IP_SETTING_PTP_PRIORITY1: u32 = 1 << 16;
730
731/// The source's audio goes out as an AES67 flow, where the source allows. An
732/// on/off setting.
733pub const MXR_V2IP_SETTING_AES67: u32 = 1 << 17;
734
735/// The power save level, read with `mxr_v2ip_power_save_level()`.
736pub const MXR_V2IP_SETTING_POWER_SAVE_LEVEL: u32 = 1 << 18;
737
738/// The interval between PTP announce messages, carried in
739/// `mxr_v2ip_ptp_messages_t`'s `log_announce_interval`.
740pub const MXR_V2IP_SETTING_PTP_ANNOUNCE: u32 = 1 << 19;
741
742/// The interval between PTP sync messages, in `log_sync_interval`.
743pub const MXR_V2IP_SETTING_PTP_SYNC: u32 = 1 << 20;
744
745/// The interval between PTP delay requests, in `log_delay_req_interval`.
746pub const MXR_V2IP_SETTING_PTP_DELAY_REQ: u32 = 1 << 21;
747
748/// The announce intervals before a silent PTP master is dropped, in
749/// `announce_timeout`.
750pub const MXR_V2IP_SETTING_PTP_ANNOUNCE_TIMEOUT: u32 = 1 << 22;
751
752/// The DSCP of the PTP messages, in `dscp`.
753pub const MXR_V2IP_SETTING_PTP_DSCP: u32 = 1 << 23;
754
755/// The minutes after which a heard SAP announcement is forgotten, in
756/// `mxr_v2ip_ptp_messages_t`'s `sap_expire_min`.
757pub const MXR_V2IP_SETTING_SAP_EXPIRE: u32 = 1 << 24;
758
759/// Listens for SAP announcements. An on/off setting.
760pub const MXR_V2IP_SETTING_SAP_LISTEN: u32 = 1 << 25;
761
762/// Sends SAP announcements. An on/off setting.
763pub const MXR_V2IP_SETTING_SAP_ANNOUNCE: u32 = 1 << 26;
764
765/// The seconds between SAP announcements, in `sap_interval_s`.
766pub const MXR_V2IP_SETTING_SAP_INTERVAL: u32 = 1 << 27;
767
768/// Never powers down by itself; a power save request still powers it down.
769/// An on/off setting, which a power save level write switches off.
770pub const MXR_V2IP_SETTING_POWER_SAVE_DISABLED: u32 = 1 << 28;
771
772/// The TTL of the device's streams, in `mxr_v2ip_ptp_messages_t`'s
773/// `stream_ttl`. Reported only by a device with an encoder.
774pub const MXR_V2IP_SETTING_STREAM_TTL: u32 = 1 << 29;
775
776/// Connects to the cloud service. An on/off setting; a device that does not
777/// report it connects regardless.
778pub const MXR_V2IP_SETTING_CLOUD: u32 = 1 << 30;
779
780/// The angle the device's HDMI output is turned by, in
781/// `mxr_v2ip_ptp_messages_t`'s `sink_rotation`. Reported only by a device
782/// with an HDMI output.
783pub const MXR_V2IP_SETTING_SINK_ROTATION: u32 = 1 << 31;
784
785/// The TTL a OneIP device's streams carry until it is set.
786pub const MXR_V2IP_STREAM_TTL_DEFAULT: u8 = 64;
787
788/// The largest angle a OneIP device's HDMI output is turned by, in degrees.
789pub const MXR_V2IP_SINK_ROTATION_MAX: u16 = 359;
790
791// ---- how a OneIP output mixes down to stereo, in `mxr_v2ip_downmix_t` ----
792
793/// `mode`: never.
794pub const MXR_V2IP_DOWNMIX_OFF: u8 = 0;
795/// `mode`: when the display's EDID lists two PCM channels or fewer.
796pub const MXR_V2IP_DOWNMIX_AUTO: u8 = 1;
797/// `mode`: always.
798pub const MXR_V2IP_DOWNMIX_ALWAYS: u8 = 2;
799
800/// `level`: scaled so the mix never clips.
801pub const MXR_V2IP_DOWNMIX_LEVEL_NORMALISED: u8 = 0;
802/// `level`: unscaled, with dialogue at the level it has in stereo.
803pub const MXR_V2IP_DOWNMIX_LEVEL_UNSCALED: u8 = 1;
804
805/// The largest percent a OneIP output mixes its LFE channel in at.
806pub const MXR_V2IP_DOWNMIX_LFE_MAX: u8 = 100;
807
808// ---- what a OneIP output plays from a description, in `mxr_v2ip_sink_sdp_t` ----
809
810/// The output plays a stream from a description.
811pub const MXR_V2IP_SDP_FLAG_ACTIVE: u8 = 1 << 0;
812/// And nothing else, as no video is routed to it.
813pub const MXR_V2IP_SDP_FLAG_AUDIO_ONLY: u8 = 1 << 1;
814/// `clock_mode` and `clock_state` hold the video processor's answer.
815pub const MXR_V2IP_SDP_FLAG_CLOCK: u8 = 1 << 2;
816
817/// No encoding.
818pub const MXR_V2IP_SDP_ENCODING_NONE: u8 = 0;
819/// 16-bit linear PCM.
820pub const MXR_V2IP_SDP_ENCODING_L16: u8 = 1;
821/// 24-bit linear PCM.
822pub const MXR_V2IP_SDP_ENCODING_L24: u8 = 2;
823/// AM824.
824pub const MXR_V2IP_SDP_ENCODING_AM824: u8 = 3;
825
826/// No media clock given.
827pub const MXR_V2IP_SDP_MEDIA_CLOCK_NONE: u8 = 0;
828/// Direct, at an offset from the reference clock.
829pub const MXR_V2IP_SDP_MEDIA_CLOCK_DIRECT: u8 = 1;
830/// The sender's.
831pub const MXR_V2IP_SDP_MEDIA_CLOCK_SENDER: u8 = 2;
832
833/// No reference clock given.
834pub const MXR_V2IP_SDP_REF_CLOCK_NONE: u8 = 0;
835/// PTP.
836pub const MXR_V2IP_SDP_REF_CLOCK_PTP: u8 = 1;
837/// A traceable clock.
838pub const MXR_V2IP_SDP_REF_CLOCK_TRACEABLE: u8 = 2;
839/// The sender's local MAC.
840pub const MXR_V2IP_SDP_REF_CLOCK_LOCAL_MAC: u8 = 3;
841
842/// Timed by arrival.
843pub const MXR_V2IP_SDP_CLOCK_MODE_ARRIVAL: u8 = 0;
844/// Timed by PTP.
845pub const MXR_V2IP_SDP_CLOCK_MODE_PTP: u8 = 1;
846/// Timed by the sender.
847pub const MXR_V2IP_SDP_CLOCK_MODE_SENDER: u8 = 2;
848
849/// Idle.
850pub const MXR_V2IP_SDP_CLOCK_STATE_IDLE: u8 = 0;
851/// Running its servo.
852pub const MXR_V2IP_SDP_CLOCK_STATE_SERVO: u8 = 1;
853/// Aligning.
854pub const MXR_V2IP_SDP_CLOCK_STATE_ALIGNING: u8 = 2;
855/// Timed.
856pub const MXR_V2IP_SDP_CLOCK_STATE_TIMED: u8 = 3;
857/// Parked.
858pub const MXR_V2IP_SDP_CLOCK_STATE_PARKED: u8 = 4;
859/// Playing untimed.
860pub const MXR_V2IP_SDP_CLOCK_STATE_UNTIMED: u8 = 5;
861/// The timing is not supported.
862pub const MXR_V2IP_SDP_CLOCK_STATE_UNSUPPORTED: u8 = 6;
863
864// ---- OneIP power save levels ----
865
866/// No level.
867pub const MXR_V2IP_POWER_SAVE_LEVEL_NONE: u8 = 0;
868/// Part of the video processing powers down.
869pub const MXR_V2IP_POWER_SAVE_LEVEL_REDUCED: u8 = 1;
870/// All of the video processing powers down.
871pub const MXR_V2IP_POWER_SAVE_LEVEL_LOW: u8 = 2;
872/// Everything but the network powers down.
873pub const MXR_V2IP_POWER_SAVE_LEVEL_OFF: u8 = 3;
874
875// ---- what a unit offers at a power save level, in `mxr_unit_power_save_t` ----
876
877/// The unit can power down to this level.
878pub const MXR_UNIT_POWER_SAVE_SUPPORTED: u8 = 1 << 0;
879/// A signal on the HDMI input wakes the unit.
880pub const MXR_UNIT_POWER_SAVE_INPUT_WAKE: u8 = 1 << 1;
881/// The display powering on wakes the unit, and the unit can power it on.
882pub const MXR_UNIT_POWER_SAVE_OUTPUT_WAKE: u8 = 1 << 2;
883
884// ---- OneIP PTP modes, in `mxr_v2ip_ptp_settings_t::mode` ----
885
886/// No PTP.
887pub const MXR_V2IP_PTP_MODE_OFF: u8 = 0;
888/// Follows a grandmaster, and never becomes one.
889pub const MXR_V2IP_PTP_MODE_FOLLOWER: u8 = 1;
890/// Follows a grandmaster, or becomes one when there is none.
891pub const MXR_V2IP_PTP_MODE_AUTO: u8 = 2;
892
893// ---- unit status flags, in `mxr_unit_status_t::flags` ----
894
895/// A changed setting takes effect after a reboot.
896pub const MXR_UNIT_REBOOT_REQUIRED: u32 = 1 << 0;
897/// A newer video processor image is available.
898pub const MXR_UNIT_FPGA_UPGRADE: u32 = 1 << 1;
899/// The IP configuration comes from DHCP.
900pub const MXR_UNIT_DHCP: u32 = 1 << 2;
901/// The IP configuration was changed through the mesh, and is reverted unless
902/// the mesh controller confirms it within `net_revert_s`.
903pub const MXR_UNIT_NET_PENDING: u32 = 1 << 3;
904/// The fan runs in quiet mode.
905pub const MXR_UNIT_FAN_QUIET: u32 = 1 << 4;
906/// Powered by an external supply rather than PoE.
907pub const MXR_UNIT_EXTERNAL_PSU: u32 = 1 << 5;
908/// The video processor runs with its IP configured. Without it
909/// `encoder_health` and `decoder_health` carry nothing.
910pub const MXR_UNIT_FPGA_CONFIGURED: u32 = 1 << 6;
911/// The encoder is enabled.
912pub const MXR_UNIT_ENCODER_ACTIVE: u32 = 1 << 7;
913/// The decoder is enabled.
914pub const MXR_UNIT_DECODER_ACTIVE: u32 = 1 << 8;
915/// The decoder disables itself without a display.
916pub const MXR_UNIT_AUTO_DISABLE: u32 = 1 << 9;
917/// The decoder disabled itself without a display.
918pub const MXR_UNIT_AUTO_DISABLE_ACTIVE: u32 = 1 << 10;
919/// The HDMI output switches off without a signal.
920pub const MXR_UNIT_OFF_NO_SIGNAL: u32 = 1 << 11;
921/// The HDMI output switched off without a signal.
922pub const MXR_UNIT_OFF_NO_SIGNAL_ACTIVE: u32 = 1 << 12;
923/// Display power is checked before the decoder is enabled.
924pub const MXR_UNIT_POWER_CHECK: u32 = 1 << 13;
925/// `boot_count` is reported.
926pub const MXR_UNIT_BOOT_COUNT: u32 = 1 << 14;
927/// `fan_rpm` is reported.
928pub const MXR_UNIT_FAN_SPEED: u32 = 1 << 15;
929
930// ---- OneIP PTP state, in `mxr_v2ip_ptp_t` ----
931
932/// The device runs PTP and the block holds its state.
933pub const MXR_V2IP_PTP_VALID: u8 = 1 << 0;
934/// The device locked to a master since its PTP started, so its mesh holds a
935/// time.
936pub const MXR_V2IP_PTP_FOLLOWED: u8 = 1 << 1;
937
938/// Not locked.
939pub const MXR_V2IP_PTP_LOCK_UNLOCKED: u8 = 0;
940/// Locking.
941pub const MXR_V2IP_PTP_LOCK_LOCKING: u8 = 1;
942/// Locked.
943pub const MXR_V2IP_PTP_LOCK_LOCKED: u8 = 2;
944
945// ---- OneIP VLAN flags, in `mxr_v2ip_vlan_t::flags` ----
946
947/// The block carries a configuration. A block without it carries nothing.
948pub const MXR_V2IP_VLAN_VALID: u16 = 1 << 0;
949
950/// Untagged frames arriving on the uplink are dropped instead of reaching the
951/// device.
952pub const MXR_V2IP_VLAN_TRUNK: u16 = 1 << 1;
953
954/// Reported by the device: the configuration is applied, and reverted unless
955/// the mesh controller confirms it. Never written.
956pub const MXR_V2IP_VLAN_PENDING: u16 = 1 << 2;
957
958/// Sent by the mesh controller: a pending configuration it heard, which the
959/// device then keeps.
960pub const MXR_V2IP_VLAN_CONFIRM: u16 = 1 << 3;
961
962/// Reported by the device: it has an SFP port. Never written.
963pub const MXR_V2IP_VLAN_HAS_SFP: u16 = 1 << 4;
964
965// ---- OneIP test card, in `mxr_v2ip_testcard_t` ----
966
967/// No pattern.
968pub const MXR_V2IP_TEST_PATTERN_OFF: u8 = 0;
969/// Colour bars.
970pub const MXR_V2IP_TEST_PATTERN_BARS: u8 = 1;
971/// One flat colour, the test card's `colour`.
972pub const MXR_V2IP_TEST_PATTERN_FLAT: u8 = 2;
973/// A ramp.
974pub const MXR_V2IP_TEST_PATTERN_RAMP: u8 = 3;
975/// A grid.
976pub const MXR_V2IP_TEST_PATTERN_GRID: u8 = 4;
977/// A strip.
978pub const MXR_V2IP_TEST_PATTERN_STRIP: u8 = 5;
979/// A test card.
980pub const MXR_V2IP_TEST_PATTERN_CARD: u8 = 6;
981
982/// No tone.
983pub const MXR_V2IP_TONE_MODE_OFF: u8 = 0;
984/// A continuous tone.
985pub const MXR_V2IP_TONE_MODE_CONTINUOUS: u8 = 1;
986/// A channel ident.
987pub const MXR_V2IP_TONE_MODE_IDENT: u8 = 2;
988/// A line-up tone, which needs two channels or more.
989pub const MXR_V2IP_TONE_MODE_LINEUP: u8 = 3;
990/// A beep on each lip-sync mark.
991pub const MXR_V2IP_TONE_MODE_BEEP: u8 = 4;
992
993/// The sink can draw the test card.
994pub const MXR_V2IP_TESTCARD_SUPPORTED: u8 = 1 << 0;
995/// The output shows the pattern.
996pub const MXR_V2IP_TESTCARD_SHOWING: u8 = 1 << 1;
997/// The tone plays on the output.
998pub const MXR_V2IP_TESTCARD_PLAYING: u8 = 1 << 2;
999/// A pattern change has yet to reach the video processor.
1000pub const MXR_V2IP_TESTCARD_PATTERN_PENDING: u8 = 1 << 3;
1001/// A tone change has yet to reach the video processor.
1002pub const MXR_V2IP_TESTCARD_TONE_PENDING: u8 = 1 << 4;
1003/// A lip-sync change has yet to reach the video processor.
1004pub const MXR_V2IP_TESTCARD_SYNC_PENDING: u8 = 1 << 5;
1005
1006// ---- overlay sync, in `mxr_osd_sync_t` and `mxr_osd_sync_report_t` ----
1007
1008/// The sync copies captions.
1009pub const MXR_OSD_SYNC_WHAT_CAPTIONS: u8 = 1 << 0;
1010/// Which logo is shown, and where.
1011pub const MXR_OSD_SYNC_WHAT_LOGO: u8 = 1 << 1;
1012/// Background colours.
1013pub const MXR_OSD_SYNC_WHAT_BACKGROUNDS: u8 = 1 << 2;
1014/// The logo images in the four slots.
1015pub const MXR_OSD_SYNC_WHAT_LOGO_SLOTS: u8 = 1 << 3;
1016
1017/// The unit is taking the sync.
1018pub const MXR_OSD_SYNC_STATE_TAKING: u8 = 0;
1019/// Every setting written and committed.
1020pub const MXR_OSD_SYNC_STATE_DONE: u8 = 1;
1021/// Failed, for the reason the report gives.
1022pub const MXR_OSD_SYNC_STATE_FAILED: u8 = 2;
1023/// Kept for later, as the unit's video processor is off in power save.
1024pub const MXR_OSD_SYNC_STATE_DEFERRED: u8 = 3;
1025
1026// ---- the message on a unit's output, in `mxr_osd_message_t` ----
1027
1028/// A message is set. Without it the other fields are empty.
1029pub const MXR_OSD_MESSAGE_SET: u8 = 1 << 0;
1030/// The output shows it, rather than another message ahead of it.
1031pub const MXR_OSD_MESSAGE_SHOWN: u8 = 1 << 1;
1032/// The unit's video processor composes the message layer.
1033pub const MXR_OSD_MESSAGE_SUPPORTED: u8 = 1 << 2;
1034/// The unit did not take the write it answers, and reports the message it
1035/// kept.
1036pub const MXR_OSD_MESSAGE_REFUSED: u8 = 1 << 3;
1037
1038/// After the unit's own upgrade, Locate Device and encrypted source messages.
1039pub const MXR_OSD_MESSAGE_PRIORITY_LOW: u8 = 0;
1040/// Between them.
1041pub const MXR_OSD_MESSAGE_PRIORITY_NORMAL: u8 = 1;
1042/// Before them.
1043pub const MXR_OSD_MESSAGE_PRIORITY_TOP: u8 = 2;
1044
1045/// The longest message text a unit takes, in bytes.
1046pub const MXR_OSD_MESSAGE_TEXT_MAX: usize = 255;
1047
1048// ---- overlay sync settings, in `mxr_osd_sync_entry_t` ----
1049
1050/// The setting sets a caption.
1051pub const MXR_OSD_SYNC_TYPE_CAPTION: u8 = 0;
1052/// The setting sets which logo is shown, and where.
1053pub const MXR_OSD_SYNC_TYPE_LOGO: u8 = 1;
1054/// The setting sets a background colour.
1055pub const MXR_OSD_SYNC_TYPE_BACKGROUND: u8 = 2;
1056
1057/// Large outputs, which every value but `SMALL` also means.
1058pub const MXR_OSD_SYNC_SIZE_LARGE: u8 = 1;
1059/// Small outputs.
1060pub const MXR_OSD_SYNC_SIZE_SMALL: u8 = 2;
1061
1062/// A caption's lines aligned to the left.
1063pub const MXR_OSD_CAPTION_ALIGN_LEFT: u8 = 0;
1064/// Centred.
1065pub const MXR_OSD_CAPTION_ALIGN_CENTRE: u8 = 1;
1066/// To the right.
1067pub const MXR_OSD_CAPTION_ALIGN_RIGHT: u8 = 2;
1068/// The layout's default.
1069pub const MXR_OSD_CAPTION_ALIGN_DEFAULT: u8 = 0xFF;
1070
1071/// A caption's text read as plain text.
1072pub const MXR_OSD_CAPTION_FORMAT_PLAIN: u8 = 0;
1073/// As Markdown.
1074pub const MXR_OSD_CAPTION_FORMAT_MARKDOWN: u8 = 1;
1075/// The layout's default.
1076pub const MXR_OSD_CAPTION_FORMAT_DEFAULT: u8 = 0xFF;
1077
1078/// The caption fields a setting gives. A field left out keeps what the unit
1079/// has.
1080pub const MXR_OSD_CAPTION_FIELD_FONT: u16 = 1 << 0;
1081/// The size.
1082pub const MXR_OSD_CAPTION_FIELD_SIZE: u16 = 1 << 1;
1083/// The horizontal position.
1084pub const MXR_OSD_CAPTION_FIELD_X: u16 = 1 << 2;
1085/// The vertical position.
1086pub const MXR_OSD_CAPTION_FIELD_Y: u16 = 1 << 3;
1087/// The alignment.
1088pub const MXR_OSD_CAPTION_FIELD_ALIGN: u16 = 1 << 4;
1089/// The format.
1090pub const MXR_OSD_CAPTION_FIELD_FORMAT: u16 = 1 << 5;
1091/// The colour.
1092pub const MXR_OSD_CAPTION_FIELD_COLOUR: u16 = 1 << 6;
1093/// The wrap width.
1094pub const MXR_OSD_CAPTION_FIELD_WRAP: u16 = 1 << 7;
1095/// The text.
1096pub const MXR_OSD_CAPTION_FIELD_TEXT: u16 = 1 << 8;
1097
1098/// The logo fields a setting gives. A field left out keeps what the unit
1099/// has.
1100pub const MXR_OSD_LOGO_FIELD_LOGO: u16 = 1 << 0;
1101/// The horizontal position.
1102pub const MXR_OSD_LOGO_FIELD_X: u16 = 1 << 1;
1103/// The vertical position.
1104pub const MXR_OSD_LOGO_FIELD_Y: u16 = 1 << 2;
1105
1106// ---- reading the packed words ----
1107
1108/// The remote-control type a bay status word carries in bits 16-19.
1109#[no_mangle]
1110pub extern "C" fn mxr_bay_status_rc_type(status: u32) -> u8 {
1111    guard(0, || BayStatus::from_bits(status).rc_type().to_wire())
1112}
1113
1114/// The HDCP version a bay status word carries in bits 22-23.
1115#[no_mangle]
1116pub extern "C" fn mxr_bay_status_hdcp(status: u32) -> u8 {
1117    guard(0, || BayStatus::from_bits(status).hdcp())
1118}
1119
1120/// The CTA-861 short video descriptor, zero when the signal is not HDMI.
1121#[no_mangle]
1122pub extern "C" fn mxr_signal_type_svd(signal_type: mxr_signal_type_t) -> u8 {
1123    guard(0, || MxrSignalType::from_wire(signal_type).svd())
1124}
1125
1126/// The colour space: 0 RGB, 1 4:4:4, 2 4:2:2, 3 4:2:0.
1127#[no_mangle]
1128pub extern "C" fn mxr_signal_type_colour_space(signal_type: mxr_signal_type_t) -> u8 {
1129    guard(0, || MxrSignalType::from_wire(signal_type).colour_space())
1130}
1131
1132/// Whether the frame rate carries a 1000/1001 clock.
1133#[no_mangle]
1134pub extern "C" fn mxr_signal_type_non_integer(signal_type: mxr_signal_type_t) -> bool {
1135    guard(false, || {
1136        MxrSignalType::from_wire(signal_type).is_non_integer()
1137    })
1138}
1139
1140/// The bit depth in bits per component, zero where the word names none.
1141///
1142/// The field on the wire is an index into a table of four depths, so it is not
1143/// the depth: a signal at 12 bits reads 3 there. This converts it.
1144#[no_mangle]
1145pub extern "C" fn mxr_signal_type_bpp(signal_type: mxr_signal_type_t) -> u8 {
1146    guard(0, || {
1147        MxrSignalType::from_wire(signal_type).bpp().unwrap_or(0)
1148    })
1149}
1150
1151/// The raw bit-depth index, for a caller that wants the wire value.
1152///
1153/// See `mxr_signal_type_bpp()` for the depth it stands for.
1154#[no_mangle]
1155pub extern "C" fn mxr_signal_type_bpp_index(signal_type: mxr_signal_type_t) -> u8 {
1156    guard(0, || MxrSignalType::from_wire(signal_type).bpp_index())
1157}
1158
1159/// Whether the word names a signal format at all.
1160///
1161/// A bay with nothing configured says so two ways: a sender that zeroes the
1162/// word and stamps the unset bit-depth index, and one that writes a plain
1163/// zero. Neither is a format, and the svd and colour space beside them are not
1164/// answers either - both read as zero, which is what this word says for "not
1165/// HDMI" and "RGB" when it is set.
1166#[no_mangle]
1167pub extern "C" fn mxr_signal_type_is_set(signal_type: mxr_signal_type_t) -> bool {
1168    guard(false, || MxrSignalType::from_wire(signal_type).is_set())
1169}