diff options
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/GrowlCommunicator.cs | 3 | ||||
-rw-r--r-- | win/C#/Functions/Main.cs | 25 | ||||
-rw-r--r-- | win/C#/Functions/PresetLoader.cs | 4 | ||||
-rw-r--r-- | win/C#/Functions/QueryGenerator.cs | 29 |
4 files changed, 23 insertions, 38 deletions
diff --git a/win/C#/Functions/GrowlCommunicator.cs b/win/C#/Functions/GrowlCommunicator.cs index 5bb5efa70..5db2478d2 100644 --- a/win/C#/Functions/GrowlCommunicator.cs +++ b/win/C#/Functions/GrowlCommunicator.cs @@ -32,8 +32,7 @@ namespace Handbrake.Functions /// <summary>
/// Notification shown upon completion of encoding
/// </summary>
- private static NotificationType encodeOrQueueCompleted = new NotificationType("EncodeOrQueue",
- "HandBrake Status");
+ private static NotificationType encodeOrQueueCompleted = new NotificationType("EncodeOrQueue", "HandBrake Status");
/// <summary>
/// Checks to see if Growl is currently running on the local machine.
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 758abdcc0..c99ce657a 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -14,7 +14,6 @@ namespace Handbrake.Functions using System.Threading;
using System.Windows.Forms;
using System.Xml.Serialization;
- using EncodeQueue;
using Model;
using Parsing;
@@ -26,7 +25,7 @@ namespace Handbrake.Functions /// <summary>
/// The XML Serializer
/// </summary>
- private static readonly XmlSerializer Ser = new XmlSerializer(typeof (List<Job>));
+ private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List<Job>));
/// <summary>
/// Calculate the duration of the selected title and chapters
@@ -106,8 +105,8 @@ namespace Handbrake.Functions int n = dataChpt.Rows.Add();
dataChpt.Rows[n].Cells[0].Value = i + 1;
dataChpt.Rows[n].Cells[1].Value = "Chapter " + (i + 1);
- dataChpt.Rows[n].Cells[0].ValueType = typeof (int);
- dataChpt.Rows[n].Cells[1].ValueType = typeof (string);
+ dataChpt.Rows[n].Cells[0].ValueType = typeof(int);
+ dataChpt.Rows[n].Cells[1].ValueType = typeof(string);
i++;
}
@@ -226,12 +225,10 @@ namespace Handbrake.Functions else // Otherwise, use the path that is already there.
{
// Use the path and change the file extension to match the previous destination
- autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text),
- destinationFilename);
+ autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text), destinationFilename);
if (Path.HasExtension(mainWindow.text_destination.Text))
- autoNamePath = Path.ChangeExtension(autoNamePath,
- Path.GetExtension(mainWindow.text_destination.Text));
+ autoNamePath = Path.ChangeExtension(autoNamePath, Path.GetExtension(mainWindow.text_destination.Text));
}
}
@@ -279,8 +276,7 @@ namespace Handbrake.Functions if (m.Success)
{
- string data = line.Replace("(", string.Empty).Replace(")", string.Empty).Replace("HandBrake ",
- string.Empty);
+ string data = line.Replace("(", string.Empty).Replace(")", string.Empty).Replace("HandBrake ", string.Empty);
string[] arr = data.Split(' ');
Properties.Settings.Default.hb_build = int.Parse(arr[1]);
@@ -322,8 +318,7 @@ namespace Handbrake.Functions {
try
{
- string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
- @"HandBrake\hb_queue_recovery.xml");
+ string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");
if (File.Exists(tempPath))
{
using (FileStream strm = new FileStream(tempPath, FileMode.Open, FileAccess.Read))
@@ -498,11 +493,7 @@ namespace Handbrake.Functions }
catch (Exception exc)
{
- callback(new UpdateCheckResult(debug,
- new UpdateCheckInformation
- {
- Error = exc
- }));
+ callback(new UpdateCheckResult(debug, new UpdateCheckInformation { Error = exc }));
}
}));
}
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs index 95d09e5f5..f5153e970 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -186,9 +186,9 @@ namespace Handbrake.Functions double x264Step = cqStep;
double presetValue = presetQuery.VideoQuality;
- double x = 51/x264Step;
+ double x = 51 / x264Step;
- double calculated = presetValue/x264Step;
+ double calculated = presetValue / x264Step;
calculated = x - calculated;
int.TryParse(calculated.ToString(), out value);
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs index 7775b8cdf..8d429c90b 100644 --- a/win/C#/Functions/QueryGenerator.cs +++ b/win/C#/Functions/QueryGenerator.cs @@ -69,16 +69,14 @@ namespace Handbrake.Functions int.TryParse(mainWindow.drop_chapterFinish.Text, out end);
int calculatedDuration = end - start;
- query += string.Format(" --start-at duration:{0} --stop-at duration:{1}",
- mainWindow.drop_chapterStart.Text, calculatedDuration);
+ query += string.Format(" --start-at duration:{0} --stop-at duration:{1}", mainWindow.drop_chapterStart.Text, calculatedDuration);
break;
case 2: // Frames
int.TryParse(mainWindow.drop_chapterStart.Text, out start);
int.TryParse(mainWindow.drop_chapterFinish.Text, out end);
calculatedDuration = end - start;
- query += string.Format(" --start-at frame:{0} --stop-at frame:{1}",
- mainWindow.drop_chapterStart.Text, calculatedDuration);
+ query += string.Format(" --start-at frame:{0} --stop-at frame:{1}", mainWindow.drop_chapterStart.Text, calculatedDuration);
break;
case 3: // Preview
query += " --previews " + Properties.Settings.Default.previewScanCount + " ";
@@ -86,8 +84,7 @@ namespace Handbrake.Functions query += " --stop-at duration:" + duration + " ";
if (mainWindow.text_destination.Text != string.Empty)
- query += string.Format(" -o \"{0}\" ",
- mainWindow.text_destination.Text.Replace(".m", "_sample.m"));
+ query += string.Format(" -o \"{0}\" ", mainWindow.text_destination.Text.Replace(".m", "_sample.m"));
break;
default:
break;
@@ -231,7 +228,7 @@ namespace Handbrake.Functions break;
case "H.264 (x264)":
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
- value = 51 - mainWindow.slider_videoQuality.Value * cqStep;
+ value = 51 - (mainWindow.slider_videoQuality.Value * cqStep);
value = Math.Round(value, 2);
query += " -q " + value.ToString(culture);
break;
@@ -407,10 +404,10 @@ namespace Handbrake.Functions // Attach Source name and dvd title to the start of the chapters.csv filename.
// This is for the queue. It allows different chapter name files for each title.
- string[] destName = mainWindow.text_destination.Text.Split('\\');
- string dest_name = destName[destName.Length - 1];
- dest_name = dest_name.Replace("\"", string.Empty);
- dest_name = dest_name.Replace(".mp4", string.Empty).Replace(".m4v", string.Empty).Replace(".mkv", string.Empty);
+ string[] destNameSplit = mainWindow.text_destination.Text.Split('\\');
+ string destName = destNameSplit[destNameSplit.Length - 1];
+ destName = destName.Replace("\"", string.Empty);
+ destName = destName.Replace(".mp4", string.Empty).Replace(".m4v", string.Empty).Replace(".mkv", string.Empty);
string sourceTitle = mainWindow.drp_dvdtitle.Text;
string[] titlesplit = sourceTitle.Split(' ');
@@ -418,11 +415,11 @@ namespace Handbrake.Functions if (mainWindow.Check_ChapterMarkers.Checked && mainWindow.Check_ChapterMarkers.Enabled)
{
- if (dest_name.Trim() != String.Empty)
+ if (destName.Trim() != String.Empty)
{
string path = sourceTitle != "Automatic"
- ? Path.Combine(Path.GetTempPath(), dest_name + "-" + sourceTitle + "-chapters.csv")
- : Path.Combine(Path.GetTempPath(), dest_name + "-chapters.csv");
+ ? Path.Combine(Path.GetTempPath(), destName + "-" + sourceTitle + "-chapters.csv")
+ : Path.Combine(Path.GetTempPath(), destName + "-chapters.csv");
if (ChapterCsvSave(mainWindow, path) == false)
query += " -m ";
@@ -535,9 +532,7 @@ namespace Handbrake.Functions }
catch (Exception exc)
{
- MessageBox.Show(
- "Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" +
- exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
}
|