[banshee/windows: 2/7] Resolve Bpm Action<T, V> issue, MD reordered some src files



commit 3e014b0b9493ae61df453da6f1be3c206b582b87
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Wed Apr 22 19:28:05 2009 -0500

    Resolve Bpm Action<T,V> issue, MD reordered some src files
---
 .../Banshee.GStreamer/BpmDetector.cs               |    6 +++---
 .../Banshee.MediaEngine/IBpmDetector.cs            |   16 +++++++++++++++-
 .../Banshee.Bpm/Banshee.Bpm/BpmDetectJob.cs        |    6 +++---
 src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs |    8 ++++----
 src/Libraries/Mono.Data.Sqlite/Makefile.am         |    6 +++---
 5 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/src/Backends/Banshee.GStreamer/Banshee.GStreamer/BpmDetector.cs b/src/Backends/Banshee.GStreamer/Banshee.GStreamer/BpmDetector.cs
index 709863d..f2b11f2 100644
--- a/src/Backends/Banshee.GStreamer/Banshee.GStreamer/BpmDetector.cs
+++ b/src/Backends/Banshee.GStreamer/Banshee.GStreamer/BpmDetector.cs
@@ -55,7 +55,7 @@ namespace Banshee.GStreamer
         private BpmDetectorFinishedHandler finished_cb;
         //private BpmDetectorErrorHandler error_cb;
         
-        public event Action<SafeUri, int> FileFinished;
+        public event BpmEventHandler FileFinished;
         
         public BpmDetector ()
         {
@@ -114,9 +114,9 @@ namespace Banshee.GStreamer
         
         private void OnFileFinished (SafeUri uri, int bpm)
         {
-            Action<SafeUri, int> handler = FileFinished;
+            BpmEventHandler handler = FileFinished;
             if (handler != null) {
-                handler (uri, bpm);
+                handler (this, new BpmEventArgs (uri, bpm));
             }
         }
         
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/IBpmDetector.cs b/src/Core/Banshee.Services/Banshee.MediaEngine/IBpmDetector.cs
index 8d49df7..888a4ab 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/IBpmDetector.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/IBpmDetector.cs
@@ -34,9 +34,23 @@ using Banshee.Collection;
 
 namespace Banshee.MediaEngine
 {
+    public delegate void BpmEventHandler (object o, BpmEventArgs args);
+    
+    public class BpmEventArgs : EventArgs
+    {
+        public SafeUri Uri { get; private set; }
+        public int Bpm { get; private set; }
+
+        public BpmEventArgs (SafeUri uri, int bpm)
+        {
+            Uri = uri;
+            Bpm = bpm;
+        }
+    }
+
     public interface IBpmDetector : IDisposable
     {
-        //event Action<SafeUri, int> FileFinished;
+        event BpmEventHandler FileFinished;
 
         void ProcessFile (SafeUri uri);
         void Cancel ();
diff --git a/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmDetectJob.cs b/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmDetectJob.cs
index e673d3a..5563ce9 100644
--- a/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmDetectJob.cs
+++ b/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmDetectJob.cs
@@ -131,11 +131,11 @@ namespace Banshee.Bpm
             }
         }
 
-        private void OnFileFinished (SafeUri uri, int bpm)
+        private void OnFileFinished (object o, BpmEventArgs args)
         {
             // This is run on the main thread b/c of GStreamer, so do as little as possible here
-            result_uri = uri;
-            result_bpm = bpm;
+            result_uri = args.Uri;
+            result_bpm = args.Bpm;
             result_ready_event.Set ();
         }
 
diff --git a/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs b/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs
index 3090de8..818fce3 100644
--- a/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs
+++ b/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs
@@ -157,17 +157,17 @@ namespace Banshee.Bpm
             }
         }
 
-        private void OnFileFinished (SafeUri uri, int bpm)
+        private void OnFileFinished (object o, BpmEventArgs args)
         {
             ThreadAssist.ProxyToMain (delegate {
                 detect_button.Sensitive = true;
 
-                if (track.Uri != uri || bpm == 0) {
+                if (track.Uri != args.Uri || args.Bpm == 0) {
                     return;
                 }
 
-                Log.DebugFormat ("Detected BPM of {0} for {1}", bpm, uri);
-                Bpm = bpm;
+                Log.DebugFormat ("Detected BPM of {0} for {1}", args.Bpm, args.Uri);
+                Bpm = args.Bpm;
                 OnChanged (null, null);
             });
         }
diff --git a/src/Libraries/Mono.Data.Sqlite/Makefile.am b/src/Libraries/Mono.Data.Sqlite/Makefile.am
index f8e8423..69982a2 100644
--- a/src/Libraries/Mono.Data.Sqlite/Makefile.am
+++ b/src/Libraries/Mono.Data.Sqlite/Makefile.am
@@ -7,8 +7,8 @@ SOURCES =  \
 	Mono.Data.Sqlite/SQLite3.cs \
 	Mono.Data.Sqlite/SQLite3_UTF16.cs \
 	Mono.Data.Sqlite/SQLiteBase.cs \
-	Mono.Data.Sqlite/SQLiteCommandBuilder.cs \
 	Mono.Data.Sqlite/SQLiteCommand.cs \
+	Mono.Data.Sqlite/SQLiteCommandBuilder.cs \
 	Mono.Data.Sqlite/SQLiteConnection.cs \
 	Mono.Data.Sqlite/SQLiteConnectionStringBuilder.cs \
 	Mono.Data.Sqlite/SQLiteConvert.cs \
@@ -18,11 +18,11 @@ SOURCES =  \
 	Mono.Data.Sqlite/SQLiteEnlistment.cs \
 	Mono.Data.Sqlite/SQLiteException.cs \
 	Mono.Data.Sqlite/SQLiteFactory.cs \
-	Mono.Data.Sqlite/SQLiteFunctionAttribute.cs \
 	Mono.Data.Sqlite/SQLiteFunction.cs \
+	Mono.Data.Sqlite/SQLiteFunctionAttribute.cs \
 	Mono.Data.Sqlite/SQLiteMetaDataCollectionNames.cs \
-	Mono.Data.Sqlite/SQLiteParameterCollection.cs \
 	Mono.Data.Sqlite/SQLiteParameter.cs \
+	Mono.Data.Sqlite/SQLiteParameterCollection.cs \
 	Mono.Data.Sqlite/SQLiteStatement.cs \
 	Mono.Data.Sqlite/SQLiteTransaction.cs \
 	Mono.Data.Sqlite/SR.Designer.cs \



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