diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-03-23 12:39:45 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-03-23 12:39:45 -0400 |
commit | 8227400e2d44175c38165182140489adaf69dd7f (patch) | |
tree | 68ea206ec4f66c3da4f19006d168c3e205bd0eb1 /src/player-controller.vala | |
parent | ab3d1a08d064b423b2e2a3702c3039947bbb810f (diff) | |
parent | f05dff9b5d6c5e921f3056c142068ea7f6f41486 (diff) | |
download | ayatana-indicator-sound-8227400e2d44175c38165182140489adaf69dd7f.tar.gz ayatana-indicator-sound-8227400e2d44175c38165182140489adaf69dd7f.tar.bz2 ayatana-indicator-sound-8227400e2d44175c38165182140489adaf69dd7f.zip |
* New upstream release.
- Media player should be automatically started up when play button is
pressed (LP: #714750)
- volume goes to zero when using some players like banshee or
rhythmbox (LP: #730925)
- handle banshee id change (LP: #737447)
- filter out video playlists (LP: #739273)
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r-- | src/player-controller.vala | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index 3ce121e..20479d9 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -133,7 +133,8 @@ public class PlayerController : GLib.Object public void hibernate() { update_state(PlayerController.state.OFFLINE); - this.custom_items[widget_order.TRANSPORT].reset(TransportMenuitem.attributes_format()); + TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem; + transport.change_play_state (Transport.State.PAUSED); this.custom_items[widget_order.METADATA].reset(MetadataMenuitem.attributes_format()); TitleMenuitem title = this.custom_items[widget_order.TITLE] as TitleMenuitem; title.toggle_active_triangle(false); @@ -143,20 +144,25 @@ public class PlayerController : GLib.Object public void update_layout() { PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; - if(this.current_state != state.CONNECTED){ - this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, + this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, false); - this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, - false); - playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE, - false ); + playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, + false ); + this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE, + this.app_info.get_id() == "banshee.desktop"); return; } - this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, - this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format())); - this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, - true); + this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, + this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format())); + if (this.app_info.get_id() == "banshee.desktop"){ + TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem; + transport.handle_cached_action(); + } + else{ + this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE, + true); + } playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE, this.use_playlists ); } |