[Banshee-List] Start playing when clicking the play button



When banshee is started, the play button does nothing, while you'd
expect it to start playback.

Attached patch fixes this.

Ruben


--
Ruben Vermeersch (rubenv)
http://www.Lambda1.be/
Index: src/PlayerInterface.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/PlayerInterface.cs,v
retrieving revision 1.97
diff -u -p -r1.97 PlayerInterface.cs
--- src/PlayerInterface.cs	13 Nov 2005 15:30:52 -0000	1.97
+++ src/PlayerInterface.cs	14 Nov 2005 17:27:31 -0000
@@ -791,7 +791,11 @@ namespace Banshee
             if(Core.Instance.Player.Loaded) {
                 TogglePlaying();
             } else {
-                playlistView.PlaySelected();
+                System.Console.WriteLine("not loaded");
+                if(!playlistView.PlaySelected()) {
+                    playlistModel.Advance();
+                    playlistView.UpdateView();
+                }
             }
         }
         
Index: src/PlaylistView.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/PlaylistView.cs,v
retrieving revision 1.27
diff -u -p -r1.27 PlaylistView.cs
--- src/PlaylistView.cs	25 Oct 2005 01:26:10 -0000	1.27
+++ src/PlaylistView.cs	14 Nov 2005 17:27:33 -0000
@@ -347,10 +347,10 @@ namespace Banshee
         {
             CellRendererToggle toggle = (CellRendererToggle)cell;
             AudioCdTrackInfo ti = model.IterTrackInfo(iter) as AudioCdTrackInfo;
-			if (ti != null)
-				toggle.Active = ti.CanRip;
-			else
-				toggle.Active = false;
+            if (ti != null)
+                toggle.Active = ti.CanRip;
+            else
+                toggle.Active = false;
         }
         
         protected void SyncCellInd(TreeViewColumn tree_column,
@@ -666,18 +666,19 @@ namespace Banshee
         */
         
         
-        public void PlaySelected()
+        public bool PlaySelected()
         {
             TreeIter selIter;
             
             try {
                 if(!model.GetIter(out selIter, Selection.GetSelectedRows()[0]))
-                    return;
+                    return false;
             } catch(Exception) {
-                return;
+                return false;
             }
             
             model.PlayIter(selIter);
+            return true;
         }
         
         public void AddSelectedToPlayList(string name)


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