From 85a7764a2aeba260e2a2531dd28be66ec0680d6f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Sat, 7 Aug 2010 12:03:26 +0100 Subject: starting on the re write for mpris handling --- src/mpris-controller-v2.vala | 28 --------- src/mpris2-controller.vala | 139 +++++++++++++++++++++++++++++++++++++++++++ src/player-controller.vala | 1 + src/sound-service.c | 4 +- 4 files changed, 142 insertions(+), 30 deletions(-) delete mode 100644 src/mpris-controller-v2.vala create mode 100644 src/mpris2-controller.vala (limited to 'src') diff --git a/src/mpris-controller-v2.vala b/src/mpris-controller-v2.vala deleted file mode 100644 index efb5084..0000000 --- a/src/mpris-controller-v2.vala +++ /dev/null @@ -1,28 +0,0 @@ -/* -This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel. -Copyright 2010 Canonical Ltd. - -Authors: - Conor Curran - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see . -*/ -using Gee; - -public class MprisControllerV2 : MprisController -{ - public MprisControllerV2(PlayerController ctrl, string inter="org.mpris.MediaPlayer.Player"){ - Object(owner: ctrl, mpris_interface: inter); - } - -} diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala new file mode 100644 index 0000000..4430776 --- /dev/null +++ b/src/mpris2-controller.vala @@ -0,0 +1,139 @@ +/* +This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel. +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ +using Gee; +/* + This class will entirely replace mpris-controller.vala hence why there is no + point in trying to get encorporate both into the same object model. + */ +public class Mpris2Controller +{ + private DBus.Connection connection; + public dynamic DBus.Object mpris_root + public dynamic DBus.Object mpris_player + public PlayerController owner {get; construct;} + + public Mpris2Controller(PlayerController ctrl) + { + Object(owner: ctrl); + } + + construct{ + try { + this.connection = DBus.Bus.get (DBus.BusType.SESSION); + } catch (Error e) { + error("Problems connecting to the session bus - %s", e.message); + } + this.mpris_root = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()), + "/org/mpris/MediaPlayer", + "org.mpris.MediaPlayer"); + + this.mpris_player = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()) , + "/org/mpris/MediaPlayer/Player", + "org.mpris.MediaPlayer.Player"); + + + this.mpris_player.TrackChange += onTrackChange; + this.mpris_player.StatusChange += onStatusChange; + initial_update(); + } + + private void initial_update() + { + status st = this.mpris_player.Status; + int play_state = st.playback; + debug("GetStatusChange - play state %i", play_state); + (this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(play_state); + this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris_player.GetMetadata(), + MetadataMenuitem.attributes_format()); + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(), + ScrubMenuitem.attributes_format()); + // temporary fix + ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + scrub.update_position(this.mpris_player.PositionGet()); + } + + public void transport_event(TransportMenuitem.action command) + { + debug("transport_event input = %i", (int)command); + if(command == TransportMenuitem.action.PLAY_PAUSE){ + debug("transport_event PLAY_PAUSE"); + this.mpris_player.Pause(); + } + else if(command == TransportMenuitem.action.PREVIOUS){ + this.mpris_player.Prev(); + } + else if(command == TransportMenuitem.action.NEXT){ + this.mpris_player.Next(); + } + } + + public void set_position(double position) + { + debug("Set position with pos (0-100) %f", position); + HashTable data = this.mpris_player.GetMetadata(); + Value? time_value = data.lookup("time"); + if(time_value == null){ + warning("Can't fetch the duration of the track therefore cant set the position"); + return; + } + uint32 total_time = time_value.get_uint(); + debug("total time of track = %i", (int)total_time); + double new_time_position = total_time * position/100.0; + debug("new position = %f", (new_time_position * 1000)); + this.mpris_player.PositionSet((int32)(new_time_position)); + ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + scrub.update_position(this.mpris_player.PositionGet()); + } + + public bool connected() + { + return (this.mpris_player != null); + } + + private void onStatusChange(dynamic DBus.Object mpris_client, status st) + { + debug("onStatusChange - signal received"); + status* status = &st; + unowned ValueArray ar = (ValueArray)status; + int play_state = ar.get_nth(0).get_int(); + debug("onStatusChange - play state %i", play_state); + HashTable ht = new HashTable(str_hash, str_equal); + Value v = Value(typeof(int)); + v.set_int(play_state); + ht.insert("state", v); + this.owner.custom_items[PlayerController.widget_order.TRANSPORT].update(ht, TransportMenuitem.attributes_format()); + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); + } + + private void onTrackChange(dynamic DBus.Object mpris_client, HashTable ht) + { + debug("onTrackChange"); + this.owner.custom_items[PlayerController.widget_order.METADATA].reset(MetadataMenuitem.attributes_format()); + this.owner.custom_items[PlayerController.widget_order.SCRUB].reset(ScrubMenuitem.attributes_format()); + this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, + MetadataMenuitem.attributes_format()); + debug("about to update the duration on the scrub bar"); + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(), + ScrubMenuitem.attributes_format()); + // temporary fix + ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + scrub.update_position(this.mpris_player.PositionGet()); + } +} diff --git a/src/player-controller.vala b/src/player-controller.vala index fc5ca9b..1dac937 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -102,6 +102,7 @@ public class PlayerController : GLib.Object return; } + if(this.name == "Vlc"){ debug("establishing a vlc mpris controller"); this.mpris_adaptor = new MprisController(this, "org.mpris.MediaPlayer.Player"); diff --git a/src/sound-service.c b/src/sound-service.c index 8768cd3..16fa87c 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -42,8 +42,8 @@ service_shutdown (IndicatorService *service, gpointer user_data) if (mainloop != NULL) { g_debug("Service shutdown !"); // TODO: uncomment for release !! - close_pulse_activites(); - g_main_loop_quit(mainloop); + //close_pulse_activites(); + //g_main_loop_quit(mainloop); } return; } -- cgit v1.2.3 From 383f76b32f0e58da4051a111bd51d01d58fd7e10 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Sat, 7 Aug 2010 14:57:47 +0100 Subject: mpris 2 underway, vala bindings proving troublesome --- src/Makefile.am | 2 +- src/mpris2-controller.vala | 62 +++++++++++++++++++++++++++------------------- src/player-controller.vala | 6 ++--- 3 files changed, 41 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index ce7a580..0f2962a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -65,8 +65,8 @@ music_bridge_VALASOURCES = \ scrub-menu-item.vala \ title-menu-item.vala \ player-controller.vala \ - mpris-controller-v2.vala \ mpris-controller.vala \ + mpris2-controller.vala \ player-item.vala \ familiar-players-db.vala diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 4430776..8a5f255 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -22,12 +22,20 @@ using Gee; This class will entirely replace mpris-controller.vala hence why there is no point in trying to get encorporate both into the same object model. */ -public class Mpris2Controller +public class Mpris2Controller : GLib.Object { private DBus.Connection connection; - public dynamic DBus.Object mpris_root - public dynamic DBus.Object mpris_player + public dynamic DBus.Object mpris2_root {get; construct;} + public dynamic DBus.Object mpris2_player {get; construct;} public PlayerController owner {get; construct;} + + struct status { + public int32 playback; + public double shuffle; + public bool repeat; + public bool endless; + public bool endlessy; + } public Mpris2Controller(PlayerController ctrl) { @@ -36,37 +44,39 @@ public class Mpris2Controller construct{ try { + debug("going to create this mpris 2 controller"); this.connection = DBus.Bus.get (DBus.BusType.SESSION); } catch (Error e) { error("Problems connecting to the session bus - %s", e.message); } - this.mpris_root = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()), + this.mpris2_root = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()), "/org/mpris/MediaPlayer", "org.mpris.MediaPlayer"); - this.mpris_player = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()) , + this.mpris2_player = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()) , "/org/mpris/MediaPlayer/Player", - "org.mpris.MediaPlayer.Player"); + "org.mpris.MediaPlayer.Player"); - this.mpris_player.TrackChange += onTrackChange; - this.mpris_player.StatusChange += onStatusChange; + this.mpris2_player.TrackChange += onTrackChange; + this.mpris2_player.StatusChange += onStatusChange; initial_update(); } private void initial_update() { - status st = this.mpris_player.Status; + status st = {0,0.0, false, false,false}; + this.mpris2_player.get("Status", &st); + int play_state = st.playback; debug("GetStatusChange - play state %i", play_state); (this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(play_state); - this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris_player.GetMetadata(), - MetadataMenuitem.attributes_format()); - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(), - ScrubMenuitem.attributes_format()); - // temporary fix + this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris2_player.GetMetadata(), + MetadataMenuitem.attributes_format()); + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.GetMetadata(), + ScrubMenuitem.attributes_format()); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris_player.PositionGet()); + scrub.update_position(this.mpris2_player.PositionGet()); } public void transport_event(TransportMenuitem.action command) @@ -74,20 +84,20 @@ public class Mpris2Controller debug("transport_event input = %i", (int)command); if(command == TransportMenuitem.action.PLAY_PAUSE){ debug("transport_event PLAY_PAUSE"); - this.mpris_player.Pause(); + this.mpris2_player.Pause(); } else if(command == TransportMenuitem.action.PREVIOUS){ - this.mpris_player.Prev(); + this.mpris2_player.Prev(); } else if(command == TransportMenuitem.action.NEXT){ - this.mpris_player.Next(); + this.mpris2_player.Next(); } } public void set_position(double position) { debug("Set position with pos (0-100) %f", position); - HashTable data = this.mpris_player.GetMetadata(); + HashTable data = this.mpris2_player.GetMetadata(); Value? time_value = data.lookup("time"); if(time_value == null){ warning("Can't fetch the duration of the track therefore cant set the position"); @@ -97,14 +107,15 @@ public class Mpris2Controller debug("total time of track = %i", (int)total_time); double new_time_position = total_time * position/100.0; debug("new position = %f", (new_time_position * 1000)); - this.mpris_player.PositionSet((int32)(new_time_position)); + this.mpris2_player.SetPosition((int32)(new_time_position)); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris_player.PositionGet()); + scrub.update_position(this.mpris2_player.PositionGet()); + } public bool connected() { - return (this.mpris_player != null); + return (this.mpris2_player != null); } private void onStatusChange(dynamic DBus.Object mpris_client, status st) @@ -120,6 +131,7 @@ public class Mpris2Controller ht.insert("state", v); this.owner.custom_items[PlayerController.widget_order.TRANSPORT].update(ht, TransportMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); + } private void onTrackChange(dynamic DBus.Object mpris_client, HashTable ht) @@ -130,10 +142,10 @@ public class Mpris2Controller this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, MetadataMenuitem.attributes_format()); debug("about to update the duration on the scrub bar"); - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(), + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.GetMetadata(), ScrubMenuitem.attributes_format()); - // temporary fix ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris_player.PositionGet()); + scrub.update_position(this.mpris2_player.PositionGet()); + } } diff --git a/src/player-controller.vala b/src/player-controller.vala index 1dac937..60f27ca 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -48,7 +48,7 @@ public class PlayerController : GLib.Object private Dbusmenu.Menuitem root_menu; public string name { get; set;} public ArrayList custom_items; - public MprisController mpris_adaptor; + public Mpris2Controller mpris_adaptor; public AppInfo? app_info { get; set;} public int menu_offset { get; set;} @@ -105,10 +105,10 @@ public class PlayerController : GLib.Object if(this.name == "Vlc"){ debug("establishing a vlc mpris controller"); - this.mpris_adaptor = new MprisController(this, "org.mpris.MediaPlayer.Player"); + this.mpris_adaptor = new Mpris2Controller(this); } else{ - this.mpris_adaptor = new MprisController(this); + //this.mpris_adaptor = new MprisController(this); } // TODO refactor if(this.mpris_adaptor.connected() == true){ -- cgit v1.2.3 From e5a739d750c38bdcb1eb033fc9749f1228d9286c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 9 Aug 2010 14:58:10 +0100 Subject: trying to get a static client implementation working --- src/mpris2-controller.vala | 89 +++++++++++++++++++++++++++++++--------------- src/player-controller.vala | 4 +-- 2 files changed, 62 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 8a5f255..4555fca 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -18,6 +18,29 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ using Gee; + +/*struct Status { + public int32 playback; + public double shuffle; + public bool repeat; + public bool endless; + public bool endlessy; +}*/ + +[DBus (name = "org.mpris.mediaplayers.vlc")] +public interface MprisPlayer : Object { + public abstract struct Status { + public int32 Playback_State; + public double Playback_Rate; + public bool Repeat_State; + public bool Shuffle_State; + public bool Endless_State; + } + + + //public abstract struct Status () throws DBus.Error; +} + /* This class will entirely replace mpris-controller.vala hence why there is no point in trying to get encorporate both into the same object model. @@ -26,16 +49,16 @@ public class Mpris2Controller : GLib.Object { private DBus.Connection connection; public dynamic DBus.Object mpris2_root {get; construct;} - public dynamic DBus.Object mpris2_player {get; construct;} + public MprisPlayer mpris2_player {get; construct;} public PlayerController owner {get; construct;} - struct status { - public int32 playback; - public double shuffle; - public bool repeat; - public bool endless; - public bool endlessy; - } + /*struct status { + public int32 Playback_State; + public double Playback_Rate; + public bool Repeat_State; + public bool Shuffle_State; + public bool Endless_State; + }*/ public Mpris2Controller(PlayerController ctrl) { @@ -53,34 +76,38 @@ public class Mpris2Controller : GLib.Object "/org/mpris/MediaPlayer", "org.mpris.MediaPlayer"); - this.mpris2_player = this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()) , - "/org/mpris/MediaPlayer/Player", - "org.mpris.MediaPlayer.Player"); - - - this.mpris2_player.TrackChange += onTrackChange; - this.mpris2_player.StatusChange += onStatusChange; + this.mpris2_player = (MprisPlayer)this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()) , + "/org/mpris/MediaPlayer/Player", + "org.mpris.MediaPlayer.Player"); + //this.mpris2_player.TrackChange += onTrackChange; + //this.mpris2_player.StatusChange += onStatusChange; initial_update(); } private void initial_update() { - status st = {0,0.0, false, false,false}; - this.mpris2_player.get("Status", &st); + //status st = this.mpris2_player.Status; + //unowned ValueArray ar = (ValueArray)st; + //unowned ValueArray ar = (ValueArray)this.mpris2_player.Status; + bool r = (bool)this.mpris2_player.Status.Shuffle_State; + int32 p = (int32)this.mpris2_player.Status.Playback_State; + + debug("initial update - play state %i", p); + debug("initial update - shuffle state %s", r.to_string()); - int play_state = st.playback; - debug("GetStatusChange - play state %i", play_state); - (this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(play_state); + /*(this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(play_state); this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris2_player.GetMetadata(), MetadataMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.GetMetadata(), ScrubMenuitem.attributes_format()); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; scrub.update_position(this.mpris2_player.PositionGet()); + */ } public void transport_event(TransportMenuitem.action command) { + /* debug("transport_event input = %i", (int)command); if(command == TransportMenuitem.action.PLAY_PAUSE){ debug("transport_event PLAY_PAUSE"); @@ -92,10 +119,12 @@ public class Mpris2Controller : GLib.Object else if(command == TransportMenuitem.action.NEXT){ this.mpris2_player.Next(); } + */ } public void set_position(double position) { + /* debug("Set position with pos (0-100) %f", position); HashTable data = this.mpris2_player.GetMetadata(); Value? time_value = data.lookup("time"); @@ -110,7 +139,7 @@ public class Mpris2Controller : GLib.Object this.mpris2_player.SetPosition((int32)(new_time_position)); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; scrub.update_position(this.mpris2_player.PositionGet()); - + */ } public bool connected() @@ -118,9 +147,10 @@ public class Mpris2Controller : GLib.Object return (this.mpris2_player != null); } - private void onStatusChange(dynamic DBus.Object mpris_client, status st) - { - debug("onStatusChange - signal received"); + //private void onStatusChange(dynamic DBus.Object mpris_client, status st) + //{ + /* + debug("onStatusChange - signal received"); status* status = &st; unowned ValueArray ar = (ValueArray)status; int play_state = ar.get_nth(0).get_int(); @@ -131,12 +161,12 @@ public class Mpris2Controller : GLib.Object ht.insert("state", v); this.owner.custom_items[PlayerController.widget_order.TRANSPORT].update(ht, TransportMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); - - } + */ + //} private void onTrackChange(dynamic DBus.Object mpris_client, HashTable ht) { - debug("onTrackChange"); + /*(debug("onTrackChange"); this.owner.custom_items[PlayerController.widget_order.METADATA].reset(MetadataMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].reset(ScrubMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, @@ -146,6 +176,9 @@ public class Mpris2Controller : GLib.Object ScrubMenuitem.attributes_format()); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; scrub.update_position(this.mpris2_player.PositionGet()); - + */ } } + + + diff --git a/src/player-controller.vala b/src/player-controller.vala index 60f27ca..84d2374 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -100,9 +100,7 @@ public class PlayerController : GLib.Object if(this.current_state != state.READY){ debug("establish_mpris_connection - Not ready to connect"); return; - } - - + } if(this.name == "Vlc"){ debug("establishing a vlc mpris controller"); this.mpris_adaptor = new Mpris2Controller(this); -- cgit v1.2.3 From 161d2b1e2d2ca940a37b97627e32b6bb074eaf76 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 9 Aug 2010 21:42:24 +0100 Subject: vala dbus issues resolved --- src/Makefile.am | 1 + src/mpris2-controller.vala | 46 +++++++++++++++++----------------------------- 2 files changed, 18 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 0f2962a..0e22fe4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -72,6 +72,7 @@ music_bridge_VALASOURCES = \ music_bridge_VALAFLAGS = \ --ccode \ + --disable-dbus-transformation \ -H music-player-bridge.h -d . \ --vapidir=$(top_srcdir)/vapi/ \ --vapidir=./ \ diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 4555fca..750f69a 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -19,26 +19,22 @@ with this program. If not, see . */ using Gee; -/*struct Status { - public int32 playback; - public double shuffle; - public bool repeat; - public bool endless; - public bool endlessy; -}*/ -[DBus (name = "org.mpris.mediaplayers.vlc")] +[DBus (name = "org.mpris.MediaPlayer.Player")] public interface MprisPlayer : Object { - public abstract struct Status { + public struct Status { public int32 Playback_State; public double Playback_Rate; public bool Repeat_State; public bool Shuffle_State; public bool Endless_State; } + public abstract void PlayPause() throws DBus.Error; + public abstract void Pause() throws DBus.Error; + public abstract void Next() throws DBus.Error; + public abstract void Previous() throws DBus.Error; - - //public abstract struct Status () throws DBus.Error; + public abstract signal void StatusChanged(Status update); } /* @@ -51,14 +47,6 @@ public class Mpris2Controller : GLib.Object public dynamic DBus.Object mpris2_root {get; construct;} public MprisPlayer mpris2_player {get; construct;} public PlayerController owner {get; construct;} - - /*struct status { - public int32 Playback_State; - public double Playback_Rate; - public bool Repeat_State; - public bool Shuffle_State; - public bool Endless_State; - }*/ public Mpris2Controller(PlayerController ctrl) { @@ -80,7 +68,7 @@ public class Mpris2Controller : GLib.Object "/org/mpris/MediaPlayer/Player", "org.mpris.MediaPlayer.Player"); //this.mpris2_player.TrackChange += onTrackChange; - //this.mpris2_player.StatusChange += onStatusChange; + this.mpris2_player.StatusChanged += onStatusChanged; initial_update(); } @@ -106,20 +94,18 @@ public class Mpris2Controller : GLib.Object } public void transport_event(TransportMenuitem.action command) - { - /* + { debug("transport_event input = %i", (int)command); if(command == TransportMenuitem.action.PLAY_PAUSE){ debug("transport_event PLAY_PAUSE"); - this.mpris2_player.Pause(); + this.mpris2_player.PlayPause(); } else if(command == TransportMenuitem.action.PREVIOUS){ - this.mpris2_player.Prev(); + this.mpris2_player.Previous(); } else if(command == TransportMenuitem.action.NEXT){ this.mpris2_player.Next(); - } - */ + } } public void set_position(double position) @@ -147,8 +133,10 @@ public class Mpris2Controller : GLib.Object return (this.mpris2_player != null); } - //private void onStatusChange(dynamic DBus.Object mpris_client, status st) - //{ + private void onStatusChanged(MprisPlayer.Status st) + { + debug("on status changed - fucking jesus mother of god"); + debug("new playback state = %i", st.Playback_State); /* debug("onStatusChange - signal received"); status* status = &st; @@ -162,7 +150,7 @@ public class Mpris2Controller : GLib.Object this.owner.custom_items[PlayerController.widget_order.TRANSPORT].update(ht, TransportMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); */ - //} + } private void onTrackChange(dynamic DBus.Object mpris_client, HashTable ht) { -- cgit v1.2.3 From ef6a30946561b140d48006dfc98d2707eccfd304 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 10 Aug 2010 12:16:11 +0100 Subject: mpris 2 controller coming together --- src/mpris2-controller.vala | 51 +++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 750f69a..0f94297 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -22,6 +22,7 @@ using Gee; [DBus (name = "org.mpris.MediaPlayer.Player")] public interface MprisPlayer : Object { + public struct Status { public int32 Playback_State; public double Playback_Rate; @@ -29,12 +30,20 @@ public interface MprisPlayer : Object { public bool Shuffle_State; public bool Endless_State; } + + public abstract HashTable Metadata{owned get;} + public abstract double Volume{get;} + public abstract int32 Capabilities{get;} + public abstract int32 Position{get;} + + public abstract void PlayPause() throws DBus.Error; public abstract void Pause() throws DBus.Error; public abstract void Next() throws DBus.Error; public abstract void Previous() throws DBus.Error; public abstract signal void StatusChanged(Status update); + public abstract signal void TrackChanged(HashTable Metadata); } /* @@ -67,7 +76,7 @@ public class Mpris2Controller : GLib.Object this.mpris2_player = (MprisPlayer)this.connection.get_object ("org.mpris.mediaplayers.".concat(this.owner.name.down()) , "/org/mpris/MediaPlayer/Player", "org.mpris.MediaPlayer.Player"); - //this.mpris2_player.TrackChange += onTrackChange; + this.mpris2_player.TrackChanged += onTrackChanged; this.mpris2_player.StatusChanged += onStatusChanged; initial_update(); } @@ -83,14 +92,14 @@ public class Mpris2Controller : GLib.Object debug("initial update - play state %i", p); debug("initial update - shuffle state %s", r.to_string()); - /*(this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(play_state); - this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris2_player.GetMetadata(), + (this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(p); + this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris2_player.Metadata, MetadataMenuitem.attributes_format()); - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.GetMetadata(), + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.Metadata, ScrubMenuitem.attributes_format()); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris2_player.PositionGet()); - */ + scrub.update_position(this.mpris2_player.Position); + } public void transport_event(TransportMenuitem.action command) @@ -135,36 +144,32 @@ public class Mpris2Controller : GLib.Object private void onStatusChanged(MprisPlayer.Status st) { - debug("on status changed - fucking jesus mother of god"); - debug("new playback state = %i", st.Playback_State); - /* - debug("onStatusChange - signal received"); - status* status = &st; - unowned ValueArray ar = (ValueArray)status; - int play_state = ar.get_nth(0).get_int(); - debug("onStatusChange - play state %i", play_state); + debug("onStatusChange - play state %i", st.Playback_State); HashTable ht = new HashTable(str_hash, str_equal); Value v = Value(typeof(int)); - v.set_int(play_state); + v.set_int(st.Playback_State); ht.insert("state", v); this.owner.custom_items[PlayerController.widget_order.TRANSPORT].update(ht, TransportMenuitem.attributes_format()); - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); - */ + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); } - private void onTrackChange(dynamic DBus.Object mpris_client, HashTable ht) + private void onTrackChanged(HashTable ht) { - /*(debug("onTrackChange"); this.owner.custom_items[PlayerController.widget_order.METADATA].reset(MetadataMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].reset(ScrubMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, MetadataMenuitem.attributes_format()); debug("about to update the duration on the scrub bar"); - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.GetMetadata(), + + /*foreach(string s in this.mpris2_player.Metadata.get_keys()){ + debug("key %s has value %s", s, + (string)this.mpris2_player.Metadata.lookup(s)); + }*/ + + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.Metadata, ScrubMenuitem.attributes_format()); - ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris2_player.PositionGet()); - */ + //ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + //scrub.update_position(this.mpris2_player.PositionGet()); } } -- cgit v1.2.3 From 9244bd84d655fae8bbb2772d4aac1550b57a7c1c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 10 Aug 2010 12:37:42 +0100 Subject: mpris 2 controller coming together --- src/mpris2-controller.vala | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 0f94297..00d7bb0 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -19,7 +19,6 @@ with this program. If not, see . */ using Gee; - [DBus (name = "org.mpris.MediaPlayer.Player")] public interface MprisPlayer : Object { @@ -36,7 +35,7 @@ public interface MprisPlayer : Object { public abstract int32 Capabilities{get;} public abstract int32 Position{get;} - + public abstract void SetPosition(string prop, int32 pos) throws DBus.Error; public abstract void PlayPause() throws DBus.Error; public abstract void Pause() throws DBus.Error; public abstract void Next() throws DBus.Error; @@ -83,9 +82,6 @@ public class Mpris2Controller : GLib.Object private void initial_update() { - //status st = this.mpris2_player.Status; - //unowned ValueArray ar = (ValueArray)st; - //unowned ValueArray ar = (ValueArray)this.mpris2_player.Status; bool r = (bool)this.mpris2_player.Status.Shuffle_State; int32 p = (int32)this.mpris2_player.Status.Playback_State; @@ -118,10 +114,9 @@ public class Mpris2Controller : GLib.Object } public void set_position(double position) - { - /* + { debug("Set position with pos (0-100) %f", position); - HashTable data = this.mpris2_player.GetMetadata(); + HashTable data = this.mpris2_player.Metadata; Value? time_value = data.lookup("time"); if(time_value == null){ warning("Can't fetch the duration of the track therefore cant set the position"); @@ -131,10 +126,11 @@ public class Mpris2Controller : GLib.Object debug("total time of track = %i", (int)total_time); double new_time_position = total_time * position/100.0; debug("new position = %f", (new_time_position * 1000)); + int32 trackid = this.mpris2_player.Metadata.lookup("trackid"); + debug("the trackid = %i", trackid); this.mpris2_player.SetPosition((int32)(new_time_position)); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris2_player.PositionGet()); - */ + scrub.update_position(this.mpris2_player.Position); } public bool connected() @@ -160,16 +156,11 @@ public class Mpris2Controller : GLib.Object this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, MetadataMenuitem.attributes_format()); debug("about to update the duration on the scrub bar"); - - /*foreach(string s in this.mpris2_player.Metadata.get_keys()){ - debug("key %s has value %s", s, - (string)this.mpris2_player.Metadata.lookup(s)); - }*/ this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.Metadata, ScrubMenuitem.attributes_format()); - //ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - //scrub.update_position(this.mpris2_player.PositionGet()); + ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + scrub.update_position(this.mpris2_player.Position); } } -- cgit v1.2.3 From b63691637ebc766e90c0da44e76cc7b9cc49872e Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 11 Aug 2010 20:04:04 +0100 Subject: mpris2 working for now, but its all going to change again --- src/mpris-controller.vala | 16 ++++++--- src/mpris2-controller.vala | 25 ++++++++++--- src/music-player-bridge.vala | 6 ++-- src/play-button.c | 8 ++--- src/player-controller.vala | 83 +++++++++++++++++++++++++++++++++++--------- src/player-item.vala | 2 ++ src/scrub-menu-item.vala | 7 +++- src/scrub-widget.c | 2 +- src/sound-service.c | 4 +-- src/transport-menu-item.vala | 2 +- 10 files changed, 116 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/mpris-controller.vala b/src/mpris-controller.vala index 8ecd20a..c70c6d5 100644 --- a/src/mpris-controller.vala +++ b/src/mpris-controller.vala @@ -124,17 +124,23 @@ public class MprisController : GLib.Object private void onTrackChange(dynamic DBus.Object mpris_client, HashTable ht) { debug("onTrackChange"); + this.owner.custom_items[PlayerController.widget_order.METADATA].reset(MetadataMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.SCRUB].reset(ScrubMenuitem.attributes_format()); + HashTable status_hash = new HashTable(str_hash, str_equal); + + status st = this.mpris_player.GetStatus(); + int play_state = st.playback; + debug("GetStatusChange, about to update scrub with play state - %i", play_state); + + ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + scrub.update_playstate(play_state); + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(), + ScrubMenuitem.attributes_format()); this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, MetadataMenuitem.attributes_format()); debug("about to update the duration on the scrub bar"); - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(), - ScrubMenuitem.attributes_format()); // temporary fix - ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; scrub.update_position(this.mpris_player.PositionGet()); } - - } diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 00d7bb0..20cfc9e 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -126,9 +126,18 @@ public class Mpris2Controller : GLib.Object debug("total time of track = %i", (int)total_time); double new_time_position = total_time * position/100.0; debug("new position = %f", (new_time_position * 1000)); - int32 trackid = this.mpris2_player.Metadata.lookup("trackid"); - debug("the trackid = %i", trackid); - this.mpris2_player.SetPosition((int32)(new_time_position)); + + Value? v = this.mpris2_player.Metadata.lookup("trackid"); + if(v != null){ + if(v.holds (typeof (int))){ + debug("the trackid = %i", v.get_int()); + } + else if(v.holds (typeof (string))){ + debug("the trackid = %s", v.get_string()); + } + } + + //this.mpris2_player.SetPosition((int32)(new_time_position)); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; scrub.update_position(this.mpris2_player.Position); } @@ -156,12 +165,18 @@ public class Mpris2Controller : GLib.Object this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht, MetadataMenuitem.attributes_format()); debug("about to update the duration on the scrub bar"); - - this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.Metadata, + Value? v = ht.lookup("time"); + if(v != null) + { + debug("with the duration of %i", (int)v.get_uint()); + debug("with Position of %i", this.mpris2_player.Position); + } + this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht, ScrubMenuitem.attributes_format()); ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; scrub.update_position(this.mpris2_player.Position); } + } diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 352ea7f..daad42f 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -116,10 +116,8 @@ public class MusicPlayerBridge : GLib.Object if(server_is_not_of_interest(type)) return; string client_name = type.split(".")[1]; if (root_menu != null && client_name != null){ - registered_clients[client_name].vanish(); - registered_clients.remove(client_name); - debug("Successively removed menu_item for client %s from registered_clients", - client_name); + registered_clients[client_name].hibernate(); + debug("Successively offlined client %s", client_name); } } diff --git a/src/play-button.c b/src/play-button.c index 94e6f98..2f3a553 100644 --- a/src/play-button.c +++ b/src/play-button.c @@ -28,7 +28,7 @@ Uses code from ctk #include "play-button.h" #define RECT_WIDTH 130.0f -#define Y 5.0f +#define Y 7.0f #define X 37.0f #define INNER_RADIUS 12.5 #define MIDDLE_RADIUS 13.5f @@ -42,16 +42,16 @@ Uses code from ctk #define TRI_HEIGHT 13.0f #define TRI_OFFSET 6.0f #define PREV_X 35.0f -#define PREV_Y 11.0f +#define PREV_Y 13.0f #define NEXT_X 113.0f -#define NEXT_Y 11.0f //prev_y +#define NEXT_Y 13.0f //prev_y #define PAUSE_WIDTH 21.0f #define PAUSE_HEIGHT 27.0f #define BAR_WIDTH 4.5f #define BAR_HEIGHT 24.0f #define BAR_OFFSET 10.0f #define PAUSE_X 78.0f -#define PAUSE_Y 5.0f +#define PAUSE_Y 7.0f #define PLAY_WIDTH 28.0f #define PLAY_HEIGHT 29.0f #define PLAY_PADDING 5.0f diff --git a/src/player-controller.vala b/src/player-controller.vala index 84d2374..33a5b1a 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -48,12 +48,15 @@ public class PlayerController : GLib.Object private Dbusmenu.Menuitem root_menu; public string name { get; set;} public ArrayList custom_items; - public Mpris2Controller mpris_adaptor; + public Mpris2Controller mpris2_adaptor; + public MprisController mpris_adaptor; + public bool mpris2; public AppInfo? app_info { get; set;} public int menu_offset { get; set;} public PlayerController(Dbusmenu.Menuitem root, string client_name, int offset, state initial_state) { + this.mpris2 = false; this.root_menu = root; this.name = format_client_name(client_name.strip()); this.custom_items = new ArrayList(); @@ -74,7 +77,7 @@ public class PlayerController : GLib.Object public void activate() { this.establish_mpris_connection(); - this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, true); + //this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, true); } /* @@ -103,19 +106,13 @@ public class PlayerController : GLib.Object } if(this.name == "Vlc"){ debug("establishing a vlc mpris controller"); - this.mpris_adaptor = new Mpris2Controller(this); + this.mpris2_adaptor = new Mpris2Controller(this); + this.mpris2 = true; } else{ - //this.mpris_adaptor = new MprisController(this); - } - // TODO refactor - if(this.mpris_adaptor.connected() == true){ - debug("yup I'm connected"); - this.update_state(state.CONNECTED); - } - else{ - this.update_state(state.DISCONNECTED); + this.mpris_adaptor = new MprisController(this); } + this.determine_state(); } public void vanish() @@ -125,8 +122,17 @@ public class PlayerController : GLib.Object } } + public void hibernate() + { + update_state(PlayerController.state.OFFLINE); + this.custom_items[widget_order.TRANSPORT].reset(TransportMenuitem.attributes_format()); + this.custom_items[widget_order.METADATA].reset(MetadataMenuitem.attributes_format()); + this.custom_items[widget_order.SCRUB].reset(ScrubMenuitem.attributes_format()); + } + public void update_layout() - { + { + if(this.current_state != state.CONNECTED){ this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, false); @@ -136,12 +142,13 @@ public class PlayerController : GLib.Object false); this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE, false); - return; + return; } - debug("update layout - metadata %s", this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()).to_string()); this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format())); + //debug("metadata id %i", this.custom_items[widget_order.METADATA].id); + debug("update layout - scrub %s", this.custom_items[widget_order.SCRUB].populated(ScrubMenuitem.attributes_format()).to_string()); this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, this.custom_items[widget_order.SCRUB].populated(ScrubMenuitem.attributes_format())); @@ -151,7 +158,7 @@ public class PlayerController : GLib.Object true); this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE, - true); + true); } private void construct_widgets() @@ -213,4 +220,48 @@ public class PlayerController : GLib.Object return formatted; } + // Temporarily we will need to handle to different mpris implemenations + // Do it for now - a couple of weeks should see this messy carry on out of + // the codebase. + public void set_track_position(double pos) + { + if(this.mpris2 == true){ + this.mpris2_adaptor.set_position(pos); + } + else{ + this.mpris_adaptor.set_position(pos); + } + } + + public void transport_update(TransportMenuitem.action update) + { + if(this.mpris2 == true){ + this.mpris2_adaptor.transport_event(update); + } + else{ + this.mpris_adaptor.transport_event(update); + } + } + + public void determine_state() + { + if(this.mpris2 == true){ + if(this.mpris2_adaptor.connected() == true){ + debug("yup I'm connected"); + this.update_state(state.CONNECTED); + } + else{ + this.update_state(state.DISCONNECTED); + } + } + else{ + if(this.mpris_adaptor.connected() == true){ + debug("yup I'm connected"); + this.update_state(state.CONNECTED); + } + else{ + this.update_state(state.DISCONNECTED); + } + } + } } \ No newline at end of file diff --git a/src/player-item.vala b/src/player-item.vala index 288ac47..e5d8bfc 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -79,9 +79,11 @@ public class PlayerItem : Dbusmenu.Menuitem this.property_set_int(property, (int)v.get_uint()); } else if(v.holds (typeof (bool))){ + debug("with value : %s", v.get_boolean().to_string()); this.property_set_bool(property, v.get_boolean()); } } + if(this.property_get_bool(MENUITEM_PROP_VISIBLE) == false){ this.property_set_bool(MENUITEM_PROP_VISIBLE, true); } diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala index ca81c38..e220612 100644 --- a/src/scrub-menu-item.vala +++ b/src/scrub-menu-item.vala @@ -32,13 +32,18 @@ public class ScrubMenuitem : PlayerItem public override void handle_event(string name, GLib.Value input_value, uint timestamp) { debug("handle_event for owner %s with value: %f", this.owner.name, input_value.get_double()); - this.owner.mpris_adaptor.set_position(input_value.get_double()); + this.owner.set_track_position(input_value.get_double()); } public void update_position(int32 new_position) { this.property_set_int(MENUITEM_POSITION, new_position); } + + public void update_playstate(int state) + { + this.property_set_int(MENUITEM_PLAY_STATE, state); + } public static HashSet attributes_format() { diff --git a/src/scrub-widget.c b/src/scrub-widget.c index 52d7b83..a1d45d5 100644 --- a/src/scrub-widget.c +++ b/src/scrub-widget.c @@ -174,7 +174,7 @@ scrub_widget_check_play_state(ScrubWidget* self) ScrubWidgetPrivate * priv = SCRUB_WIDGET_GET_PRIVATE(self); gint play_state = dbusmenu_menuitem_property_get_int(priv->twin_item, DBUSMENU_SCRUB_MENUITEM_PLAY_STATE); - + g_debug("play-state = %i", play_state); if(play_state == 0){ g_debug("START TIMELINE"); ido_timeline_start(priv->time_line); diff --git a/src/sound-service.c b/src/sound-service.c index 16fa87c..8768cd3 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -42,8 +42,8 @@ service_shutdown (IndicatorService *service, gpointer user_data) if (mainloop != NULL) { g_debug("Service shutdown !"); // TODO: uncomment for release !! - //close_pulse_activites(); - //g_main_loop_quit(mainloop); + close_pulse_activites(); + g_main_loop_quit(mainloop); } return; } diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala index 3d6dcdd..45c2692 100644 --- a/src/transport-menu-item.vala +++ b/src/transport-menu-item.vala @@ -45,7 +45,7 @@ public class TransportMenuitem : PlayerItem int input = input_value.get_int(); debug("handle_event with value %s", input.to_string()); debug("transport owner name = %s", this.owner.name); - this.owner.mpris_adaptor.transport_event((action)input); + this.owner.transport_update((action)input); } public static HashSet attributes_format() -- cgit v1.2.3