[chronojump] On Linux audio is recommended to be off until Mono has this fixed



commit 4f2223a66d07e45b1cd24e5eb75fb756a079998a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Nov 10 00:51:45 2014 +0100

    On Linux audio is recommended to be off until Mono has this fixed

 src/gui/chronojump.cs |   13 +++++++++++++
 src/utilAll.cs        |   14 ++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 183dc7b..5fbc47c 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -503,6 +503,11 @@ public partial class ChronoJumpWindow
                //put videoOn as false before loading preferences to start always without the camera
                //this is good if camera produces crash
                SqlitePreferences.Update("videoOn", "False", false);
+               
+               //on Linux put volumeOn on false on start because there's a bug on Mono and audio
+               //https://github.com/mono/mono/pull/1376
+               if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.LINUX)
+                       SqlitePreferences.Update("volumeOn", "False", false);
 
                //preferencesLoaded is a fix to a gtk#-net-windows-bug where radiobuttons raise signals
                //at initialization of chronojump and gives problems if this signals are raised while 
preferences are loading
@@ -3110,6 +3115,14 @@ public partial class ChronoJumpWindow
                if(checkbutton_volume.Active) {
                        preferences.volumeOn = true;
                        SqlitePreferences.Update("volumeOn", "True", false);
+                       
+                       //on Linux put volumeOn on false on start because there's a bug on Mono and audio
+                       //https://github.com/mono/mono/pull/1376
+                       new DialogMessage(Constants.MessageTypes.WARNING, 
+                                       "There's an audio problem with Mono on Linux.\n" +
+                                       "We recommend to have sound disabled. More info:\n" +
+                                       "https://github.com/mono/mono/pull/1376";
+                                       );
                } else {
                        preferences.volumeOn = false;
                        SqlitePreferences.Update("volumeOn", "False", false);
diff --git a/src/utilAll.cs b/src/utilAll.cs
index a3b6687..c404ca6 100644
--- a/src/utilAll.cs
+++ b/src/utilAll.cs
@@ -45,6 +45,20 @@ public class UtilAll
                string osString =  string.Format("{0}, {1}", os.Platform, os.Version);
                return osString;
        }
+
+       public enum OperatingSystems { WINDOWS, LINUX, MACOSX };
+
+       public static OperatingSystems GetOSEnum() 
+       {
+               string os = GetOS();
+               if(os.ToUpper().StartsWith("WIN"))
+                       return OperatingSystems.WINDOWS;
+               else if(os.ToUpper().StartsWith("MAC"))
+                       return OperatingSystems.MACOSX;
+               else
+                       return OperatingSystems.LINUX;
+       }
+
        
        public static string GetApplicationDataDir() {
                return Path.Combine(


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