Commit 7e34347e authored by Jordan Petridis's avatar Jordan Petridis

Merge branch 'mpris-fix' into 'master'

add missing mpris callbacks / fix #115

Closes #115

See merge request !92
parents a113ed04 68fa547b
Pipeline #59943 passed with stages
in 37 minutes and 13 seconds
......@@ -588,7 +588,7 @@ impl PlayerWrapper {
fn connect_mpris_buttons(&self, sender: &Sender<Action>) {
let weak = Rc::downgrade(self);
// FIXME: Refference cycle with mpris
// FIXME: Reference cycle with mpris
let mpris = self.info.mpris.clone();
self.info.mpris.connect_play_pause(clone!(weak => move || {
let player = match weak.upgrade() {
......@@ -605,6 +605,24 @@ impl PlayerWrapper {
}
}));
self.info.mpris.connect_play(clone!(weak => move || {
let player = match weak.upgrade() {
Some(s) => s,
None => return
};
player.play();
}));
self.info.mpris.connect_pause(clone!(weak => move || {
let player = match weak.upgrade() {
Some(s) => s,
None => return
};
player.pause();
}));
self.info.mpris.connect_next(clone!(weak => move || {
weak.upgrade().map(|p| p.fast_forward());
}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment