summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-01-29 21:49:05 +0000
committersr55 <[email protected]>2009-01-29 21:49:05 +0000
commit0333e36d98952fc75b07a35bb2dd5affe526b25a (patch)
tree98bfbe7260eae1cffba33107bd19379cadad2b11 /win/C#/Functions
parent9cfe126a970a4a7c544b8142224675a93637d31e (diff)
WinGui:
- Code cleanup git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2106 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Encode.cs11
-rw-r--r--win/C#/Functions/QueryParser.cs13
2 files changed, 7 insertions, 17 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs
index 3f126d7e5..ed8920c91 100644
--- a/win/C#/Functions/Encode.cs
+++ b/win/C#/Functions/Encode.cs
@@ -7,7 +7,6 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
-using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
@@ -23,10 +22,7 @@ namespace Handbrake.Functions
// Declarations
Process hbProc = new Process();
- Boolean encoding = false;
-
- // CLI output is based on en-US locale,
- static readonly private CultureInfo Culture = new CultureInfo("en-US", false);
+ Boolean encoding;
/// <summary>
/// Execute a HandBrakeCLI process.
@@ -88,7 +84,7 @@ namespace Handbrake.Functions
switch (Properties.Settings.Default.CompletionOption)
{
case "Shutdown":
- System.Diagnostics.Process.Start("Shutdown", "-s -t 60");
+ Process.Start("Shutdown", "-s -t 60");
break;
case "Log Off":
ExitWindowsEx(0, 0);
@@ -143,7 +139,6 @@ namespace Handbrake.Functions
if (Properties.Settings.Default.saveLog == "Checked")
{
string logPath = Path.Combine(Path.GetTempPath(), "hb_encode_log.dat");
- Functions.QueryParser parsed = Functions.QueryParser.Parse(query);
if (Properties.Settings.Default.saveLogWithVideo == "Checked")
{
@@ -175,7 +170,7 @@ namespace Handbrake.Functions
/// </summary>
public Boolean isEncoding
{
- get { if (encoding == false) return false; else return true; }
+ get { return encoding; }
}
}
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index df048c5d1..f189e1bbc 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -718,8 +718,7 @@ namespace Handbrake.Functions
if (chapters.Success)
{
- var actTitles = new string[2];
- actTitles = chapters.ToString().Replace("-c ", "").Split('-');
+ string[] actTitles = chapters.ToString().Replace("-c ", "").Split('-');
thisQuery.q_chaptersStart = int.Parse(actTitles[0]);
if (actTitles.Length > 1)
{
@@ -777,8 +776,7 @@ namespace Handbrake.Functions
if (crop.Success)
{
thisQuery.q_cropValues = crop.ToString().Replace("--crop ", "");
- var actCropValues = new string[3];
- actCropValues = thisQuery.q_cropValues.Split(':');
+ string[] actCropValues = thisQuery.q_cropValues.Split(':');
thisQuery.q_croptop = actCropValues[0];
thisQuery.q_cropbottom = actCropValues[1];
thisQuery.q_cropLeft = actCropValues[2];
@@ -853,17 +851,14 @@ namespace Handbrake.Functions
thisQuery.q_twoPass = twoPass.Success;
thisQuery.q_turboFirst = turboFirstPass.Success;
thisQuery.q_largeMp4 = largerMp4.Success;
- if (videoFramerate.Success)
- thisQuery.q_videoFramerate = videoFramerate.ToString().Replace("-r ", "");
- else
- thisQuery.q_videoFramerate = "Same as source";
+ thisQuery.q_videoFramerate = videoFramerate.Success ? videoFramerate.ToString().Replace("-r ", "") : "Same as source";
if (videoBitrate.Success)
thisQuery.q_avgBitrate = videoBitrate.ToString().Replace("-b ", "");
if (videoFilesize.Success)
thisQuery.q_videoTargetSize = videoFilesize.ToString().Replace("-S ", "");
- double qConvert = 0;
+ double qConvert;
if (videoQuality.Success)
{
qConvert = double.Parse(videoQuality.ToString().Replace("-q ", ""), Culture)*100;