mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-15 00:42:54 +01:00
settings: make the preamp easier to set exactly
The slider alone is awkward for the two things people actually do with a preamp: zero it, and nudge it by a known amount. - Minus and plus buttons flank the slider, stepping one grid notch (0.5 dB) and disabling at the ends. - A Reset button sits under it, beside the current value, disabled when the value is already zero. - Both go through the same snapping the slider does, so a button cannot land off the grid.
This commit is contained in:
@@ -34,6 +34,14 @@ class ReplayGainControlsTest {
|
||||
assertEquals(59, REPLAY_GAIN_PREAMP_STEPS)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun thePreampStepsAlongTheGridAndStopsAtTheEnds() {
|
||||
assertEquals(-1.5f, stepReplayGainPreampDb(-1f, -1), 0f)
|
||||
assertEquals(-0.5f, stepReplayGainPreampDb(-1f, 1), 0f)
|
||||
assertEquals(MIN_REPLAY_GAIN_PREAMP_DB, stepReplayGainPreampDb(MIN_REPLAY_GAIN_PREAMP_DB, -1), 0f)
|
||||
assertEquals(MAX_REPLAY_GAIN_PREAMP_DB, stepReplayGainPreampDb(MAX_REPLAY_GAIN_PREAMP_DB, 1), 0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun thePreampSnapsBackOntoTheHalfDecibelGrid() {
|
||||
assertEquals(0f, snapReplayGainPreampDb(-0f), 0f)
|
||||
|
||||
Reference in New Issue
Block a user