From 33fa7b9b260eed47123d5dd0013fe65d31a00876 Mon Sep 17 00:00:00 2001 From: Samuel Oldham <77629938+SO9010@users.noreply.github.com> Date: Mon, 7 Oct 2024 05:29:19 +0100 Subject: [PATCH] Lyrics support (#535) * Cache lyrics and add ability to skip to position in song via lyrics * Better formatting for lyrics and fix initialization * Add music note button to show lyrics. * Toggle lyrics --------- Co-authored-by: SO9010 Co-authored-by: Jackson Goode --- psst-gui/build.rs | 2 +- psst-gui/src/cmd.rs | 2 + psst-gui/src/controller/nav.rs | 4 +- psst-gui/src/controller/playback.rs | 22 +++++- psst-gui/src/data/mod.rs | 4 +- psst-gui/src/data/nav.rs | 5 ++ psst-gui/src/data/track.rs | 9 +++ psst-gui/src/ui/home.rs | 52 +++++++------- psst-gui/src/ui/lyrics.rs | 108 ++++++++++++++++++++++++++++ psst-gui/src/ui/mod.rs | 5 ++ psst-gui/src/ui/playback.rs | 19 +++-- psst-gui/src/webapi/client.rs | 32 ++++++++- psst-gui/src/webapi/local.rs | 1 + psst-gui/src/widget/icons.rs | 7 ++ 14 files changed, 233 insertions(+), 39 deletions(-) create mode 100644 psst-gui/src/ui/lyrics.rs diff --git a/psst-gui/build.rs b/psst-gui/build.rs index 1870fcd1..1499033f 100644 --- a/psst-gui/build.rs +++ b/psst-gui/build.rs @@ -21,7 +21,7 @@ fn add_windows_icon() { res.compile().expect("Could not attach exe icon"); fn load_images() -> Vec> { - let sizes = vec![32, 64, 128, 256]; + let sizes = [32, 64, 128, 256]; sizes .iter() .map(|s| { diff --git a/psst-gui/src/cmd.rs b/psst-gui/src/cmd.rs index 65957e13..ce6bd0cb 100644 --- a/psst-gui/src/cmd.rs +++ b/psst-gui/src/cmd.rs @@ -32,6 +32,7 @@ pub const LOG_OUT: Selector = Selector::new("app.log-out"); pub const NAVIGATE: Selector