banshee r3596 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.PlaybackController src/Core/Banshee.ThickClient/Banshee.Gui src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue



Author: ahixon
Date: Sun Mar 30 02:26:33 2008
New Revision: 3596
URL: http://svn.gnome.org/viewvc/banshee?rev=3596&view=rev

Log:
2008-03-30  Alexander Hixon  <hixon alexander mediati org>

	* src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs:
	* src/Core/Banshee.Services/Banshee.PlaybackController/IBasicPlaybackController.cs:
	Update interfaces to provide for repeat support in playback controller.

	* src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs:
	Add repeat support to controller service, call updated PlaybackController
	methods provided by sources. 'Repeat Single' only activates at the end of
	a stream, not if you forcefully change tracks.

	* src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackRepeatActions.cs:
	Don't disable the repeat actions, since they're now working. Also hook
	up changing the RadioAction to changing the current PlaybackRepeatMode.

	* src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs:
	Update to reflect changes in playback controller interfaces.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IBasicPlaybackController.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackRepeatActions.cs
   trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IBasicPlaybackController.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IBasicPlaybackController.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IBasicPlaybackController.cs	Sun Mar 30 02:26:33 2008
@@ -31,7 +31,7 @@
     public interface IBasicPlaybackController
     {
         void First ();
-        void Next ();
+        void Next (bool restart);
         void Previous ();
     }
 }

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs	Sun Mar 30 02:26:33 2008
@@ -31,7 +31,7 @@
     public interface ICanonicalPlaybackController : IPlaybackController
     {
         new void First ();
-        new void Next ();
+        new void Next (bool restart);
         new void Previous ();
     }
 }

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs	Sun Mar 30 02:26:33 2008
@@ -100,7 +100,11 @@
             switch (args.Event) {
                 case PlayerEngineEvent.EndOfStream:
                     if (!StopWhenFinished) {
-                        Next ();
+                        if (RepeatMode == PlaybackRepeatMode.RepeatSingle) {
+                            QueuePlayTrack ();
+                        } else {
+                            Next ();
+                        }
                     } else {
                         OnStopped ();
                     }
@@ -141,12 +145,17 @@
         
         public void Next ()
         {
+            Next (RepeatMode == PlaybackRepeatMode.RepeatAll);
+        }
+        
+        public void Next (bool restart)
+        {
             raise_started_after_transition = true;
             
             if (Source is IBasicPlaybackController) {
-                ((IBasicPlaybackController)Source).Next ();
+                ((IBasicPlaybackController)Source).Next (restart);
             } else {
-                ((ICanonicalPlaybackController)this).Next ();
+                ((ICanonicalPlaybackController)this).Next (restart);
             }
             
             OnTransition ();
@@ -172,7 +181,7 @@
             }
         }
         
-        void ICanonicalPlaybackController.Next ()
+        void ICanonicalPlaybackController.Next (bool restart)
         {
             TrackInfo tmp_track = CurrentTrack;
 
@@ -187,6 +196,14 @@
                     if (tmp_track != null) {
                         previous_stack.Push (tmp_track);
                     }
+                } else if (restart && Source.Count > 0) {
+                    if (tmp_track != null) {
+                        previous_stack.Push (tmp_track);
+                    }
+                    
+                    CurrentTrack = Source.TrackModel[0];
+                    QueuePlayTrack ();
+                    return;
                 } else {
                     return;
                 }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackRepeatActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackRepeatActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackRepeatActions.cs	Sun Mar 30 02:26:33 2008
@@ -34,6 +34,8 @@
 
 using Hyena;
 using Banshee.Configuration;
+using Banshee.ServiceStack;
+using Banshee.PlaybackController;
 
 namespace Banshee.Gui
 {
@@ -46,6 +48,13 @@
             set {
                 active_action = value;
                 RepeatMode.Set (active_action == null ? String.Empty : ActionNameToConfigId (active_action.Name));
+                if (active_action.Value == 0) {
+                    ServiceManager.PlaybackController.RepeatMode = PlaybackRepeatMode.None;
+                } else if (active_action.Value == 1) {
+                    ServiceManager.PlaybackController.RepeatMode = PlaybackRepeatMode.RepeatAll;
+                } else {
+                    ServiceManager.PlaybackController.RepeatMode = PlaybackRepeatMode.RepeatSingle;
+                }
             }
         }
 
@@ -76,10 +85,6 @@
                 Active = (RadioAction)this["RepeatNoneAction"];
             }
             Active.Activate ();
-
-            foreach (RadioAction iter_action in this) {
-                iter_action.Sensitive = false;
-            }
         }
 
         private void OnChanged (object o, ChangedArgs args)

Modified: trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs	Sun Mar 30 02:26:33 2008
@@ -194,10 +194,10 @@
         
         void IBasicPlaybackController.First ()
         {
-            ((IBasicPlaybackController)this).Next ();
+            ((IBasicPlaybackController)this).Next (false);
         }
         
-        void IBasicPlaybackController.Next ()
+        void IBasicPlaybackController.Next (bool restart)
         {
             RemovePlayingTrack ();
             



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