[banshee] [PlayQueue] Fix 'Play After' when there are tracks in the queue before the current track
- From: Alex Launi <alexlauni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [PlayQueue] Fix 'Play After' when there are tracks in the queue before the current track
- Date: Fri, 22 Oct 2010 06:37:36 +0000 (UTC)
commit 9544187336387e73b4a073fd7ce1d7500966e9c0
Author: Alex Launi <alex launi gmail com>
Date: Fri Oct 22 02:37:03 2010 -0400
[PlayQueue] Fix 'Play After' when there are tracks in the queue before the current track
.../Banshee.PlayQueue/PlayQueueSource.cs | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
index 59c30ea..f75fc3a 100644
--- a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
+++ b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
@@ -415,6 +415,7 @@ namespace Banshee.PlayQueue
var t = TrackModel;
bool in_match = false;
long current_view_order = CurrentTrackViewOrder;
+ int index = Math.Max (0, TrackModel.IndexOf (current_track));
string current_album = ServiceManager.PlayerEngine.CurrentTrack.AlbumTitle;
string current_artist = ServiceManager.PlayerEngine.CurrentTrack.AlbumArtist;
@@ -422,10 +423,11 @@ namespace Banshee.PlayQueue
// view order will point to the last track that has the same album and artist of the
// currently playing track.
viewOrder = current_view_order;
- for (int i = 0; i < t.Count; i++) {
+ for (int i = index; i < t.Count; i++) {
var track = t[i];
if (current_artist == track.AlbumArtist && (!checkAlbum || current_album == track.AlbumTitle)) {
in_match = true;
+ Log.DebugFormat ("{0} : {1}", track.TrackTitle, viewOrder);
viewOrder++;
} else if (!in_match) {
continue;
@@ -434,6 +436,7 @@ namespace Banshee.PlayQueue
break;
}
}
+ Log.DebugFormat ("returning viewOrder {0}", viewOrder);
}
private void ShiftForAddedAfter (long viewOrder, long maxViewOrder)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]