diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | cmake/UseVala.cmake | 2 | ||||
-rw-r--r-- | debian/changelog | 40 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/media-player-list.vala | 2 | ||||
-rw-r--r-- | src/media-player.vala | 33 | ||||
-rw-r--r-- | src/service.vala | 8 | ||||
-rw-r--r-- | src/sound-menu.vala | 9 |
9 files changed, 76 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 798a0fb..837d9ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ pkg_check_modules( ) include_directories(${SOUNDSERVICE_INCLUDE_DIRS}) -find_package(Vala 0.18) +find_package(Vala 0.20) find_package(GObjectIntrospection 0.9.12) diff --git a/cmake/UseVala.cmake b/cmake/UseVala.cmake index f092769..f0202e2 100644 --- a/cmake/UseVala.cmake +++ b/cmake/UseVala.cmake @@ -53,7 +53,7 @@ # OF SUCH DAMAGE. #============================================================================= -find_package (Vala 0.18 REQUIRED) +find_package (Vala 0.20 REQUIRED) include (CMakeParseArguments) function (vala_init id) diff --git a/debian/changelog b/debian/changelog index cd9a47e..729ea77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,45 @@ -indicator-sound (12.10.2+13.10.20131011-0ubuntu2) UNRELEASED; urgency=low +indicator-sound (12.10.2+14.04.20131029.1-0ubuntu1) trusty; urgency=low + [ Dmitrijs Ledkovs ] * Define "ubiquity" indicator profile, reusing the greeter object. (LP: #1241539) - -- Dmitrijs Ledkovs <xnox@ubuntu.com> Fri, 18 Oct 2013 13:10:03 +0100 + [ Charles Kerr ] + * When we can't connect to pulse, wait a moment before retrying. (LP: + #1244010) + * In Service's volume_changed() function, explicitly instantiate the + GVariant to avoid leaking it. See the description in bug #1244468 + for before & after C code and more information. (LP: #1244468) + * Test that MediaPlayer's icon property isn't NULL before we serialize + it. (LP: #1229612) + + [ Sebastien Bacher ] + * Don't special case Unity sessions, that's not needed since gnome- + control-center is doing the right thing, the session name used was + also wrong and couldn't work (lp: #1239545). (LP: #1239545) + + [ Lars Uebernickel ] + * Only display running players in the phone's sound menu The design + says to only display the _one_ running player. This will have that + effect, as there's only one player allowed to run at a time on the + phone. + * VolumeControl: don't pass vala closures into libpulse Libpulse's + vala bindings don't specify that callbacks passed into some of its + functions (e.g., get_server_info) can be called after the function + returns. Vala thus frees closure data after these functions return. + This can't easily be fixed in the bindings, because libpulse doesn't + provide variants of these functions with destroy_notifies. This + patch works around this problem by only passing non-closure + functions into libpulse. (LP: #1244386) + * Depend on vala 0.20 and use its GIcon.serialize(). + + [ Ted Gould ] + * Adding a phone_greeter profile. + + [ Ubuntu daily release ] + * Automatic snapshot from revision 399 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 29 Oct 2013 10:32:48 +0000 indicator-sound (12.10.2+13.10.20131011-0ubuntu1) saucy; urgency=low diff --git a/debian/control b/debian/control index ff4c041..9104d0c 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 9.0), dh-translations, gnome-common, autotools-dev, - valac (>= 0.18), + valac (>= 0.20), libglib2.0-dev (>= 2.22.3), liburl-dispatcher1-dev, libpulse-dev (>= 0.9.18), diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 572befd..c11ec51 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,6 +32,7 @@ vala_add(indicator-sound-service volume-control media-player media-player-list + mpris2-interfaces ) vala_add(indicator-sound-service main.vala @@ -62,6 +63,7 @@ vala_add(indicator-sound-service sound-menu.vala DEPENDS media-player + mpris2-interfaces ) vala_finish(indicator-sound-service diff --git a/src/media-player-list.vala b/src/media-player-list.vala index 62badc2..75c7bb4 100644 --- a/src/media-player-list.vala +++ b/src/media-player-list.vala @@ -118,7 +118,7 @@ public class MediaPlayerList { var player = this.insert (mpris2_root.DesktopEntry); if (player != null) - player.attach (name); + player.attach (mpris2_root, name); } catch (Error e) { warning ("unable to create mpris proxy for '%s': %s", name, e.message); diff --git a/src/media-player.vala b/src/media-player.vala index 7326708..bdcea35 100644 --- a/src/media-player.vala +++ b/src/media-player.vala @@ -84,6 +84,12 @@ public class MediaPlayer: Object { get; set; } + public bool can_raise { + get { + return this.root != null ? this.root.CanRaise : true; + } + } + public signal void playlists_changed (); /** @@ -94,9 +100,12 @@ public class MediaPlayer: Object { * * This method does not block. If it is successful, "is-running" will be set to %TRUE. */ - public void attach (string dbus_name) { + public void attach (MprisRoot root, string dbus_name) { return_if_fail (this._dbus_name == null && this.proxy == null); + this.root = root; + this.notify_property ("can-raise"); + this._dbus_name = dbus_name; Bus.get_proxy.begin<MprisPlayer> (BusType.SESSION, dbus_name, "/org/mpris/MediaPlayer2", DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, got_proxy); @@ -110,29 +119,34 @@ public class MediaPlayer: Object { * See also: attach() */ public void detach () { + this.root = null; this.proxy = null; this._dbus_name = null; this.notify_property ("is-running"); + this.notify_property ("can-raise"); this.state = "Paused"; this.current_track = null; } /** - * Launch the associated media player. + * Activate the associated media player. * * Note: this will _not_ call attach(), because it doesn't know on which dbus-name the player will appear. * Use attach() to attach this object to a running instance of the player. */ - public void launch () { + public void activate () { try { - this.appinfo.launch (null, null); + if (this.proxy == null) { + this.appinfo.launch (null, null); + this.state = "Launching"; + } + else if (this.root != null && this.root.CanRaise) { + this.root.Raise (); + } } catch (Error e) { - warning ("unable to launch %s: %s", appinfo.get_name (), e.message); + warning ("unable to activate %s: %s", appinfo.get_name (), e.message); } - - if (this.proxy == null) - this.state = "Launching"; } /** @@ -144,7 +158,7 @@ public class MediaPlayer: Object { } else if (this.state != "Launching") { this.play_when_attached = true; - this.launch (); + this.activate (); } } @@ -188,6 +202,7 @@ public class MediaPlayer: Object { MprisPlaylists ?playlists_proxy; string _dbus_name; bool play_when_attached = false; + MprisRoot root; PlaylistDetails[] playlists = null; void got_proxy (Object? obj, AsyncResult res) { diff --git a/src/service.vala b/src/service.vala index aa992ff..14d4893 100644 --- a/src/service.vala +++ b/src/service.vala @@ -140,7 +140,7 @@ public class IndicatorSound.Service { static Variant serialize_themed_icon (string icon_name) { var icon = new ThemedIcon.with_default_fallbacks (icon_name); - return g_icon_serialize (icon); + return icon.serialize (); } void update_root_icon () { @@ -266,8 +266,10 @@ public class IndicatorSound.Service { bool update_player_actions () { foreach (var player in this.players) { SimpleAction? action = this.actions.lookup_action (player.id) as SimpleAction; - if (action != null) + if (action != null) { action.set_state (this.action_state_for_player (player)); + action.set_enabled (player.can_raise); + } } this.player_action_update_id = 0; @@ -290,7 +292,7 @@ public class IndicatorSound.Service { this.menus.@foreach ( (profile, menu) => menu.add_player (player)); SimpleAction action = new SimpleAction.stateful (player.id, null, this.action_state_for_player (player)); - action.activate.connect ( () => { player.launch (); }); + action.activate.connect ( () => { player.activate (); }); this.actions.add_action (action); var play_action = new SimpleAction.stateful ("play." + player.id, null, player.state); diff --git a/src/sound-menu.vala b/src/sound-menu.vala index f3f4fd9..5a10596 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -17,9 +17,6 @@ * Lars Uebernickel <lars.uebernickel@canonical.com> */ -/* Icon.serialize() is not yet in gio-2.0.vapi; remove this when it is */ -extern Variant? g_icon_serialize (Icon icon); - class SoundMenu: Object { public enum DisplayFlags { @@ -150,7 +147,7 @@ class SoundMenu: Object var player_item = new MenuItem (player.name, "indicator." + player.id); player_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.media-player"); if (icon != null) - player_item.set_attribute_value ("icon", g_icon_serialize (icon)); + player_item.set_attribute_value ("icon", icon.serialize ()); section.append_item (player_item); var playback_item = new MenuItem (null, null); @@ -211,8 +208,8 @@ class SoundMenu: Object var slider = new MenuItem (null, action); slider.set_attribute ("x-canonical-type", "s", "com.canonical.unity.slider"); - slider.set_attribute_value ("min-icon", g_icon_serialize (min_icon)); - slider.set_attribute_value ("max-icon", g_icon_serialize (max_icon)); + slider.set_attribute_value ("min-icon", min_icon.serialize ()); + slider.set_attribute_value ("max-icon", max_icon.serialize ()); slider.set_attribute ("min-value", "d", min); slider.set_attribute ("max-value", "d", max); slider.set_attribute ("step", "d", step); |