// SPDX-FileCopyrightText: © 2025 Jeffrey C. Ollie // SPDX-License-Identifier: MIT //! The Stream Deck Studio, the rack-mounted model. Its thirty-two keys //! are arranged in a grid sixteen across and two down, and a rotary //! encoder sits at either end of the row; those are described by //! `Encoders` rather than here. It has no touch keys and no //! touchscreen. //! //! `devices.zig` gathers this module together with the one for every //! other model, so that the control groups can look up the properties //! of whichever device they are attached to. const ElgatoStreamDeckStudio = @This(); const KeyFeature = @import("../Keys.zig").KeyFeature; pub const vendor: u16 = 0x0fd9; pub const product: u16 = 0x00aa; /// What this model's keys look like and what they can do. Every device /// module declares this, so the fields and functions below are the same /// from one model to the next even though the values differ. pub const keys = struct { /// The number of columns in the key grid. pub const cols: u5 = 16; /// The number of rows in the key grid. pub const rows: u5 = 2; /// The number of touch keys beyond the grid. This model has none: /// the two controls beside the grid are rotary encoders, which /// `Encoders` reports. pub const touch: u5 = 0; /// The total number of keys, the grid and the touch keys together. pub const count: u8 = @as(u8, cols) * rows + touch; /// What the given key is capable of, or null if this model has no /// such key. Keys are numbered from zero. Every key displays a /// 144x112 JPEG image sent with a v2 header. /// /// The size is the device's own. The two reference implementations /// disagreed -- python-elgato-streamdeck says 80x120, /// node-elgato-stream-deck says 144x112 -- and a Studio settled it /// by answering host command `0x80`, whose reply carries the key /// and panel dimensions in the layout of the USB unit information /// report: 144x112 keys on a 1424x280 panel. pub fn getFeature(key: u8) ?KeyFeature { switch (key) { 0...31 => { return .{ .image = .{ .header_format = .v2, .image_format = .JPEG, .width = 144, .height = 112, .rotation = null, .flip_left_right = false, .flip_top_bottom = false, }, }; }, else => return null, } } };