[gnome-music: 3/5] basic queue support in song view



commit ab43825790fe3ecdb6ee1f7fa87318ca286d00a0
Author: Guillaume Quintard <guillaume quintard gmail com>
Date:   Thu Apr 25 01:55:45 2013 +0200

    basic queue support in song view

 src/player.js |    6 +++++-
 src/view.js   |    5 +----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index c6f1c5c..c36bccb 100644
--- a/src/player.js
+++ b/src/player.js
@@ -101,7 +101,11 @@ const Player = new Lang.Class({
         this.bus.connect("message", Lang.bind(this,
             function(bus, message) {
             if (message.type == Gst.MessageType.ERROR) {
-                let uri = this.playlist[this.currentTrack].get_url();
+                let uri;
+                if (this.playlist[this.currentTrack])
+                    uri = this.playlist[this.currentTrack].get_url();
+                else
+                    uri = "none"
                 log("URI:" + uri);
                 log("Error:" + message.parse_error());
                 this.stop();
diff --git a/src/view.js b/src/view.js
index 368c420..b52c090 100644
--- a/src/view.js
+++ b/src/view.js
@@ -328,10 +328,7 @@ const Songs = new Lang.Class({
     },
 
     _onItemActivated: function (widget, id, path) {
-        var iter = this._model.get_iter (path)[1];
-        var item = this._model.get_value (iter, 5);
-
-        this.player.setCurrentTrack(item);
+        this.player.setPlaylist("Songs", null, this._model, this._model.get_iter(path)[1], 5);
         this.player.play();
     },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]