diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-07-08 19:30:24 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-07-08 19:30:24 +0200 |
commit | 964106d9c8c140d9c27a22aca8078dfdab57c5e9 (patch) | |
tree | e17769a890bb9dc2b337b3fad529fe7fec6cabf4 /src/transport-menu-item.vala | |
parent | 26d4014fcf17ab3735a3045b9b3900e27a4a467b (diff) | |
parent | b0a09afe59a904ce4b4e90e58d933ad1f0b036d9 (diff) | |
download | ayatana-indicator-sound-964106d9c8c140d9c27a22aca8078dfdab57c5e9.tar.gz ayatana-indicator-sound-964106d9c8c140d9c27a22aca8078dfdab57c5e9.tar.bz2 ayatana-indicator-sound-964106d9c8c140d9c27a22aca8078dfdab57c5e9.zip |
Import upstream version 0.3.5
Diffstat (limited to 'src/transport-menu-item.vala')
-rw-r--r-- | src/transport-menu-item.vala | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala index 264e153..e0710a8 100644 --- a/src/transport-menu-item.vala +++ b/src/transport-menu-item.vala @@ -23,11 +23,15 @@ using DbusmenuTransport; public class TransportMenuitem : PlayerItem { + public enum action{ + PREVIOUS, + PLAY_PAUSE, + NEXT + } - public TransportMenuitem() + public TransportMenuitem(PlayerController parent) { - this.property_set(MENUITEM_PROP_TYPE, MENUITEM_TYPE); - debug("transport on the vala side"); + Object(item_type: MENUITEM_TYPE, owner: parent); } public void change_play_state(int state) @@ -37,14 +41,11 @@ public class TransportMenuitem : PlayerItem public override void handle_event(string name, GLib.Value input_value, uint timestamp) { - debug("handle_event with bool value %s", input_value.get_boolean().to_string()); - this.mpris_adaptor.toggle_playback(input_value.get_boolean()); - } - - public override void check_layout(){ - // nothing to be done for this item - always active - } - + int input = input_value.get_int(); + debug("handle_event with value %s", input.to_string()); + // Fire and forgot - the widget would not have sent it over it didn't think it was relevant. + this.owner.mpris_adaptor.transport_event((action)input); + } public static HashSet<string> attributes_format() { |