From f4157d24d1a5ea4082fe0c29d15bb3a9decc03f8 Mon Sep 17 00:00:00 2001 From: hheik <4469778+hheik@users.noreply.github.com> Date: Wed, 27 Sep 2023 00:51:28 +0300 Subject: [PATCH] Small restructuring --- src/client/app.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/client/app.rs b/src/client/app.rs index b9cd085..cb4d1e6 100644 --- a/src/client/app.rs +++ b/src/client/app.rs @@ -106,18 +106,28 @@ pub struct TrackMetadata { pub duration: Option, } -#[derive(Default)] pub struct PlayerState { pub currently_playing: Option, pub is_playing: bool, pub time_ratio: f64, } +impl Default for PlayerState { + fn default() -> Self { + Self { + currently_playing: None, + is_playing: false, + time_ratio: 0.0, + } + } +} + impl PlayerState { pub fn play(&mut self, path: &str) { self.currently_playing = Some(path.to_string()); self.is_playing = true; self.time_ratio = 0.0; + // TODO: Handle audio } pub fn toggle_pause(&mut self) {