[banshee/gapless-ng: 136/836] Merge in gapless work. Required small updates for changes in Banshee.PlayQueue



commit 63fd2d914bba2fd11c33c3122e73039209fbb224
Merge: e4685d5 cd25709
Author: Christopher James Halse Rogers <raof ubuntu com>
Date:   Tue Sep 29 13:20:25 2009 +1000

    Merge in gapless work.
    Required small updates for changes in Banshee.PlayQueue

 libbanshee/banshee-player-pipeline.c               |  103 ++++++++++++++++---
 libbanshee/banshee-player-private.h                |    9 ++
 libbanshee/banshee-player.c                        |   31 ++++++
 .../Banshee.GStreamer/PlayerEngine.cs              |   94 ++++++++++++++++++-
 .../Banshee.MediaEngine/PlayerEngine.cs            |   50 ++++++++++
 .../Banshee.MediaEngine/PlayerEngineService.cs     |   80 +++++++++++----
 .../Banshee.MediaEngine/PlayerEvent.cs             |    3 +-
 .../IBasicPlaybackController.cs                    |    2 +-
 .../PlaybackControllerService.cs                   |   87 ++++++++++-------
 .../Banshee.InternetRadio/InternetRadioSource.cs   |   14 +++-
 .../Banshee.Lastfm.Radio/StationSource.cs          |   21 +++--
 .../Banshee.PlayQueue/PlayQueueSource.cs           |   12 ++-
 12 files changed, 418 insertions(+), 88 deletions(-)
---
diff --cc src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
index 6d3cc74,ade81ee..17655d4
--- a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
+++ b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
@@@ -458,37 -233,26 +458,37 @@@ namespace Banshee.PlayQueu
              }
          }
  
 +        public override void Reload ()
 +        {
 +            enabled_cache.Clear ();
 +            base.Reload ();
 +
 +            if (current_track == null) {
 +                if (this == ServiceManager.PlaybackController.Source ||
 +                    this == ServiceManager.PlaybackController.NextSource) {
 +                    ServiceManager.PlaybackController.NextSource = PriorSource;
 +                }
 +            }
 +        }
 +
 +        protected override DatabaseTrackListModel CreateTrackModelFor (DatabaseSource src)
 +        {
 +            return new PlayQueueTrackListModel (ServiceManager.DbConnection, DatabaseTrackInfo.Provider, (PlayQueueSource) src);
 +        }
 +
          bool IBasicPlaybackController.First ()
          {
-             return ((IBasicPlaybackController)this).Next (false);
+             return ((IBasicPlaybackController)this).Next (false, true);
          }
          
-         bool IBasicPlaybackController.Next (bool restart)
+         bool IBasicPlaybackController.Next (bool restart, bool userRequested)
          {
 -            if (userRequested) {
 -                RemovePlayingTrack ();
 +            if (current_track != null && ServiceManager.PlayerEngine.CurrentTrack == current_track) {
 +                int index = TrackModel.IndexOf (current_track) + 1;
 +                SetCurrentTrack (index < Count ? TrackModel[index] as DatabaseTrackInfo : null);
              }
 -
 -            bool stillPlaying = false;
 -            if (ServiceManager.PlayerEngine.CurrentTrack != null) {
 -                // AbsoluteUri seems a reasonable way of determining when two TrackInfos are the same
 -                // I'm not sure if it's both necessary and sufficient, though.
 -                stillPlaying = 
 -                    ServiceManager.PlayerEngine.CurrentTrack.Uri.AbsoluteUri == TrackModel[0].Uri.AbsoluteUri;
 -            }
 -
 -            if (Count == 0 || (stillPlaying && Count == 1)) {
 +            if (current_track == null) {
 +                UpdatePlayQueue ();
                  ServiceManager.PlaybackController.Source = PriorSource;
                  if (was_playing) {
                      ServiceManager.PlaybackController.PriorTrack = prior_playback_track;
@@@ -499,7 -263,18 +499,11 @@@
                  return true;
              }
  
-             ServiceManager.PlayerEngine.OpenPlay (current_track);
 -            DatabaseTrackInfo next;
 -            if (userRequested || !stillPlaying) {
 -                next = (DatabaseTrackInfo)TrackModel[0];
 -            } else {
 -                next = (DatabaseTrackInfo)TrackModel[1];
 -            }
 -            
+             if (userRequested) {
 -                ServiceManager.PlayerEngine.OpenPlay (next);
++                ServiceManager.PlayerEngine.OpenPlay (current_track);
+             } else {
 -                ServiceManager.PlayerEngine.SetNextTrack (next);
++                ServiceManager.PlayerEngine.SetNextTrack (current_track);
+             }
              return true;
          }
          



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