[gnome-music] fix player.js setPlaying method
- From: Eslam Mostafa <cseslam src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] fix player.js setPlaying method
- Date: Wed, 1 May 2013 16:05:49 +0000 (UTC)
commit def5dede3ef9da110a22b7a4e67b3c0a8d837d11
Author: Eslam Mostafa <cseslam src gnome org>
Date: Wed May 1 18:05:03 2013 +0200
fix player.js setPlaying method
src/player.js | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index 1238662..0a8f142 100644
--- a/src/player.js
+++ b/src/player.js
@@ -124,12 +124,12 @@ const Player = new Lang.Class({
this._setupView();
},
- _setMode: function(mode) {
- if( mode == 'playing' ) {
+ _setPlaying: function(mode) {
+ if( mode == true ) {
this.play_btn.set_active(true);
this.play_btn.set_image(this._pause_img);
this.play_btn.show_all();
- } else if ( mode == "paused" ) {
+ } else if ( mode == false ) {
this.play_btn.set_active(false);
this.play_btn.set_image(this._play_img);
this.play_btn.show_all();
@@ -203,6 +203,7 @@ const Player = new Lang.Class({
if (this.timeout) {
GLib.source_remove(this.timeout);
}
+ this._setPlaying(true);
if(this.player.get_state(1)[1] != Gst.State.PAUSED) {
this.stop();
}
@@ -340,10 +341,10 @@ const Player = new Lang.Class({
_onPlayBtnToggled: function(btn) {
if (this.player.get_state(1)[1] != Gst.State.PAUSED) {
this.pause();
- this._setMode('paused');
+ this._setPlaying(false);
} else {
this.play();
- this._setMode('playing');
+ this._setPlaying(true);
}
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]