]> granicus.if.org Git - handbrake/commitdiff
WinGui: Several more culture issue fixes.
authorsr55 <sr55.hb@outlook.com>
Fri, 4 Nov 2011 23:02:19 +0000 (23:02 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 4 Nov 2011 23:02:19 +0000 (23:02 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4340 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Controls/x264Panel.cs
win/CS/Functions/QueryGenerator.cs
win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/ToolWindows/AdvancedAudio.cs
win/CS/frmMain.cs
win/CS/frmOptions.cs

index c7625d720402e07322a1c7967043c2c412af3054..732ee2d4fe27d5404b9ec35344eece08a2c8926f 100644 (file)
@@ -27,8 +27,6 @@ namespace Handbrake.Controls
         /// </summary>\r
         private readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;\r
 \r
-        private CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");\r
-\r
         /// <summary>\r
         /// Initializes a new instance of the <see cref="x264Panel"/> class. \r
         /// Initializes a new instance of the x264 panel user control\r
@@ -480,7 +478,7 @@ namespace Handbrake.Controls
                             else\r
                             {\r
                                 double value = slider_adaptiveQuantStrength.Value * 0.1;\r
-                                string aqs = value.ToString("f1", culture);\r
+                                string aqs = value.ToString("f1", CultureInfo.InvariantCulture);\r
                                 thisOpt = "aq-strength=" + aqs;\r
                             }\r
                         }\r
@@ -493,8 +491,8 @@ namespace Handbrake.Controls
                                 double psyrd = slider_psyrd.Value * 0.1;\r
                                 double psytre = slider_psytrellis.Value * 0.05;\r
 \r
-                                string rd = psyrd.ToString("f2", culture);\r
-                                string rt = psytre.ToString("f2", culture);\r
+                                string rd = psyrd.ToString("f2", CultureInfo.InvariantCulture);\r
+                                string rt = psytre.ToString("f2", CultureInfo.InvariantCulture);\r
 \r
                                 thisOpt = "psy-rd=" + rd + "," + rt;\r
                             }\r
@@ -783,7 +781,7 @@ namespace Handbrake.Controls
                 else\r
                 {\r
                     double value = slider_adaptiveQuantStrength.Value * 0.1;\r
-                    string aqs = value.ToString("f1", culture);\r
+                    string aqs = value.ToString("f1", CultureInfo.InvariantCulture);\r
                     query += colon + "aq-strength=" + aqs;\r
                 }\r
             }\r
@@ -796,8 +794,8 @@ namespace Handbrake.Controls
                     double psyrd = slider_psyrd.Value * 0.1;\r
                     double psytre = slider_psytrellis.Value * 0.05;\r
 \r
-                    string rd = psyrd.ToString("f1", culture);\r
-                    string rt = psytre.ToString("f2", culture);\r
+                    string rd = psyrd.ToString("f1", CultureInfo.InvariantCulture);\r
+                    string rt = psytre.ToString("f2", CultureInfo.InvariantCulture);\r
 \r
                     query += colon + "psy-rd=" + rd + "," + rt;\r
                 }\r
index c042daa79c4812837fae65b838cc1fa9c0d7b03a..7bf0dd01b390fe8bba56eef57fe5fea77f56c375 100644 (file)
@@ -374,17 +374,16 @@ namespace Handbrake.Functions
                     case "MPEG-4 (FFmpeg)":\r
                     case "MPEG-2 (FFmpeg)":\r
                         value = 31 - (mainWindow.slider_videoQuality.Value - 1);\r
-                        query += " -q " + value.ToString(new CultureInfo("en-US"));\r
+                        query += " -q " + value.ToString(CultureInfo.InvariantCulture);\r
                         break;\r
                     case "H.264 (x264)":\r
-                        CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");\r
                         value = 51 - (mainWindow.slider_videoQuality.Value * cqStep);\r
                         value = Math.Round(value, 2);\r
-                        query += " -q " + value.ToString(culture);\r
+                        query += " -q " + value.ToString(CultureInfo.InvariantCulture);\r
                         break;\r
                     case "VP3 (Theora)":\r
                         value = mainWindow.slider_videoQuality.Value;\r
-                        query += " -q " + value.ToString(new CultureInfo("en-US"));\r
+                        query += " -q " + value.ToString(CultureInfo.InvariantCulture);\r
                         break;\r
                 }\r
             }\r
index 362a86a7ef7409e4d901a453a35cf3b546b2f8cd..6b3d517c981fe85d1f84673e1629605b42d25ae8 100644 (file)
@@ -21,11 +21,6 @@ namespace HandBrake.ApplicationServices.Parsing
     /// </summary>\r
     public class Title\r
     {\r
-        /// <summary>\r
-        /// The Culture Info\r
-        /// </summary>\r
-        private static readonly CultureInfo Culture = new CultureInfo("en-US", false);\r
-\r
         /// <summary>\r
         /// The User Setting Service\r
         /// </summary>\r
@@ -193,8 +188,8 @@ namespace HandBrake.ApplicationServices.Parsing
             {\r
                 thisTitle.Resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
                 thisTitle.ParVal = new Size(int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value));\r
-                thisTitle.AspectRatio = float.Parse(m.Groups[5].Value, Culture);\r
-                thisTitle.Fps = float.Parse(m.Groups[6].Value, Culture);\r
+                thisTitle.AspectRatio = float.Parse(m.Groups[5].Value, CultureInfo.InvariantCulture);\r
+                thisTitle.Fps = float.Parse(m.Groups[6].Value, CultureInfo.InvariantCulture);\r
             }\r
 \r
             // Get autocrop region for this title\r
index 9835603cdf472d3769ebd89acd4bbaa1bee4d00d..07da56ec08f7274d95d0e536f9dc7dd65bae0a4b 100644 (file)
@@ -306,17 +306,16 @@ namespace HandBrake.ApplicationServices.Utilities
                     {\r
                         case VideoEncoder.FFMpeg:\r
                             value = 31 - (task.Quality.Value - 1);\r
-                            query += string.Format(" -q {0}", value.ToString(new CultureInfo("en-US")));\r
+                            query += string.Format(" -q {0}", value.ToString(CultureInfo.InvariantCulture));\r
                             break;\r
                         case VideoEncoder.X264:\r
-                            CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");\r
                             value = 51 - (task.Quality.Value * x264CqStep);\r
                             value = Math.Round(value, 2);\r
-                            query += string.Format(" -q {0}", value.ToString(culture));\r
+                            query += string.Format(" -q {0}", value.ToString(CultureInfo.InvariantCulture));\r
                             break;\r
                         case VideoEncoder.Theora:\r
                             value = task.Quality.Value;\r
-                            query += string.Format(" -q {0}", value.ToString(new CultureInfo("en-US")));\r
+                            query += string.Format(" -q {0}", value.ToString(CultureInfo.InvariantCulture));\r
                             break;\r
                     }\r
                     break;\r
index be4f8a306cab4d361f8a9f07bff77968ad1145fd..4a668d36789d744d871ad6e23c4788ad3fbe10f6 100644 (file)
@@ -11,9 +11,7 @@ namespace HandBrake.Interop.SourceData
 {\r
     using System;\r
     using System.Collections.Generic;\r
-    using System.Globalization;\r
 \r
-    using HandBrake.Interop;\r
     using HandBrake.Interop.Model;\r
 \r
     /// <summary>\r
@@ -21,7 +19,6 @@ namespace HandBrake.Interop.SourceData
        /// </summary>\r
        public class Title\r
        {\r
-               private static readonly CultureInfo Culture = new CultureInfo("en-US", false);\r
                private readonly List<AudioTrack> audioTracks;\r
                private readonly List<Chapter> chapters;\r
                private readonly List<Subtitle> subtitles;\r
index 9af9590f3252de463ca3ad9fc7d3d5ce4725bbac..35207e3b88ecd780c244e7a198f033a663e84c27 100644 (file)
@@ -1407,7 +1407,7 @@ namespace HandBrakeWPF.ViewModels
             this.ConstantQualityGranularity.Add("0.50");\r
             this.ConstantQualityGranularity.Add("0.25");\r
             this.ConstantQualityGranularity.Add("0.20");\r
-            this.selectedGranulairty = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step).ToString("0.00", new CultureInfo("en-US"));\r
+            this.selectedGranulairty = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step).ToString("0.00", CultureInfo.InvariantCulture);\r
 \r
             // Min Title Length\r
             this.minLength = this.userSettingService.GetUserSetting<int>(ASUserSettingConstants.MinScanDuration);\r
index d1fb0763e593214a8419e81cbffc19214030ad67..f3446797cc822f5ae9a04c5ae0682ced21f5bb53 100644 (file)
@@ -16,9 +16,6 @@ namespace Handbrake.ToolWindows
     /// </summary>\r
     public partial class AdvancedAudio : Form\r
     {\r
-        // Culture Info\r
-        private static readonly CultureInfo Culture = new CultureInfo("en-US", false);\r
-\r
         /// <summary>\r
         /// Initializes a new instance of the <see cref="AdvancedAudio"/> class. \r
         /// </summary>\r
@@ -69,9 +66,9 @@ namespace Handbrake.ToolWindows
                 int drcCalculated;\r
                 if (track.DRC != 0)\r
                     drcValue = ((track.DRC * 10) + 1) - 10;\r
-                int.TryParse(drcValue.ToString(Culture), out drcCalculated);\r
+                int.TryParse(drcValue.ToString(CultureInfo.InvariantCulture), out drcCalculated);\r
                 tb_drc.Value = drcCalculated;\r
-                lbl_drc.Text = track.DRC.ToString(Culture);\r
+                lbl_drc.Text = track.DRC.ToString(CultureInfo.InvariantCulture);\r
                 tb_drc.Enabled = track.TrackDisplay.Contains("(AC3)");\r
 \r
                 // Se the Track Name\r
@@ -119,7 +116,7 @@ namespace Handbrake.ToolWindows
             int drcCalculated;\r
             if (track.DRC != 0)\r
                 drcValue = ((track.DRC * 10) + 1) - 10;\r
-            int.TryParse(drcValue.ToString(Culture), out drcCalculated);\r
+            int.TryParse(drcValue.ToString(CultureInfo.InvariantCulture), out drcCalculated);\r
             tb_drc.Value = drcCalculated;\r
 \r
             // Set the model.\r
@@ -142,7 +139,7 @@ namespace Handbrake.ToolWindows
             else\r
                 value = ((tb_drc.Value - 1) / 10.0) + 1;\r
 \r
-            lbl_drc.Text = value.ToString(Culture);\r
+            lbl_drc.Text = value.ToString(CultureInfo.InvariantCulture);\r
             track.DRC = value;\r
         }\r
 \r
index b1e5196fbd6182236423cdf127843803006527e0..4f2e70c2bcb3549b51dd6cce721d9f8a024137ce 100644 (file)
@@ -1970,7 +1970,7 @@ namespace Handbrake
                 case "H.264 (x264)":\r
                     double rfValue = 51.0 - slider_videoQuality.Value * cqStep;\r
                     rfValue = Math.Round(rfValue, 2);\r
-                    lbl_SliderValue.Text = "RF:" + rfValue.ToString(new CultureInfo("en-US"));\r
+                    lbl_SliderValue.Text = "RF:" + rfValue.ToString(CultureInfo.InvariantCulture);\r
 \r
                     if (rfValue == 0)\r
                     {\r
index 651d5fff30df61728b532a4a3aa8febf6e08b565..3fc663473a492b4ed7c065a85ca6693e0c9eeb44 100644 (file)
@@ -229,7 +229,7 @@ namespace Handbrake
             drop_previewScanCount.SelectedItem = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount).ToString();\r
 \r
             // x264 step\r
-            string step = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step).ToString(new CultureInfo("en-US"));\r
+            string step = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step).ToString(CultureInfo.InvariantCulture);\r
             switch (step)\r
             {\r
                 case "1":\r