Skip to content

Commit

Permalink
Rename some input controls
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Aug 16, 2023
1 parent c48371e commit 693523c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ setup:
# Upgrade (and update) dependencies
upgrade: setup
pre-commit autoupdate
cargo upgrade
cargo upgrade --incompatible
cargo update

# Run pre-commit hooks
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repos:
warnings,
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
rev: v3.0.2
hooks:
- id: prettier
types_or:
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ edition = "2021"
include = ["/src", "/README.md", "/LICENSES"]

[dependencies]
anyhow = "1.0.72"
anyhow = "1.0.74"
derive_more = "0.99.17"
float-cmp = "0.9.0"
is_sorted = "0.1.1"
log = "0.4.20"
strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.44"
thiserror = "1.0.46"

# Optional dependencies
midir = { version = "0.9.1", optional = true }
Expand All @@ -31,7 +31,7 @@ crossbeam-utils = { version = "0.8.16", optional = true }
enum-as-inner = { version = "0.6.0", optional = true }

[dev-dependencies]
anyhow = "1.0.72"
anyhow = "1.0.74"
hidapi = "2.4.1"
pretty_env_logger = "0.5.0"

Expand Down
8 changes: 4 additions & 4 deletions src/devices/denon_dj_mc6000mk2/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ pub enum DeckSensor {
CueButton,
PlayPauseButton,
SyncButton,
VolumeFaderSlider,
JogWheelBendSliderEncoder,
JogWheelScratchSliderEncoder,
TrimKnobCenterSlider,
EqHiKnobCenterSlider,
EqLoKnobCenterSlider,
EqMidKnobCenterSlider,
EqHiKnobCenterSlider,
GainKnobCenterSlider,
VolumeFaderSlider,
}

#[derive(Debug)]
Expand Down Expand Up @@ -113,7 +113,7 @@ pub fn try_decode_midi_input(
}
MIDI_CMD_CC => match data1 {
0x01 | 0x07 | 0x0c | 0x11 => (
Sensor::Deck(deck, DeckSensor::TrimKnobCenterSlider),
Sensor::Deck(deck, DeckSensor::GainKnobCenterSlider),
CenterSliderInput::from_u7(data2).into(),
),
0x02 | 0x08 | 0x0d | 0x12 => (
Expand Down
25 changes: 13 additions & 12 deletions src/devices/korg_kaoss_dj/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ use strum::{EnumCount, EnumIter, FromRepr};
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_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_DECK_TRIM_KNOB,
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_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,
};
use crate::{
ButtonInput, CenterSliderInput, ControlIndex, ControlInputEvent, ControlRegister, ControlValue,
Expand Down Expand Up @@ -76,7 +77,7 @@ pub enum DeckSensor {
TouchWheelScratchButton,
VolumeFaderSlider,
TouchStripSlider,
TrimKnobCenterSlider,
GainKnobCenterSlider,
EqHiKnobCenterSlider,
EqLoKnobCenterSlider,
EqMidKnobCenterSlider,
Expand Down Expand Up @@ -287,8 +288,8 @@ pub fn try_decode_midi_input(
DeckSensor::PitchFaderCenterSlider,
CenterSliderInput::from_u7(data2).inverse().into(),
),
MIDI_DECK_TRIM_KNOB => (
DeckSensor::TrimKnobCenterSlider,
MIDI_DECK_GAIN_KNOB => (
DeckSensor::GainKnobCenterSlider,
CenterSliderInput::from_u7(data2).into(),
),
MIDI_DECK_EQ_HI_KNOB => (
Expand Down
2 changes: 1 addition & 1 deletion src/devices/korg_kaoss_dj/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const MIDI_DECK_PLAYPAUSE_BUTTON: u8 = 0x1b;
const MIDI_DECK_SYNC_BUTTON: u8 = 0x1d;
const MIDI_DECK_CUE_BUTTON: u8 = 0x1e;

const MIDI_DECK_TRIM_KNOB: u8 = 0x1a;
const MIDI_DECK_GAIN_KNOB: u8 = 0x1a;
const MIDI_DECK_EQ_HI_KNOB: u8 = 0x1b;
const MIDI_DECK_EQ_MID_KNOB: u8 = 0x1c;
const MIDI_DECK_EQ_LO_KNOB: u8 = 0x1d;
Expand Down
18 changes: 9 additions & 9 deletions src/devices/korg_kaoss_dj/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use strum::{EnumCount, EnumIter, FromRepr, IntoEnumIterator as _};
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_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_DECK_TRIM_KNOB,
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_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,
};
use crate::{
ControlIndex, ControlOutputGateway, ControlRegister, LedOutput, MidiOutputConnection,
Expand Down Expand Up @@ -175,7 +175,7 @@ pub fn led_output_into_midi_message(led: Led, output: LedOutput) -> [u8; 3] {
DeckLed::TouchStripLoopLeftButton => MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON,
DeckLed::TouchStripLoopRightButton => MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON,
DeckLed::TouchStripRightButton => MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON,
DeckLed::GainKnob => MIDI_DECK_TRIM_KNOB,
DeckLed::GainKnob => MIDI_DECK_GAIN_KNOB,
DeckLed::EqHiKnob => MIDI_DECK_EQ_HI_KNOB,
DeckLed::EqMidKnob => MIDI_DECK_EQ_MID_KNOB,
DeckLed::EqLoKnob => MIDI_DECK_EQ_LO_KNOB,
Expand Down

0 comments on commit 693523c

Please sign in to comment.