banshee r3249 - in trunk/banshee: . src/Core/Banshee.Core/Banshee.Base src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.MediaEngine src/Core/Banshee.Services/Banshee.ServiceStack src/Libraries/Hyena.Gui/Hyena.Data.Gui win-deps



Author: abock
Date: Sat Feb 16 23:15:23 2008
New Revision: 3249
URL: http://svn.gnome.org/viewvc/banshee?rev=3249&view=rev

Log:
2008-02-16  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.Core/Banshee.Base/PlatformHacks.cs: Only run these
    hacks if we are on Unix, and don't crash even if we are and they fail
    
    * src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs:
    A fake engine that does nothing, used to allow Banshee to at least
    start up on Windows without libbanshee

    * src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs:
    Load the NullPlayerEngine if no real engines could be loaded
    
    * src/Core/Banshee.Services/Banshee.ServiceStack/DBusServiceManager.cs:
    Disable DBus support if BusG.Init fails

    * src/Libraries/Hyena.Gui/Hyena.Data.Gui/CairoHelper.cs: Do not P/Invoke
    to get the cairo context, instead use Gdk.CairoHelper



Added:
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs
   trunk/banshee/win-deps/
   trunk/banshee/win-deps/Mono.Addins.Gui.dll   (contents, props changed)
   trunk/banshee/win-deps/Mono.Addins.Setup.dll   (contents, props changed)
   trunk/banshee/win-deps/Mono.Addins.dll   (contents, props changed)
   trunk/banshee/win-deps/Mono.Data.Sqlite.dll   (contents, props changed)
   trunk/banshee/win-deps/Mono.Posix.dll   (contents, props changed)
   trunk/banshee/win-deps/NDesk.DBus.GLib.dll   (contents, props changed)
   trunk/banshee/win-deps/NDesk.DBus.dll   (contents, props changed)
   trunk/banshee/win-deps/sqlite3.dll   (contents, props changed)
   trunk/banshee/win-deps/taglib-sharp.dll   (contents, props changed)
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/Makefile.am
   trunk/banshee/src/Core/Banshee.Core/Banshee.Base/PlatformHacks.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/DBusServiceManager.cs
   trunk/banshee/src/Core/Banshee.Services/Makefile.am
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/CairoHelper.cs

Modified: trunk/banshee/Makefile.am
==============================================================================
--- trunk/banshee/Makefile.am	(original)
+++ trunk/banshee/Makefile.am	Sat Feb 16 23:15:23 2008
@@ -8,6 +8,21 @@
 	extras \
 	po
 
+WINDOWS_ASSEMBLIES = \
+	Hyena.dll \
+	Hyena.Gui.dll \
+	Banshee.Core.dll \
+	Banshee.Services.dll \
+	Banshee.ThickClient.dll \
+	Banshee.Widgets.dll \
+	Banshee.GStreamer.dll \
+	Banshee.PlayQueue.dll \
+	Banshee.Lastfm.dll \
+	Lastfm.Gui.dll \
+	Lastfm.dll \
+	Mono.Media.dll \
+	Nereid.exe
+
 EXTRA_DIST = \
 	intltool-extract.in \
 	intltool-merge.in \
@@ -60,7 +75,10 @@
 dist-windows: all
 	rm -rf banshee-windows; \
 	mkdir banshee-windows; \
-	cp -rf bin/*.{dll,exe} banshee-windows; \
+	cp -rf win-deps/* banshee-windows; \
+	for asm in $(WINDOWS_ASSEMBLIES); do \
+		cp -rf bin/$$asm banshee-windows; \
+	done; \
 	zip banshee-windows.zip -r banshee-windows; \
 	rm -rf banshee-windows
 

Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Base/PlatformHacks.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Base/PlatformHacks.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Base/PlatformHacks.cs	Sat Feb 16 23:15:23 2008
@@ -42,24 +42,35 @@
         
         public static void TrapMonoJitSegv ()
         {
+            if (Environment.OSVersion.Platform != PlatformID.Unix) {
+                return;
+            }
+        
             // We must get a reference to the JIT's SEGV handler because 
             // GStreamer will set its own and not restore the previous, which
             // will cause what should be NullReferenceExceptions to be unhandled
             // segfaults for the duration of the instance, as the JIT is powerless!
             // FIXME: http://bugzilla.gnome.org/show_bug.cgi?id=391777
-            mono_jit_segv_handler = Marshal.AllocHGlobal (512);
-            sigaction (Mono.Unix.Native.Signum.SIGSEGV, IntPtr.Zero, mono_jit_segv_handler);
+            
+            try {
+                mono_jit_segv_handler = Marshal.AllocHGlobal (512);
+                sigaction (Mono.Unix.Native.Signum.SIGSEGV, IntPtr.Zero, mono_jit_segv_handler);
+            } catch {
+            }
         }
         
         public static void RestoreMonoJitSegv ()
         {
-            if (mono_jit_segv_handler.Equals (IntPtr.Zero)) {
+            if (Environment.OSVersion.Platform != PlatformID.Unix || mono_jit_segv_handler.Equals (IntPtr.Zero)) {
                 return;
             }
             
             // Reset the SEGV handle to that of the JIT again (SIGH!)
-            sigaction (Mono.Unix.Native.Signum.SIGSEGV, mono_jit_segv_handler, IntPtr.Zero);
-            Marshal.FreeHGlobal (mono_jit_segv_handler);
+            try {
+                sigaction (Mono.Unix.Native.Signum.SIGSEGV, mono_jit_segv_handler, IntPtr.Zero);
+                Marshal.FreeHGlobal (mono_jit_segv_handler);
+            } catch {
+            }
         }
                 
         [DllImport ("libgtk-win32-2.0-0.dll")]
@@ -84,6 +95,10 @@
 
         public static void SetProcessName (string name)
         {
+            if (Environment.OSVersion.Platform != PlatformID.Unix) {
+                return;
+            }
+        
             try {
                 if (prctl (15 /* PR_SET_NAME */, Encoding.ASCII.GetBytes (name + "\0"), 
                     IntPtr.Zero, IntPtr.Zero, IntPtr.Zero) != 0) {

Added: trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs	Sat Feb 16 23:15:23 2008
@@ -0,0 +1,83 @@
+//
+// NullPlayerEngine.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;
+using System.Collections;
+
+using Banshee.Base;
+
+namespace Banshee.MediaEngine
+{
+    public class NullPlayerEngine : MediaEngine.PlayerEngine
+    {
+        protected override void OpenUri (SafeUri uri)
+        {
+        }
+        
+        private ushort volume;
+        public override ushort Volume {
+            get { return volume; }
+            set { volume = value; }
+        }
+        
+        public override uint Position {
+            get { return 0; }
+            set { return; }
+        }
+        
+        public override bool CanSeek {
+            get { return false; }
+        }
+        
+        public override uint Length {
+            get { return 0; }
+        }
+        
+        public override bool SupportsEqualizer {
+            get { return false; }
+        }
+        
+        private static string [] source_capabilities = { "file", "http", "cdda" };
+        public override IEnumerable SourceCapabilities {
+            get { return source_capabilities; }
+        }
+        
+        public override IEnumerable ExplicitDecoderCapabilities {
+            get { return null; }
+        }
+        
+        public override string Id {
+            get { return "nullplayerengine"; }
+        }
+        
+        public override string Name {
+            get { return "Null Player Engine"; }
+        }
+        
+    }
+}

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs	Sat Feb 16 23:15:23 2008
@@ -82,6 +82,13 @@
                 LoadEngine (node);
             }
             
+            if (default_engine == null || active_engine == null || engines == null || engines.Count == 0) {
+                Log.Warning (Catalog.GetString (
+                    "No player engines were found. Please ensure Banshee has been cleanly installed."),
+                    "Using the featureless NullPlayerEngine.");
+                LoadEngine (new NullPlayerEngine ());
+            }
+            
             if (default_engine != null) {
                 active_engine = default_engine;
                 Log.Debug (Catalog.GetString ("Default player engine"), active_engine.Name);
@@ -89,18 +96,16 @@
                 default_engine = active_engine;
             }
             
-            if (default_engine == null || active_engine == null || engines == null || engines.Count == 0) {
-                throw new ApplicationException(Catalog.GetString(
-                    "No player engines were found. Please ensure Banshee has been cleanly installed."));
-            }
-            
             MetadataService.Instance.HaveResult += OnMetadataServiceHaveResult;
         }
         
         private void LoadEngine (TypeExtensionNode node)
         {
-            PlayerEngine engine = (PlayerEngine) node.CreateInstance (typeof (PlayerEngine));
-            
+            LoadEngine ((PlayerEngine) node.CreateInstance (typeof (PlayerEngine)));
+        }
+        
+        private void LoadEngine (PlayerEngine engine)
+        {
             engine.StateChanged += OnEngineStateChanged;
             engine.EventChanged += OnEngineEventChanged;
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/DBusServiceManager.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/DBusServiceManager.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/DBusServiceManager.cs	Sat Feb 16 23:15:23 2008
@@ -52,7 +52,13 @@
                 return;
             }
             
-            BusG.Init();
+            try {
+                BusG.Init();
+            } catch {
+                Log.Warning ("DBus support could not be started. Disabling for this session.");
+                dbus_enabled = false;
+                return;
+            }
             
             try {
                 RequestNameReply name_reply = Bus.Session.RequestName(BusName);

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	Sat Feb 16 23:15:23 2008
@@ -41,6 +41,7 @@
 	Banshee.Library/LibrarySource.cs \
 	Banshee.MediaEngine/IEqualizer.cs \
 	Banshee.MediaEngine/IPlayerEngineService.cs \
+	Banshee.MediaEngine/NullPlayerEngine.cs \
 	Banshee.MediaEngine/PlayerEngine.cs \
 	Banshee.MediaEngine/PlayerEngineEvent.cs \
 	Banshee.MediaEngine/PlayerEngineService.cs \

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/CairoHelper.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/CairoHelper.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/CairoHelper.cs	Sat Feb 16 23:15:23 2008
@@ -34,21 +34,23 @@
 {
     public static class CairoHelper
     {
-        [System.Runtime.InteropServices.DllImport("libgdk-x11-2.0.so")]
-        private static extern IntPtr gdk_cairo_create(IntPtr raw);
+        [System.Runtime.InteropServices.DllImport ("libgdk-x11-2.0.so")]
+        private static extern IntPtr gdk_cairo_create (IntPtr raw);
 
-        public static Cairo.Context CreateCairoDrawable(Gdk.Drawable drawable)
+        public static Cairo.Context CreateCairoDrawable (Gdk.Drawable drawable)
         {
-            if(drawable == null) {
+            if (drawable == null) {
                 return null;
             }
             
-            Cairo.Context context = new Cairo.Context(gdk_cairo_create(drawable.Handle));
+            return Gdk.CairoHelper.Create (drawable);
+            
+            /*Cairo.Context context = new Cairo.Context(gdk_cairo_create(drawable.Handle));
             if(context == null) {
                 throw new ApplicationException("Could not create Cairo.Context");
             }
 
-            return context;
+            return context;*/
         }
     }
 }

Added: trunk/banshee/win-deps/Mono.Addins.Gui.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/Mono.Addins.Setup.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/Mono.Addins.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/Mono.Data.Sqlite.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/Mono.Posix.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/NDesk.DBus.GLib.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/NDesk.DBus.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/sqlite3.dll
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/win-deps/taglib-sharp.dll
==============================================================================
Binary file. No diff available.



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