Returns button state reader for this device
(self: &Arc<Self>)
| 473 | |
| 474 | /// Returns button state reader for this device |
| 475 | pub fn get_reader(self: &Arc<Self>) -> Arc<DeviceStateReader> { |
| 476 | #[allow(clippy::arc_with_non_send_sync)] |
| 477 | Arc::new(DeviceStateReader { |
| 478 | device: self.clone(), |
| 479 | states: Mutex::new(DeviceState { |
| 480 | buttons: vec![false; self.kind.key_count() as usize + self.kind.touchpoint_count() as usize], |
| 481 | encoders: vec![false; self.kind.encoder_count() as usize], |
| 482 | }), |
| 483 | }) |
| 484 | } |
| 485 | |
| 486 | fn write_image_data_reports<T>(&self, image_data: &[u8], parameters: WriteImageParameters, header_fn: T) -> Result<(), StreamDeckError> |
| 487 | where |