diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-09-08 12:24:23 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-09-08 12:24:23 +0200 |
commit | b347212eb1cb41fb9739a9873b0ff8eb8abb4b77 (patch) | |
tree | 3c9cb3c86b5668c2c03155c60a041f6cc85d28ba /src/mpris-bridge.vala | |
parent | 80e5ad4f83a8b1218133761de11d433a7854041e (diff) | |
download | ayatana-indicator-sound-b347212eb1cb41fb9739a9873b0ff8eb8abb4b77.tar.gz ayatana-indicator-sound-b347212eb1cb41fb9739a9873b0ff8eb8abb4b77.tar.bz2 ayatana-indicator-sound-b347212eb1cb41fb9739a9873b0ff8eb8abb4b77.zip |
Import upstream version 0.4.2
Diffstat (limited to 'src/mpris-bridge.vala')
-rw-r--r-- | src/mpris-bridge.vala | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/mpris-bridge.vala b/src/mpris-bridge.vala deleted file mode 100644 index bd9d472..0000000 --- a/src/mpris-bridge.vala +++ /dev/null @@ -1,70 +0,0 @@ -public class MprisBridge : GLib.Object -{ - private MprisController mpris1_controller; - private Mpris2Controller mpris2_controller; - private enum mode{ - MPRIS_1, - MPRIS_2 - } - private mode mode_in_use; - - public MprisBridge(PlayerController ctrl) - { - this.mpris2_controller = new Mpris2Controller(ctrl); - if(this.mpris2_controller.was_successfull() == true){ - this.mode_in_use = mode.MPRIS_2; - this.mpris1_controller = null; - this.mpris2_controller.initial_update(); - } - else{ - this.mpris2_controller = null; - this.mode_in_use = mode.MPRIS_1; - this.mpris1_controller = new MprisController(ctrl); - } - } - - // The handling of both mpris controllers can be abstracted further - // once the mpris2 is implemented. This will allow for one instance - // variable to point at the active controller. For now handle both ... - public bool connected() - { - if(this.mode_in_use == mode.MPRIS_1){ - return this.mpris1_controller.connected(); - } - else if(this.mode_in_use == mode.MPRIS_2){ - return this.mpris2_controller.connected(); - } - return false; - } - - public void transport_update(TransportMenuitem.action update) - { - if(this.mode_in_use == mode.MPRIS_1){ - this.mpris1_controller.transport_event(update); - } - else if(this.mode_in_use == mode.MPRIS_2){ - this.mpris2_controller.transport_event(update); - } - } - - public void expose() - { - if(this.mode_in_use == mode.MPRIS_2){ - this.mpris2_controller.expose(); - } - else{ - warning("MPRIS1 clients don't have the ability to raise/expose the client"); - } - } - - - public void set_track_position(double pos) - { - if(this.mode_in_use == mode.MPRIS_1){ - this.mpris1_controller.set_position(pos); - } - else if(this.mode_in_use == mode.MPRIS_2){ - this.mpris2_controller.set_position(pos); - } - } -}
\ No newline at end of file |