banshee r3072 - in trunk/banshee: . src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.MediaEngine src/Core/Banshee.Services/Banshee.PlaybackController



Author: abock
Date: Mon Jan 28 23:25:42 2008
New Revision: 3072
URL: http://svn.gnome.org/viewvc/banshee?rev=3072&view=rev

Log:
2008-01-28  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs:
    Interface for implementing explicitly inside of the playback controller
    service that will allow other playback controllers to be used if
    defined on a source, yet still allow those controllers to call back
    into the canonical controller

    * src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackController.cs:
    * src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackControllerExportable.cs:
    Separate the DBus exportable feature of the playback controller into a
    separate interface

    * src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs:
    Implement ICanonicalPlaybackController explicitly,
    IPlaybackControllerExportable, and if the source bound to the controller
    is itself an IPlaybackController, have the implicit implementation of
    IPlaybackController in the canonical controller call into the source



Added:
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackController.cs
      - copied, changed from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/IPlaybackController.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackControllerExportable.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerDatabaseStack.cs
      - copied unchanged from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackControllerDatabaseStack.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs
      - copied, changed from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackControllerService.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackRepeatMode.cs
      - copied unchanged from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackRepeatMode.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackShuffleMode.cs
      - copied unchanged from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackShuffleMode.cs
Removed:
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/IPlaybackController.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackControllerDatabaseStack.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackControllerService.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackRepeatMode.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackShuffleMode.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
   trunk/banshee/src/Core/Banshee.Services/Makefile.am

Added: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/ICanonicalPlaybackController.cs	Mon Jan 28 23:25:42 2008
@@ -0,0 +1,39 @@
+//
+// ICanonicalPlaybackController.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Banshee.PlaybackController
+{
+    public interface ICanonicalPlaybackController
+    {
+        void First ();
+        void Next ();
+        void Previous ();
+    }
+}

Copied: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackController.cs (from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/IPlaybackController.cs)
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/IPlaybackController.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackController.cs	Mon Jan 28 23:25:42 2008
@@ -27,16 +27,12 @@
 //
 
 using System;
-using NDesk.DBus;
-
-using Banshee.ServiceStack;
 
 namespace Banshee.PlaybackController
 {
     public delegate void PlaybackControllerStoppedHandler ();
 
-    [Interface ("org.bansheeproject.Banshee.PlaybackController")]
-    public interface IPlaybackController : IDBusExportable
+    public interface IPlaybackController
     {
         event PlaybackControllerStoppedHandler Stopped;
     

Added: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackControllerExportable.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/IPlaybackControllerExportable.cs	Mon Jan 28 23:25:42 2008
@@ -0,0 +1,40 @@
+// 
+// IPlaybackControllerExportable.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2007-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NDesk.DBus;
+
+using Banshee.ServiceStack;
+
+namespace Banshee.PlaybackController
+{
+    [Interface ("org.bansheeproject.Banshee.PlaybackController")]
+    public interface IPlaybackControllerExportable : IPlaybackController, IDBusExportable
+    {
+    }
+}

Copied: trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs (from r3069, /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackControllerService.cs)
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlaybackControllerService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs	Mon Jan 28 23:25:42 2008
@@ -38,7 +38,7 @@
 
 namespace Banshee.PlaybackController
 {
-    public class PlaybackControllerService : IService, IPlaybackController
+    public class PlaybackControllerService : IService, ICanonicalPlaybackController, IPlaybackControllerExportable
     {
         private enum Direction
         {
@@ -117,12 +117,39 @@
         
         public void First ()
         {
+            if (Source is IPlaybackController) {
+                ((IPlaybackController)Source).First ();
+            } else {
+                ((ICanonicalPlaybackController)this).First ();
+            }
+        }
+        
+        public void Next ()
+        {
+            if (Source is IPlaybackController) {
+                ((IPlaybackController)Source).Next ();
+            } else {
+                ((ICanonicalPlaybackController)this).Next ();
+            }
+        }
+        
+        public void Previous ()
+        {
+            if (Source is IPlaybackController) {
+                ((IPlaybackController)Source).Previous ();
+            } else {
+                ((ICanonicalPlaybackController)this).Previous ();
+            }
+        }
+        
+        void ICanonicalPlaybackController.First ()
+        {
             if (Source.Count > 0) {
                 player_engine.OpenPlay (Source.TrackModel[0]);
             }
         }
         
-        public void Next ()
+        void ICanonicalPlaybackController.Next ()
         {
             TrackInfo tmp_track = CurrentTrack;
 
@@ -147,7 +174,7 @@
             QueuePlayTrack ();
         }
         
-        public void Previous ()
+        void ICanonicalPlaybackController.Previous ()
         {
             if (CurrentTrack != null && previous_stack.Count > 0) {
                 next_stack.Push (current_track);

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp	Mon Jan 28 23:25:42 2008
@@ -42,10 +42,6 @@
     <File name="Banshee.Collection/TrackListModel.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Services.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
     <File name="Banshee.MediaEngine/PlayerEngineService.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.MediaEngine/PlaybackControllerService.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.MediaEngine/PlaybackShuffleMode.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.MediaEngine/PlaybackRepeatMode.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.MediaEngine/PlaybackControllerDatabaseStack.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.ServiceStack/UserJobManager.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.ServiceStack/IUserJob.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.ServiceStack/UserJobEventHandler.cs" subtype="Code" buildaction="Compile" />
@@ -81,7 +77,6 @@
     <File name="Banshee.Services.addins" subtype="Code" buildaction="EmbedAsResource" />
     <File name="Banshee.Sources/ErrorSource.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.MediaEngine/IPlayerEngineService.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.MediaEngine/IPlaybackController.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection/BansheeListModel.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.AudioProfiles/GConfProfileConfiguration.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.AudioProfiles/Pipeline.cs" subtype="Code" buildaction="Compile" />
@@ -113,7 +108,13 @@
     <File name="Banshee.Database/BansheeModelProvider.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Database/BansheeModelCache.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Playlist/PlayQueueSource.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.PlaybackController" subtype="Directory" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/IPlaybackController.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/PlaybackShuffleMode.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/PlaybackRepeatMode.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/PlaybackControllerDatabaseStack.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/PlaybackControllerService.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/IPlaybackControllerExportable.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.PlaybackController/ICanonicalPlaybackController.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Modified: trunk/banshee/src/Core/Banshee.Services/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Makefile.am	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Makefile.am	Mon Jan 28 23:25:42 2008
@@ -39,12 +39,7 @@
 	Banshee.Library/LibraryImportManager.cs \
 	Banshee.Library/LibrarySource.cs \
 	Banshee.MediaEngine/IEqualizer.cs \
-	Banshee.MediaEngine/IPlaybackController.cs \
 	Banshee.MediaEngine/IPlayerEngineService.cs \
-	Banshee.MediaEngine/PlaybackControllerDatabaseStack.cs \
-	Banshee.MediaEngine/PlaybackControllerService.cs \
-	Banshee.MediaEngine/PlaybackRepeatMode.cs \
-	Banshee.MediaEngine/PlaybackShuffleMode.cs \
 	Banshee.MediaEngine/PlayerEngine.cs \
 	Banshee.MediaEngine/PlayerEngineEvent.cs \
 	Banshee.MediaEngine/PlayerEngineService.cs \
@@ -63,6 +58,13 @@
 	Banshee.Metadata/MetadataSettings.cs \
 	Banshee.Networking/NetworkDetect.cs \
 	Banshee.Networking/NetworkManager.cs \
+	Banshee.PlaybackController/ICanonicalPlaybackController.cs \
+	Banshee.PlaybackController/IPlaybackController.cs \
+	Banshee.PlaybackController/IPlaybackControllerExportable.cs \
+	Banshee.PlaybackController/PlaybackControllerDatabaseStack.cs \
+	Banshee.PlaybackController/PlaybackControllerService.cs \
+	Banshee.PlaybackController/PlaybackRepeatMode.cs \
+	Banshee.PlaybackController/PlaybackShuffleMode.cs \
 	Banshee.Playlist/AbstractPlaylistSource.cs \
 	Banshee.Playlist/PlaylistFileUtil.cs \
 	Banshee.Playlist/PlaylistSource.cs \



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