Skip to content

Commit

Permalink
korg-kaoss-dj: Add shift button led
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Aug 20, 2023
1 parent 2a4d46a commit 1d97577
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
20 changes: 10 additions & 10 deletions src/devices/korg_kaoss_dj/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ use super::{
Deck, CONTROL_INDEX_DECK_A, CONTROL_INDEX_DECK_B, CONTROL_INDEX_DECK_BIT_MASK,
CONTROL_INDEX_ENUM_BIT_MASK, MIDI_CHANNEL_DECK_A, MIDI_CHANNEL_DECK_B, MIDI_DECK_CUE_BUTTON,
MIDI_DECK_EQ_HI_KNOB, MIDI_DECK_EQ_LO_KNOB, MIDI_DECK_EQ_MID_KNOB, MIDI_DECK_GAIN_KNOB,
MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SYNC_BUTTON,
MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON,
MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON,
MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON,
MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON,
MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON, MIDI_DEVICE_DESCRIPTOR, MIDI_MASTER_LEVEL_KNOB,
MIDI_MONITOR_LEVEL_KNOB, MIDI_MONITOR_MIX_KNOB, MIDI_STATUS_BUTTON_DECK_A,
MIDI_STATUS_BUTTON_DECK_B, MIDI_STATUS_BUTTON_MAIN, MIDI_STATUS_CC_DECK_A,
MIDI_STATUS_CC_DECK_B, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON,
MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SHIFT_BUTTON,
MIDI_DECK_SYNC_BUTTON, MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON,
MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON,
MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON,
MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON,
MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON,
MIDI_DEVICE_DESCRIPTOR, MIDI_MASTER_LEVEL_KNOB, MIDI_MONITOR_LEVEL_KNOB, MIDI_MONITOR_MIX_KNOB,
MIDI_STATUS_BUTTON_DECK_A, MIDI_STATUS_BUTTON_DECK_B, MIDI_STATUS_BUTTON_MAIN,
MIDI_STATUS_CC_DECK_A, MIDI_STATUS_CC_DECK_B, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON,
};
use crate::{
ButtonInput, CenterSliderInput, ControlIndex, ControlInputEvent, ControlRegister, ControlValue,
Expand Down Expand Up @@ -199,7 +199,7 @@ pub fn try_decode_midi_input(
MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON => DeckSensor::TouchStripRightButton,
0x18 => DeckSensor::FxButton,
MIDI_DECK_MONITOR_BUTTON => DeckSensor::MonitorButton,
0x1a => DeckSensor::ShiftButton,
MIDI_DECK_SHIFT_BUTTON => DeckSensor::ShiftButton,
MIDI_DECK_PLAYPAUSE_BUTTON => DeckSensor::PlayPauseButton,
MIDI_DECK_SYNC_BUTTON => DeckSensor::SyncButton,
MIDI_DECK_CUE_BUTTON => DeckSensor::CueButton,
Expand Down
1 change: 1 addition & 0 deletions src/devices/korg_kaoss_dj/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON: u8 = 0x15;
const MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON: u8 = 0x16;
const MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON: u8 = 0x17;
const MIDI_DECK_MONITOR_BUTTON: u8 = 0x19;
const MIDI_DECK_SHIFT_BUTTON: u8 = 0x1a;
const MIDI_DECK_PLAYPAUSE_BUTTON: u8 = 0x1b;
const MIDI_DECK_SYNC_BUTTON: u8 = 0x1d;
const MIDI_DECK_CUE_BUTTON: u8 = 0x1e;
Expand Down
19 changes: 11 additions & 8 deletions src/devices/korg_kaoss_dj/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ use super::{
Deck, CONTROL_INDEX_DECK_A, CONTROL_INDEX_DECK_B, CONTROL_INDEX_DECK_BIT_MASK,
CONTROL_INDEX_ENUM_BIT_MASK, MIDI_COMMAND_CC, MIDI_COMMAND_NOTE_ON, MIDI_DECK_CUE_BUTTON,
MIDI_DECK_EQ_HI_KNOB, MIDI_DECK_EQ_LO_KNOB, MIDI_DECK_EQ_MID_KNOB, MIDI_DECK_GAIN_KNOB,
MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SYNC_BUTTON,
MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON,
MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON,
MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON,
MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON,
MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON, MIDI_MASTER_LEVEL_KNOB, MIDI_MONITOR_LEVEL_KNOB,
MIDI_MONITOR_MIX_KNOB, MIDI_STATUS_BUTTON_MAIN, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON,
MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SHIFT_BUTTON,
MIDI_DECK_SYNC_BUTTON, MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON,
MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON,
MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON,
MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON,
MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON,
MIDI_MASTER_LEVEL_KNOB, MIDI_MONITOR_LEVEL_KNOB, MIDI_MONITOR_MIX_KNOB,
MIDI_STATUS_BUTTON_MAIN, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON,
};
use crate::{
ControlIndex, ControlOutputGateway, ControlRegister, LedOutput, MidiOutputConnection,
Expand Down Expand Up @@ -54,10 +55,11 @@ impl MainLed {
#[derive(Debug, Clone, Copy, FromRepr, EnumIter, EnumCount)]
#[repr(u8)]
pub enum DeckLed {
MonitorButton,
ShiftButton,
PlayPauseButton,
SyncButton,
CueButton,
MonitorButton,
TouchStripLeftButton,
TouchStripCenterButton,
TouchStripRightButton,
Expand Down Expand Up @@ -163,6 +165,7 @@ pub fn led_output_into_midi_message(led: Led, output: LedOutput) -> [u8; 3] {
};
let data1 = match led {
DeckLed::MonitorButton => MIDI_DECK_MONITOR_BUTTON,
DeckLed::ShiftButton => MIDI_DECK_SHIFT_BUTTON,
DeckLed::PlayPauseButton => MIDI_DECK_PLAYPAUSE_BUTTON,
DeckLed::SyncButton => MIDI_DECK_SYNC_BUTTON,
DeckLed::CueButton => MIDI_DECK_CUE_BUTTON,
Expand Down

0 comments on commit 1d97577

Please sign in to comment.