From d43857646dfb56de29e1d4fdfbb79f4eb70af5cf Mon Sep 17 00:00:00 2001 From: Erica Z Date: Fri, 18 Oct 2024 21:54:12 +0200 Subject: [PATCH] remove unused class --- src/playbin.vala | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/playbin.vala b/src/playbin.vala index 9fc9407..691eaab 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -4,15 +4,6 @@ enum PlaybinState { PLAYING, } -private class SourceFuncWrapper { - public SourceFunc inner; - - public SourceFuncWrapper () { - this.inner = null; - } -} - - class Playbin : GLib.Object { private Mpv.Handle mpv = new Mpv.Handle (); @@ -22,8 +13,12 @@ class Playbin : GLib.Object { public int volume { get { return _volume; } set { - _volume = value; - assert (mpv.set_property_int64 ("volume", value) >= 0); + var ret = mpv.set_property_int64 ("volume", value); + if (ret >= 0) { + _volume = value; + } else { + warning ("failed to set volume: %s", ret.to_string ()); + } } } @@ -31,8 +26,12 @@ class Playbin : GLib.Object { public bool mute { get { return _mute; } set { - _mute = value; - assert (mpv.set_property_flag ("mute", value) >= 0); + var ret = mpv.set_property_flag ("mute", value); + if (ret >= 0) { + _mute = value; + } else { + warning ("failed to set mute status: %s", ret.to_string ()); + } } } @@ -162,7 +161,7 @@ class Playbin : GLib.Object { // 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()); + GLib.debug ("failed to set state to paused (%d): %s", ret, ret.to_string()); } } @@ -172,7 +171,7 @@ class Playbin : GLib.Object { 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()); + GLib.debug ("failed to set state to playing (%d): %s", ret, ret.to_string()); } }