diff --git a/src/player/ui.rs b/src/player/ui.rs index dc92af8..78d417c 100644 --- a/src/player/ui.rs +++ b/src/player/ui.rs @@ -131,7 +131,7 @@ async fn interface(player: Arc, minimalist: bool) -> eyre::Result<()> { VOLUME_TIMER.store(0, Ordering::Relaxed); } - let controls = components::controls(WIDTH); + let controls = components::controls(&player, WIDTH); let menu = if minimalist { vec![action, middle] diff --git a/src/player/ui/components.rs b/src/player/ui/components.rs index 10d7af8..736ea8a 100644 --- a/src/player/ui/components.rs +++ b/src/player/ui/components.rs @@ -103,8 +103,9 @@ pub fn action(player: &Player, width: usize) -> String { } /// Creates the bottom controls bar, and also spaces it properly. -pub fn controls(width: usize) -> String { - let controls = [["[s]", "kip"], ["[p]", "ause"], ["[q]", "uit"]]; +pub fn controls(player: &Player, width: usize) -> String { + let play_pause = if player.sink.is_paused() { ["[p]", "lay "] } else { ["[p]", "ause"] }; + let controls = [["[s]", "kip"], play_pause, ["[q]", "uit"]]; let len: usize = controls.concat().iter().map(|x| x.len()).sum(); let controls = controls.map(|x| format!("{}{}", x[0].bold(), x[1]));