From ba1e3707fce24e67da9a5cbf8e57cb2f753fc591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 10 Nov 2026 05:49:30 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20The=20equalizer=20card=20holds=2020?= =?UTF-8?q?=20bands=20like=20the=20MCP=20eq=20op;=20shift+digit=20picks=20?= =?UTF-8?q?bands=2011-20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/app/src/audio_cards.rs | 9 +++------ crates/app/src/player/cards.rs | 14 ++++++++------ crates/app/src/tests/cards.rs | 6 ++---- crates/app/src/ui/cards/eq.rs | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/crates/app/src/audio_cards.rs b/crates/app/src/audio_cards.rs index 55bd787..5716b8a 100644 --- a/crates/app/src/audio_cards.rs +++ b/crates/app/src/audio_cards.rs @@ -290,12 +290,9 @@ pub(crate) const EQ_W_MAX: f32 = 720.; /// rather than as a second window: it takes the width it can get inside that. pub(crate) const EQ_W_MARGIN: f32 = 32.; -/// How many bands one clip's equalizer may carry from this card. Ten because -/// the keyboard picks a band with a digit and a keyboard has ten of them -- -/// past that a band would be reachable by pointer only. The engine itself caps -/// nothing (`EqParams::bands` is a plain `Vec`), so a file may still carry more -/// and this card will draw and edit every one it finds. -pub(crate) const EQ_BANDS_MAX: usize = 10; +/// How many bands one clip's equalizer may carry from this card: a digit picks +/// bands 1-10 and shift+digit 11-20, the same cap as the MCP `eq` op. +pub(crate) const EQ_BANDS_MAX: usize = 20; /// One press of the frequency keys, as a factor: a sixth of an octave, so a /// band walks the whole axis in about sixty presses and still lands close diff --git a/crates/app/src/player/cards.rs b/crates/app/src/player/cards.rs index 50ade7e..22514ab 100644 --- a/crates/app/src/player/cards.rs +++ b/crates/app/src/player/cards.rs @@ -4059,14 +4059,16 @@ impl Player { // the card *shows*, so it survives no further than this // window. self.eq_spectrum = !self.eq_spectrum; - } else if let Ok(digit) = key.parse::() { - // As the keys are laid out: 1-9 then 0 for the tenth, which - // is the cap ([`EQ_BANDS_MAX`]). A digit past the last band - // picks nothing rather than panics. + } else if let Some((digit, shifted)) = key + .parse::() + .ok() + .map(|d| (d, shift)) + .or_else(|| ")!@#$%^&*(".find(key).filter(|_| key.len() == 1).map(|d| (d, true))) + { let band = match digit { - 0 => EQ_BANDS_MAX - 1, + 0 => 9, n => n - 1, - }; + } + if shifted { 10 } else { 0 }; if band < self.eq_params.bands.len() { self.eq_band = band; } diff --git a/crates/app/src/tests/cards.rs b/crates/app/src/tests/cards.rs index f3ff5ae..a9ed68b 100644 --- a/crates/app/src/tests/cards.rs +++ b/crates/app/src/tests/cards.rs @@ -679,12 +679,10 @@ fn a_band_can_be_moved_added_and_reached() { "landed at {between:?}, not between 100 and 4000" ); - // Every band the card will hold is one digit away: the keyboard has ten - // digits, which is exactly why the cap is what it is. const { assert!( - EQ_BANDS_MAX <= 10, - "a band past the tenth has no key that picks it" + EQ_BANDS_MAX <= 20, + "a band past the twentieth has no key that picks it" ); } assert!(EQ_BANDS_MAX > EqParams::default_layout().bands.len()); diff --git a/crates/app/src/ui/cards/eq.rs b/crates/app/src/ui/cards/eq.rs index 3b8ade4..25837c2 100644 --- a/crates/app/src/ui/cards/eq.rs +++ b/crates/app/src/ui/cards/eq.rs @@ -307,7 +307,7 @@ impl Player { d.child(dark_card_head_reset( "Equalizer", Some(format!("{} clip {}", lane.label(), idx + 1).into()), - Some("drag a handle, or a digit picks a band — ←→ moves it, ↑↓ its gain, shift+←→ its width; a adds, x removes, f flattens it, r all, s spectrum, m fills the room".into()), + Some("drag a handle, or a digit picks a band (shift+digit 11–20) — ←→ moves it, ↑↓ its gain, shift+←→ its width; a adds, x removes, f flattens it, r all, s spectrum, m fills the room".into()), Some(self.card_maximized), Some(reset_eq_layout), cx,