mirror of
https://github.com/OpenActionAPI/rust-elgato-streamdeck.git
synced 2026-10-28 09:44:56 +00:00
Add support for the Ajazz AKP03
This commit is contained in:
1 parent
edf6a74a1e
commit
3a0a301a45
6 files changed
+39
-36
No files matched your search
@@ -12,6 +12,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6667", MODE="0660",
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6670", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6672", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6674", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1001", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
@@ -31,6 +32,7 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6667", MODE="0660"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6670", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6672", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6674", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
@@ -50,6 +52,7 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=="6670", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=="6672", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=="6674", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1001", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
@@ -69,6 +72,7 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6670", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6672", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6674", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
|
||||
|
||||
@@ -78,6 +78,7 @@ As it stands, this library should support the following devices:
|
||||
- Ajazz AKP153E (thanks to [@teras](https://github.com/teras))
|
||||
- Ajazz AKP153R (thanks to [@teras](https://github.com/teras), [@damnkrat](https://github.com/damnkrat) and [@4ndv](https://github.com/4ndv))
|
||||
- Ajazz AKP815 (thanks to [@teras](https://github.com/teras))
|
||||
- Ajazz AKP03 (thanks to [@4ndv](https://github.com/4ndv) and [@happyme531](https://github.com/happyme531))
|
||||
- Ajazz AKP03E (thanks to [@4ndv](https://github.com/4ndv) and [@geekosaurusR3x](https://github.com/geekosaurusR3x))
|
||||
- Ajazz AKP03R (thanks to [@4ndv](https://github.com/4ndv))
|
||||
- MiraBox HSV293S (thanks to [@czyz](https://github.com/czyz))
|
||||
|
||||
+9
-14
@@ -246,21 +246,16 @@ impl AsyncDeviceStateReader {
|
||||
|
||||
StreamDeckInput::EncoderStateChange(encoders) => {
|
||||
for (index, (their, mine)) in zip(encoders.iter(), my_states.encoders.iter()).enumerate() {
|
||||
match self.device.kind {
|
||||
Kind::Akp03E | Kind::Akp03R => {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
if self.device.kind.is_mirabox() {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
_ => {
|
||||
if *their != *mine {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
} else {
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
}
|
||||
} else if *their != *mine {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
} else {
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-6
@@ -46,6 +46,9 @@ pub const PID_AJAZZ_AKP153E: u16 = 0x1010;
|
||||
/// Product ID of Ajazz AKP153R
|
||||
pub const PID_AJAZZ_AKP153R: u16 = 0x1020;
|
||||
|
||||
/// Product ID of Ajazz AKP03
|
||||
pub const PID_AJAZZ_AKP03: u16 = 0x1001;
|
||||
|
||||
/// Product ID of Ajazz AKP03E
|
||||
pub const PID_AJAZZ_AKP03E: u16 = 0x3002;
|
||||
|
||||
@@ -90,6 +93,8 @@ pub enum Kind {
|
||||
Akp153R,
|
||||
/// Ajazz AKP815
|
||||
Akp815,
|
||||
/// Ajazz AKP03
|
||||
Akp03,
|
||||
/// Ajazz AKP03E
|
||||
Akp03E,
|
||||
/// Ajazz AKP03R
|
||||
@@ -129,6 +134,7 @@ impl Kind {
|
||||
MIRABOX_VENDOR_ID_2 => match pid {
|
||||
PID_AJAZZ_AKP153E => Some(Kind::Akp153E),
|
||||
PID_AJAZZ_AKP153R => Some(Kind::Akp153R),
|
||||
PID_AJAZZ_AKP03 => Some(Kind::Akp03),
|
||||
PID_AJAZZ_AKP03E => Some(Kind::Akp03E),
|
||||
PID_AJAZZ_AKP03R => Some(Kind::Akp03R),
|
||||
_ => None,
|
||||
@@ -155,6 +161,7 @@ impl Kind {
|
||||
Kind::Akp153E => PID_AJAZZ_AKP153E,
|
||||
Kind::Akp153R => PID_AJAZZ_AKP153R,
|
||||
Kind::Akp815 => PID_AJAZZ_AKP815,
|
||||
Kind::Akp03 => PID_AJAZZ_AKP03,
|
||||
Kind::Akp03E => PID_AJAZZ_AKP03E,
|
||||
Kind::Akp03R => PID_AJAZZ_AKP03R,
|
||||
Kind::MiraBoxHSV293S => PID_MIRABOX_HSV293S,
|
||||
@@ -179,6 +186,7 @@ impl Kind {
|
||||
Kind::Akp153E => MIRABOX_VENDOR_ID_2,
|
||||
Kind::Akp153R => MIRABOX_VENDOR_ID_2,
|
||||
Kind::Akp815 => MIRABOX_VENDOR_ID_1,
|
||||
Kind::Akp03 => MIRABOX_VENDOR_ID_2,
|
||||
Kind::Akp03E => MIRABOX_VENDOR_ID_2,
|
||||
Kind::Akp03R => MIRABOX_VENDOR_ID_2,
|
||||
Kind::MiraBoxHSV293S => MIRABOX_VENDOR_ID_1,
|
||||
@@ -196,7 +204,7 @@ impl Kind {
|
||||
Kind::Neo | Kind::Plus => 8,
|
||||
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::MiraBoxHSV293S => 15 + 3,
|
||||
Kind::Akp815 => 15,
|
||||
Kind::Akp03E | Kind::Akp03R => 6 + 3,
|
||||
Kind::Akp03 | Kind::Akp03E | Kind::Akp03R => 6 + 3,
|
||||
Kind::MiraBoxDK0108D => 12,
|
||||
}
|
||||
}
|
||||
@@ -211,7 +219,7 @@ impl Kind {
|
||||
Kind::Neo | Kind::Plus => 2,
|
||||
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::MiraBoxHSV293S => 3,
|
||||
Kind::Akp815 => 5,
|
||||
Kind::Akp03E | Kind::Akp03R => 3,
|
||||
Kind::Akp03 | Kind::Akp03E | Kind::Akp03R => 3,
|
||||
Kind::MiraBoxDK0108D => 3,
|
||||
}
|
||||
}
|
||||
@@ -226,7 +234,7 @@ impl Kind {
|
||||
Kind::Neo | Kind::Plus => 4,
|
||||
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::MiraBoxHSV293S => 6,
|
||||
Kind::Akp815 => 3,
|
||||
Kind::Akp03E | Kind::Akp03R => 3,
|
||||
Kind::Akp03 | Kind::Akp03E | Kind::Akp03R => 3,
|
||||
Kind::MiraBoxDK0108D => 4,
|
||||
}
|
||||
}
|
||||
@@ -235,7 +243,7 @@ impl Kind {
|
||||
pub fn encoder_count(&self) -> u8 {
|
||||
match self {
|
||||
Kind::Plus => 4,
|
||||
Kind::Akp03E | Kind::Akp03R => 3,
|
||||
Kind::Akp03 | Kind::Akp03E | Kind::Akp03R => 3,
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
@@ -324,7 +332,7 @@ impl Kind {
|
||||
mirror: ImageMirroring::None,
|
||||
},
|
||||
|
||||
Kind::Akp03E | Kind::Akp03R => ImageFormat {
|
||||
Kind::Akp03 | Kind::Akp03E | Kind::Akp03R => ImageFormat {
|
||||
mode: ImageMode::JPEG,
|
||||
size: (60, 60),
|
||||
rotation: ImageRotation::Rot0,
|
||||
@@ -481,7 +489,7 @@ impl Kind {
|
||||
|
||||
/// Returns true for Mirabox devices with 1024 byte packet length
|
||||
pub fn is_mirabox_v2(&self) -> bool {
|
||||
matches!(self, Kind::Akp03E | Kind::Akp03R)
|
||||
matches!(self, Kind::Akp03 | Kind::Akp03E | Kind::Akp03R)
|
||||
}
|
||||
|
||||
/// Returns true for Mirabox devices
|
||||
|
||||
+10
-15
@@ -443,7 +443,7 @@ impl StreamDeck {
|
||||
/// they will appear on the device!
|
||||
pub fn write_image(&self, key: u8, image_data: &[u8]) -> Result<(), StreamDeckError> {
|
||||
// Key count is 9 for AKP03x, but only the first 6 (0-5) have screens, so don't output anything for keys 6, 7, 8
|
||||
if (self.kind == Kind::Akp03E || self.kind == Kind::Akp03R) && key >= 6 {
|
||||
if matches!(self.kind, Kind::Akp03 | Kind::Akp03E | Kind::Akp03R) && key >= 6 {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -1070,21 +1070,16 @@ impl DeviceStateReader {
|
||||
|
||||
StreamDeckInput::EncoderStateChange(encoders) => {
|
||||
for (index, (their, mine)) in zip(encoders.iter(), my_states.encoders.iter()).enumerate() {
|
||||
match self.device.kind {
|
||||
Kind::Akp03E | Kind::Akp03R => {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
if self.device.kind.is_mirabox() {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
_ => {
|
||||
if *their != *mine {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
} else {
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
}
|
||||
} else if *their != *mine {
|
||||
if *their {
|
||||
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
|
||||
} else {
|
||||
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ pub fn read_encoder_input(kind: &Kind, data: &[u8]) -> Result<StreamDeckInput, S
|
||||
}
|
||||
}
|
||||
|
||||
/// Read inputs from Ajazz AKP03
|
||||
/// Read inputs from Ajazz AKP03x
|
||||
pub fn ajazz03_read_input(kind: &Kind, input: u8) -> Result<StreamDeckInput, StreamDeckError> {
|
||||
match input {
|
||||
(0..=6) | 0x25 | 0x30 | 0x31 => ajazz03_read_button_press(kind, input),
|
||||
|
||||
Reference in new issue
Block a user