diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mpris2-controller.vala | 6 | ||||
-rw-r--r-- | src/music-player-bridge.vala | 2 | ||||
-rw-r--r-- | src/player-controller.vala | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 29dd4cf..f355d28 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -75,10 +75,10 @@ public class Mpris2Controller : GLib.Object construct{ try { var connection = DBus.Bus.get (DBus.BusType.SESSION); - this.mpris2_root = (MprisRoot) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()), + this.mpris2_root = (MprisRoot) connection.get_object (root_interface.concat(".").concat(this.owner.mpris_name), "/org/mpris/MediaPlayer2", root_interface); - this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()), + this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.mpris_name), "/org/mpris/MediaPlayer2", root_interface.concat(".Player")); this.properties_interface = (FreeDesktopProperties) connection.get_object("org.freedesktop.Properties.PropertiesChanged", @@ -92,7 +92,7 @@ public class Mpris2Controller : GLib.Object public void property_changed_cb(string interface_source, HashTable<string, Value?> changed_properties, string[] invalid ) { - debug("properties-changed for interface %s and owner %s", interface_source, this.owner.name.down()); + debug("properties-changed for interface %s and owner %s", interface_source, this.owner.mpris_name); if(changed_properties == null || interface_source.has_prefix(this.root_interface) == false ){ warning("Property-changed hash is null or this is an interface that doesn't concerns us"); diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 9ba4ef6..57f5636 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -58,6 +58,7 @@ public class MusicPlayerBridge : GLib.Object GLib.AppInfo app_info = info as GLib.AppInfo; PlayerController ctrl = new PlayerController(this.root_menu, truncate_player_name(app_info.get_name()), + determine_key(app), calculate_menu_position(), PlayerController.state.OFFLINE); ctrl.app_info = app_info; @@ -99,6 +100,7 @@ public class MusicPlayerBridge : GLib.Object bridge.playersDB.insert(path); PlayerController ctrl = new PlayerController(bridge.root_menu, name, + determine_key(path), bridge.calculate_menu_position(), PlayerController.state.READY); ctrl.set("app_info", app_info); diff --git a/src/player-controller.vala b/src/player-controller.vala index d5b79e7..ad8e989 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -44,6 +44,7 @@ public class PlayerController : GLib.Object private Dbusmenu.Menuitem root_menu; public string name { get; set;} + public string mpris_name { get; set;} public ArrayList<PlayerItem> custom_items; public Mpris2Controller mpris_bridge; public AppInfo? app_info { get; set;} @@ -51,11 +52,13 @@ public class PlayerController : GLib.Object public PlayerController(Dbusmenu.Menuitem root, string client_name, + string mpris_name, int offset, state initial_state) { this.root_menu = root; this.name = format_client_name(client_name.strip()); + this.mpris_name = mpris_name; this.custom_items = new ArrayList<PlayerItem>(); this.current_state = initial_state; this.menu_offset = offset; |