Compare commits
No commits in common. "ab040e6af044a1452a3397b8d883ce97bf0ee7c0" and "f016778f5eba8cb1f8bcfcde7ecf1a0462a53d54" have entirely different histories.
ab040e6af0
...
f016778f5e
2 changed files with 15 additions and 8 deletions
4
build.rs
4
build.rs
|
@ -26,9 +26,9 @@ fn main() {
|
|||
let output = command.output().unwrap();
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"blueprint-compiler failed with exit status {} and stdout:\n{}",
|
||||
"blueprint-compiler failed with exit status {} and stderr:\n{}",
|
||||
output.status,
|
||||
String::from_utf8_lossy(&output.stdout)
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
|
||||
println!("cargo::rerun-if-changed=resources");
|
||||
|
|
|
@ -64,7 +64,6 @@ mod imp {
|
|||
mpv.observe_property(2, "pause").unwrap();
|
||||
mpv.observe_property(3, "playlist-pos").unwrap();
|
||||
mpv.observe_property(4, "idle-active").unwrap();
|
||||
mpv.observe_property(5, "time-pos").unwrap();
|
||||
|
||||
// "Useful to drain property changes before a new file is loaded."
|
||||
mpv.add_hook(0, "on_before_start_file", 0).unwrap();
|
||||
|
@ -148,11 +147,6 @@ mod imp {
|
|||
window.notify("idle-active");
|
||||
}
|
||||
|
||||
5 => {
|
||||
assert_eq!(event.name, "time-pos");
|
||||
window.notify("time-pos");
|
||||
}
|
||||
|
||||
_ => unreachable!(),
|
||||
},
|
||||
|
||||
|
@ -251,6 +245,19 @@ mod imp {
|
|||
.await
|
||||
.expect("could not register name in session bus");
|
||||
});
|
||||
|
||||
// notify of new time-pos every 100 ms
|
||||
glib::source::timeout_add_local(std::time::Duration::from_millis(100), {
|
||||
let window = self.obj().downgrade();
|
||||
move || {
|
||||
let window = match window.upgrade() {
|
||||
None => return glib::ControlFlow::Break,
|
||||
Some(window) => window,
|
||||
};
|
||||
window.notify("time-pos");
|
||||
glib::ControlFlow::Continue
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue