pub struct StreamDeck { /* private fields */ }Expand description
Interface for a Stream Deck device
Implementations§
Source§impl StreamDeck
Static functions of the struct
impl StreamDeck
Static functions of the struct
Sourcepub fn connect(
hidapi: &HidApi,
kind: Kind,
serial: &str,
) -> Result<StreamDeck, StreamDeckError>
pub fn connect( hidapi: &HidApi, kind: Kind, serial: &str, ) -> Result<StreamDeck, StreamDeckError>
Attempts to connect to the device
Source§impl StreamDeck
Instance methods of the struct
impl StreamDeck
Instance methods of the struct
Sourcepub fn manufacturer(&self) -> Result<String, StreamDeckError>
pub fn manufacturer(&self) -> Result<String, StreamDeckError>
Returns manufacturer string of the device
Sourcepub fn product(&self) -> Result<String, StreamDeckError>
pub fn product(&self) -> Result<String, StreamDeckError>
Returns product string of the device
Sourcepub fn serial_number(&self) -> Result<String, StreamDeckError>
pub fn serial_number(&self) -> Result<String, StreamDeckError>
Returns serial number of the device
Sourcepub fn firmware_version(&self) -> Result<String, StreamDeckError>
pub fn firmware_version(&self) -> Result<String, StreamDeckError>
Returns firmware version of the StreamDeck
Sourcepub fn read_input(
&self,
timeout: Option<Duration>,
) -> Result<StreamDeckInput, StreamDeckError>
pub fn read_input( &self, timeout: Option<Duration>, ) -> Result<StreamDeckInput, StreamDeckError>
Reads all possible input from Stream Deck device
Sourcepub fn reset(&self) -> Result<(), StreamDeckError>
pub fn reset(&self) -> Result<(), StreamDeckError>
Resets the device
Sourcepub fn set_brightness(&self, percent: u8) -> Result<(), StreamDeckError>
pub fn set_brightness(&self, percent: u8) -> Result<(), StreamDeckError>
Sets brightness of the device, value range is 0 - 100
Sourcepub fn write_image(
&self,
key: u8,
image_data: &[u8],
) -> Result<(), StreamDeckError>
pub fn write_image( &self, key: u8, image_data: &[u8], ) -> Result<(), StreamDeckError>
Writes image data to Stream Deck device, changes must be flushed with .flush() before
they will appear on the device!
Sourcepub fn write_lcd(
&self,
x: u16,
y: u16,
rect: &ImageRect,
) -> Result<(), StreamDeckError>
pub fn write_lcd( &self, x: u16, y: u16, rect: &ImageRect, ) -> Result<(), StreamDeckError>
Writes image data to Stream Deck device’s lcd strip/screen as region. Only Stream Deck Plus supports writing LCD regions, for Stream Deck Neo use write_lcd_fill
Sourcepub fn write_lcd_fill(&self, image_data: &[u8]) -> Result<(), StreamDeckError>
pub fn write_lcd_fill(&self, image_data: &[u8]) -> Result<(), StreamDeckError>
Writes image data to Stream Deck device’s lcd strip/screen as full fill
You can convert your images into proper image_data like this:
use elgato_streamdeck::images::convert_image_with_format;
let image_data = convert_image_with_format(device.kind().lcd_image_format(), image).unwrap();
device.write_lcd_fill(&image_data);Sets button’s image to blank, changes must be flushed with .flush() before
they will appear on the device!
Sets blank images to every button, changes must be flushed with .flush() before
they will appear on the device!
Sets specified button’s image, changes must be flushed with .flush() before
they will appear on the device!
Sourcepub fn set_touchpoint_color(
&self,
point: u8,
red: u8,
green: u8,
blue: u8,
) -> Result<(), StreamDeckError>
pub fn set_touchpoint_color( &self, point: u8, red: u8, green: u8, blue: u8, ) -> Result<(), StreamDeckError>
Sets specified touch point’s led strip color
Sourcepub fn flush(&self) -> Result<(), StreamDeckError>
pub fn flush(&self) -> Result<(), StreamDeckError>
Flushes the button’s image to the device
Sourcepub fn get_reader(self: &Arc<Self>) -> Arc<DeviceStateReader>
pub fn get_reader(self: &Arc<Self>) -> Arc<DeviceStateReader>
Returns button state reader for this device