[banshee] Windows: fix build, avoiding C# default params (bgo#699379)



commit ac0ac3458a6db531773d680b660fc5c90e006035
Author: Michael Farrell <micolous gmail com>
Date:   Mon Oct 7 15:39:36 2013 +0200

    Windows: fix build, avoiding C# default params (bgo#699379)
    
    When using the latest versions of Mono and .NET (i.e.: the ones
    that include the .NET 4.5 profile), even if you decide to use the
    .NET 3.5 Profile (whose C# language version was 3.0), it allows
    you use language features from higher versions of the language.
    
    This is the reason why the build wasn't failing on mono even when
    using the 'gmcs' compiler. However, we still advertise in our
    dependencies only the .NET 2.0 Profile, so a Windows developer
    could try to build Banshee with a version of Visual Studio which
    still doesn't support the "optional parameters" language feature.
    
    We fix this by providing simply additional overloads that account
    for the cases in which the parameter is not supplied, in a way in
    which we don't break any API.
    
    To avoid this problem arising in the future, we also add the proper
    flag to pass to the Mono compiler to error on language features
    that are too new for the .NET profile that we target. However, in
    the very near future we should probably just switch to .NET 4.0
    to make things more simple (not in the stable branch though, which
    is where this commit is going to be cherrypicked too).
    
    Signed-off-by: Andrés G. Aragoneses <knocte gmail com>

 configure.ac                                       |    3 +++
 .../Banshee.GStreamer/PlayerEngine.cs              |    2 +-
 .../Banshee.GStreamerSharp/PlayerEngine.cs         |    2 +-
 .../Banshee.MediaEngine/NullPlayerEngine.cs        |    2 +-
 .../Banshee.MediaEngine/PlayerEngine.cs            |    6 +++++-
 .../Banshee.MediaEngine/PlayerEngineService.cs     |    7 ++++++-
 6 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a892c73..6c91fb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,9 @@ else
 fi
 #FIXME: add "-warnaserror" back above!
 
+#TODO: for simplicity, just remove langversion and use .NET 4.0 moving forward
+GMCS_FLAGS="$GMC_FLAGS -langversion:3"
+
 AC_SUBST(GMCS_FLAGS)
 
 AM_CONDITIONAL(HYENA_PKG_CONFIG, false)
diff --git a/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs 
b/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
index 1fbfcaf..b60e155 100644
--- a/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
+++ b/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
@@ -278,7 +278,7 @@ namespace Banshee.GStreamer
             }
         }
 
-        public override void Seek (uint position, bool accurate_seek = false)
+        public override void Seek (uint position, bool accurate_seek)
         {
             bp_set_position (handle, (ulong)position, accurate_seek);
             OnEventChanged (PlayerEvent.Seek);
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
index f18b1e5..7258e42 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
@@ -449,7 +449,7 @@ namespace Banshee.GStreamerSharp
             next_track_set.Set ();
         }
 
-        public override void Seek (uint position, bool accurate_seek = false)
+        public override void Seek (uint position, bool accurate_seek)
         {
             SeekFlags seek_flags = SeekFlags.Flush;
             if (accurate_seek) {
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs
index fb92252..33094ce 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/NullPlayerEngine.cs
@@ -49,7 +49,7 @@ namespace Banshee.MediaEngine
             OnStateChanged (PlayerState.Paused);
         }
 
-        public override void Seek (uint position, bool accurate_seek = false)
+        public override void Seek (uint position, bool accurate_seek)
         {
         }
 
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs
index 6920048..d323b9e 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs
@@ -148,8 +148,12 @@ namespace Banshee.MediaEngine
 
         public abstract void Pause ();
 
-        public abstract void Seek (uint position, bool accurate_seek = false);
+        public abstract void Seek (uint position, bool accurate_seek);
 
+        public void Seek (uint position)
+        {
+            Seek (position, false);
+        }
 
         public virtual void SetNextTrackUri (SafeUri uri, bool maybeVideo)
         {
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
index e5ef2f1..3aec4b3 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
@@ -538,11 +538,16 @@ namespace Banshee.MediaEngine
             }
         }
 
-        public void Seek (uint position, bool accurate_seek = false)
+        public void Seek (uint position, bool accurate_seek)
         {
             active_engine.Seek (position, accurate_seek);
         }
 
+        public void Seek (uint position)
+        {
+            Seek (position, false);
+        }
+
         public void VideoExpose (IntPtr displayContext, bool direct)
         {
             active_engine.VideoExpose (displayContext, direct);


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