forge
Explore
Log in

Don't you dare go Hollow

✨ The equalizer card holds 20 bands like the MCP eq op; shift+digit picks bands 11-20

Browse files at this commit

ba1e3707fce24e67da9a5cbf8e57cb2f753fc591Ahmet Kaan GümüşParent: 2ced44a
crates/app/src/audio_cards.rsmodified+3 -6
@@ -290,12 +290,9 @@ pub(crate) const EQ_W_MAX: f32 = 720.;
290290 /// rather than as a second window: it takes the width it can get inside that.
291291 pub(crate) const EQ_W_MARGIN: f32 = 32.;
292292
293-/// How many bands one clip's equalizer may carry from this card. Ten because
294-/// the keyboard picks a band with a digit and a keyboard has ten of them --
295-/// past that a band would be reachable by pointer only. The engine itself caps
296-/// nothing (`EqParams::bands` is a plain `Vec`), so a file may still carry more
297-/// and this card will draw and edit every one it finds.
298-pub(crate) const EQ_BANDS_MAX: usize = 10;
293+/// How many bands one clip's equalizer may carry from this card: a digit picks
294+/// bands 1-10 and shift+digit 11-20, the same cap as the MCP `eq` op.
295+pub(crate) const EQ_BANDS_MAX: usize = 20;
299296
300297 /// One press of the frequency keys, as a factor: a sixth of an octave, so a
301298 /// band walks the whole axis in about sixty presses and still lands close
crates/app/src/player/cards.rsmodified+8 -6
@@ -4059,14 +4059,16 @@ impl Player {
40594059 // the card *shows*, so it survives no further than this
40604060 // window.
40614061 self.eq_spectrum = !self.eq_spectrum;
4062- } else if let Ok(digit) = key.parse::<usize>() {
4063- // As the keys are laid out: 1-9 then 0 for the tenth, which
4064- // is the cap ([`EQ_BANDS_MAX`]). A digit past the last band
4065- // picks nothing rather than panics.
4062+ } else if let Some((digit, shifted)) = key
4063+ .parse::<usize>()
4064+ .ok()
4065+ .map(|d| (d, shift))
4066+ .or_else(|| ")!@#$%^&*(".find(key).filter(|_| key.len() == 1).map(|d| (d, true)))
4067+ {
40664068 let band = match digit {
4067- 0 => EQ_BANDS_MAX - 1,
4069+ 0 => 9,
40684070 n => n - 1,
4069- };
4071+ } + if shifted { 10 } else { 0 };
40704072 if band < self.eq_params.bands.len() {
40714073 self.eq_band = band;
40724074 }
crates/app/src/tests/cards.rsmodified+2 -4
@@ -679,12 +679,10 @@ fn a_band_can_be_moved_added_and_reached() {
679679 "landed at {between:?}, not between 100 and 4000"
680680 );
681681
682- // Every band the card will hold is one digit away: the keyboard has ten
683- // digits, which is exactly why the cap is what it is.
684682 const {
685683 assert!(
686- EQ_BANDS_MAX <= 10,
687- "a band past the tenth has no key that picks it"
684+ EQ_BANDS_MAX <= 20,
685+ "a band past the twentieth has no key that picks it"
688686 );
689687 }
690688 assert!(EQ_BANDS_MAX > EqParams::default_layout().bands.len());
crates/app/src/ui/cards/eq.rsmodified+1 -1
@@ -307,7 +307,7 @@ impl Player {
307307 d.child(dark_card_head_reset(
308308 "Equalizer",
309309 Some(format!("{} clip {}", lane.label(), idx + 1).into()),
310- 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()),
310+ 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()),
311311 Some(self.card_maximized),
312312 Some(reset_eq_layout),
313313 cx,