fix play/pause
This commit is contained in:
parent
0f5c77bc3d
commit
749b66417d
1 changed files with 11 additions and 2 deletions
|
@ -158,13 +158,22 @@ class Playbin : GLib.Object {
|
|||
public void pause () {
|
||||
assert (this.state != PlaybinState.STOPPED);
|
||||
this.state = PlaybinState.PAUSED;
|
||||
assert (this.mpv.command ({"pause"}) >= 0);
|
||||
GLib.debug ("setting state to paused");
|
||||
// TODO: abstract away this handling around mpv api a bit for auto debug printing
|
||||
var ret = this.mpv.set_property_flag("pause", true);
|
||||
if (ret != 0) {
|
||||
GLib.debug ("failed to set state to paused (%d): %s\n", ret, ret.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
public void play () {
|
||||
assert (this.state != PlaybinState.STOPPED);
|
||||
this.state = PlaybinState.PLAYING;
|
||||
assert (this.mpv.command ({"play"}) >= 0);
|
||||
GLib.debug ("setting state to playing");
|
||||
var ret = this.mpv.set_property_flag("pause", false);
|
||||
if (ret != 0) {
|
||||
GLib.debug ("failed to set state to playing (%d): %s\n", ret, ret.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
public void next_track () {
|
||||
|
|
Loading…
Reference in a new issue