From d722e4d1055745dee4c2c70c415a3e7cae388af9 Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 18 Nov 2024 16:49:40 +0100 Subject: [PATCH] some tgts --- src/ui/window.rs | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/ui/window.rs b/src/ui/window.rs index 73660de..37d87eb 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -621,7 +621,11 @@ mod imp { self.state.set(State::Idle); self.duration.set(0.0); - event!(Level::DEBUG, "duration is now 0 (idle active)"); + event!( + target: "audrey::playback", + Level::DEBUG, + "duration is now 0 (idle active)" + ); self.obj().notify("duration"); self.obj().set_playing_cover_art(None::); @@ -644,13 +648,13 @@ mod imp { // make sure this is reported as 0 self.obj().notify("time-pos"); - event!(Level::INFO, "StartFile"); + event!(target: "audrey::playback", Level::DEBUG, "StartFile"); self.obj().notify("song"); self.buffering_start(); let duration = self.obj().song().unwrap().duration() as f64; self.duration.set(duration); - event!(Level::TRACE, "duration is now {duration} (from subsonic)"); + event!(target: "audrey::playback", Level::DEBUG, "duration is now {duration} (from subsonic)"); self.obj().notify("duration"); let window = self.obj().clone(); @@ -732,7 +736,7 @@ mod imp { } fn on_seek(&self) { - event!(Level::INFO, "Seek"); + event!(target: "audrey::playback", Level::DEBUG, "Seek"); match self.state.get() { State::Active => {} @@ -755,18 +759,26 @@ mod imp { } self.state.set(State::Active); - event!(Level::INFO, "PlaybackRestart"); + event!(target: "audrey::playback", Level::DEBUG, "PlaybackRestart"); self.buffering_end(); if let Some(queued_seek) = self.queued_seek.take() { // a seek was tried before and failed, try again now - event!(Level::INFO, "performing queued seek to {queued_seek}"); + event!( + target: "audrey::playback", + Level::DEBUG, + "performing queued seek to {queued_seek}" + ); self.obj().seek(queued_seek); } } fn on_end_file(&self, event: crate::mpv::event::EndFileEvent) { - event!(Level::INFO, "EndFile: {event:?}"); + event!( + target: "audrey::playback", + Level::DEBUG, + "Endfile: {event:?}" + ); match self.state.get() { State::Active => {} @@ -921,7 +933,11 @@ impl Window { } State::FileLoading => { - event!(Level::INFO, "queuing seek to {new_position}"); + event!( + target: "audrey::playback", + Level::DEBUG, + "queueing seek to {new_position}" + ); self.imp().queued_seek.set(Some(new_position)); self.notify("time-pos"); } @@ -951,7 +967,11 @@ impl Window { new_position = duration; } - event!(Level::INFO, "queuing seek to {new_position}"); + event!( + target: "audrey::playback", + Level::DEBUG, + "queueing seek to {new_position}" + ); self.imp().queued_seek.set(Some(new_position)); self.notify("time-pos"); }