some tgts
This commit is contained in:
parent
cda570f558
commit
d722e4d105
1 changed files with 29 additions and 9 deletions
|
@ -621,7 +621,11 @@ mod imp {
|
||||||
self.state.set(State::Idle);
|
self.state.set(State::Idle);
|
||||||
|
|
||||||
self.duration.set(0.0);
|
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().notify("duration");
|
||||||
|
|
||||||
self.obj().set_playing_cover_art(None::<gdk::Texture>);
|
self.obj().set_playing_cover_art(None::<gdk::Texture>);
|
||||||
|
@ -644,13 +648,13 @@ mod imp {
|
||||||
// make sure this is reported as 0
|
// make sure this is reported as 0
|
||||||
self.obj().notify("time-pos");
|
self.obj().notify("time-pos");
|
||||||
|
|
||||||
event!(Level::INFO, "StartFile");
|
event!(target: "audrey::playback", Level::DEBUG, "StartFile");
|
||||||
self.obj().notify("song");
|
self.obj().notify("song");
|
||||||
self.buffering_start();
|
self.buffering_start();
|
||||||
|
|
||||||
let duration = self.obj().song().unwrap().duration() as f64;
|
let duration = self.obj().song().unwrap().duration() as f64;
|
||||||
self.duration.set(duration);
|
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");
|
self.obj().notify("duration");
|
||||||
|
|
||||||
let window = self.obj().clone();
|
let window = self.obj().clone();
|
||||||
|
@ -732,7 +736,7 @@ mod imp {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_seek(&self) {
|
fn on_seek(&self) {
|
||||||
event!(Level::INFO, "Seek");
|
event!(target: "audrey::playback", Level::DEBUG, "Seek");
|
||||||
|
|
||||||
match self.state.get() {
|
match self.state.get() {
|
||||||
State::Active => {}
|
State::Active => {}
|
||||||
|
@ -755,18 +759,26 @@ mod imp {
|
||||||
}
|
}
|
||||||
self.state.set(State::Active);
|
self.state.set(State::Active);
|
||||||
|
|
||||||
event!(Level::INFO, "PlaybackRestart");
|
event!(target: "audrey::playback", Level::DEBUG, "PlaybackRestart");
|
||||||
self.buffering_end();
|
self.buffering_end();
|
||||||
|
|
||||||
if let Some(queued_seek) = self.queued_seek.take() {
|
if let Some(queued_seek) = self.queued_seek.take() {
|
||||||
// a seek was tried before and failed, try again now
|
// 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);
|
self.obj().seek(queued_seek);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_end_file(&self, event: crate::mpv::event::EndFileEvent) {
|
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() {
|
match self.state.get() {
|
||||||
State::Active => {}
|
State::Active => {}
|
||||||
|
@ -921,7 +933,11 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
State::FileLoading => {
|
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.imp().queued_seek.set(Some(new_position));
|
||||||
self.notify("time-pos");
|
self.notify("time-pos");
|
||||||
}
|
}
|
||||||
|
@ -951,7 +967,11 @@ impl Window {
|
||||||
new_position = duration;
|
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.imp().queued_seek.set(Some(new_position));
|
||||||
self.notify("time-pos");
|
self.notify("time-pos");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue