banshee r4639 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.Services/Banshee.MediaEngine src/Core/Banshee.ThickClient/Banshee.Gui src/Dap/Banshee.Dap/Banshee.Dap



Author: gburt
Date: Wed Oct  1 17:36:52 2008
New Revision: 4639
URL: http://svn.gnome.org/viewvc/banshee?rev=4639&view=rev

Log:
2008-10-01  Gabriel Burt  <gabriel burt gmail com>

	* src/Clients/Nereid/Nereid/PlayerInterface.cs:
	* src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs: Add stupid
	protected IntPtr ctors.

	* src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs: Set the transcoder
	ErrorHandler and add an entry to the ErrorSource when there is a transcode
	error.

	* src/Core/Banshee.Services/Banshee.MediaEngine/TranscoderService.cs:
	Instead of popping up a dialog with a transode error and cancelling all
	other queued transcodes, simply call the error handler for the track and
	move on.



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/TranscoderService.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	Wed Oct  1 17:36:52 2008
@@ -68,6 +68,10 @@
         private CompositeTrackSourceContents composite_view;
         private ObjectListSourceContents object_view;
         private Label status_label;
+
+        protected PlayerInterface (IntPtr ptr) : base (ptr)
+        {
+        }
         
         public PlayerInterface () : base (Catalog.GetString ("Banshee Media Player"), "player_window", 1024, 700)
         {

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/TranscoderService.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/TranscoderService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/TranscoderService.cs	Wed Oct  1 17:36:52 2008
@@ -44,6 +44,7 @@
     {
         public delegate void TrackTranscodedHandler (TrackInfo track, SafeUri uri);
         public delegate void TranscodeCancelledHandler ();
+        public delegate void TranscodeErrorHandler (TrackInfo track);
 
         private struct TranscodeContext
         {
@@ -52,15 +53,17 @@
             public ProfileConfiguration Config;
             public TrackTranscodedHandler Handler;
             public TranscodeCancelledHandler CancelledHandler;
+            public TranscodeErrorHandler ErrorHandler;
 
             public TranscodeContext (TrackInfo track, SafeUri out_uri, ProfileConfiguration config, 
-                TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler)
+                TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler)
             {
                 Track = track;
                 OutUri = out_uri;
                 Config = config;
                 Handler = handler;
                 CancelledHandler = cancelledHandler;
+                ErrorHandler = errorHandler;
             }
         }
 
@@ -167,18 +170,18 @@
         }
 
         public void Enqueue (TrackInfo track, ProfileConfiguration config, 
-            TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler)
+            TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler)
         {
-            Enqueue (track, GetTempUriFor (config.Profile.OutputFileExtension), config, handler, cancelledHandler);
+            Enqueue (track, GetTempUriFor (config.Profile.OutputFileExtension), config, handler, cancelledHandler, errorHandler);
         }
 
         public void Enqueue (TrackInfo track, SafeUri out_uri, ProfileConfiguration config, 
-            TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler)
+            TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler)
         {
             bool start = false;
             lock (queue) {
                 start = (queue.Count == 0 && !transcoding);
-                queue.Enqueue (new TranscodeContext (track, out_uri, config, handler, cancelledHandler));
+                queue.Enqueue (new TranscodeContext (track, out_uri, config, handler, cancelledHandler, errorHandler));
                 UserJob.Total++;
             }
 
@@ -233,8 +236,16 @@
         
         private void OnError (object o, TranscoderErrorArgs args)
         {
-            Reset ();
-            Hyena.Log.Error (Catalog.GetString ("Cannot Convert File"), args.Message, true);
+            transcoding = false;
+
+            if (user_job == null || transcoder == null) {
+                return;
+            }
+
+            UserJob.Completed++;
+            current_context.ErrorHandler (current_context.Track);
+            Hyena.Log.Error ("Cannot Convert File", args.Message);
+            ProcessQueue ();
         }
 
 #endregion

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs	Wed Oct  1 17:36:52 2008
@@ -52,6 +52,10 @@
         }
         
         public event EventHandler TitleChanged;
+
+        protected BaseClientWindow (IntPtr ptr) : base (ptr)
+        {
+        }
     
         public BaseClientWindow (string title, string configNameSpace, int defaultWidth, int defaultHeight) : base (title)
         {

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs	Wed Oct  1 17:36:52 2008
@@ -384,7 +384,7 @@
                     "File format conversion support is not available"));
             }
             
-            transcoder.Enqueue (track, PreferredConfiguration, OnTrackTranscoded, OnTrackTranscodeCancelled);
+            transcoder.Enqueue (track, PreferredConfiguration, OnTrackTranscoded, OnTrackTranscodeCancelled, OnTrackTranscodeError);
         }
         
         private void OnTrackTranscoded (TrackInfo track, SafeUri outputUri)
@@ -404,6 +404,12 @@
         {
             IncrementAddedTracks (); 
         }
+
+        private void OnTrackTranscodeError (TrackInfo track)
+        {
+            ErrorSource.AddMessage (Catalog.GetString ("Error converting file"), track.Uri.ToString ());
+            IncrementAddedTracks ();
+        }
         
 #endregion
 



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