Switch visualizer display modes with Shift+M and polish the VFD panel
A new CycleVisualizerMode action (Shift+M by default) steps the fullscreen visualizer's display mode; the choice is saved in visualizations.toml and reaches scripts as input.mode. The VFD panel uses it for its classic, focus, minimal and tape modes, with a row of mode lamps after each change and a step-down when a mode does not fit the window. Polish: quieter signal-path lines with lit boxes and nodes, two-cell peak marks and a mid-level red zone in the level meter, A and Y in a 14-segment style with thin diagonals, an analyzer tint from warm amber in the bass to light yellow in the treble, and bar inertia that is separate from peak hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
204d17f14c
commit
2288392825
8 files changed
+240
-40
No files matched your search
@@ -32,6 +32,7 @@ pub enum Action {
|
||||
ToggleShuffle,
|
||||
CycleRepeat,
|
||||
ToggleVisualizer,
|
||||
CycleVisualizerMode,
|
||||
ToggleLike,
|
||||
ToggleTrackSelection,
|
||||
OpenTrackInfo,
|
||||
@@ -129,6 +130,7 @@ impl Action {
|
||||
| Action::ToggleShuffle
|
||||
| Action::CycleRepeat
|
||||
| Action::ToggleVisualizer
|
||||
| Action::CycleVisualizerMode
|
||||
| Action::OpenConnectedDevices
|
||||
| Action::OpenListenHistory => Category::Playback,
|
||||
Action::QueueAddNext
|
||||
@@ -228,6 +230,7 @@ impl Action {
|
||||
Action::ToggleShuffle => "Toggle shuffle".into(),
|
||||
Action::CycleRepeat => "Cycle repeat mode".into(),
|
||||
Action::ToggleVisualizer => "Toggle fullscreen visualizer".into(),
|
||||
Action::CycleVisualizerMode => "Next visualizer display mode".into(),
|
||||
Action::ToggleLike => "Like / unlike".into(),
|
||||
Action::ToggleTrackSelection => "Track line selection".into(),
|
||||
Action::OpenTrackInfo => "Track info".into(),
|
||||
|
||||
@@ -389,6 +389,18 @@ pub fn update(state: &mut AppState, action: Action) -> Option<Effect> {
|
||||
}
|
||||
None
|
||||
}
|
||||
Action::CycleVisualizerMode => {
|
||||
if state.visualizer.active {
|
||||
if let Err(err) = state.visualizer.cycle_mode() {
|
||||
// the fullscreen visualizer hides the status line
|
||||
tracing::warn!(error = %format!("{err:#}"), "saving the visualizer mode failed");
|
||||
state.status_message = Some(format!("visualization settings: {err:#}"));
|
||||
}
|
||||
} else {
|
||||
state.status_message = Some("open the visualizer first (Shift+L)".into());
|
||||
}
|
||||
None
|
||||
}
|
||||
Action::Select => select_current(state),
|
||||
Action::Back if state.visualizer.active => {
|
||||
state.visualizer.close();
|
||||
|
||||
@@ -776,6 +776,20 @@ fn visualizer_requires_current_track() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn visualizer_mode_needs_an_open_visualizer() {
|
||||
let mut state = AppState::default();
|
||||
let mode = state.visualizer.config.mode;
|
||||
|
||||
assert_eq!(update(&mut state, Action::CycleVisualizerMode), None);
|
||||
|
||||
assert_eq!(state.visualizer.config.mode, mode);
|
||||
assert_eq!(
|
||||
state.status_message.as_deref(),
|
||||
Some("open the visualizer first (Shift+L)")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn visualizer_toggles_and_back_closes_it() {
|
||||
let mut state = AppState::default();
|
||||
|
||||
Reference in new issue
Block a user