summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-02-25 20:45:44 +0000
committersr55 <[email protected]>2010-02-25 20:45:44 +0000
commit8c3709d289a996567d459a92d64378ddebb7d2f9 (patch)
tree13936b652aee6a05466e1c2d14b9b4a62bf263e9 /win/C#/Functions
parent4de954484ea3b2bac3d48e502acb616e2b6779c1 (diff)
WinGui:
- Make the picture settings panel work more like the macgui. No longer uses -X Max Width but instead does all the logic in-gui so it's less confusing to the user. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3139 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/QueryGenerator.cs47
-rw-r--r--win/C#/Functions/QueryParser.cs25
-rw-r--r--win/C#/Functions/Scan.cs7
3 files changed, 32 insertions, 47 deletions
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index c1cadfd71..7775b8cdf 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -60,7 +60,7 @@ namespace Handbrake.Functions
query += string.Format(" -c {0}", mainWindow.drop_chapterStart.Text);
else if (mainWindow.drop_chapterStart.Text != string.Empty &&
mainWindow.drop_chapterFinish.Text != string.Empty)
- query += string.Format(" -c {0}-{1}", mainWindow.drop_chapterStart.Text,
+ query += string.Format(" -c {0}-{1}", mainWindow.drop_chapterStart.Text,
mainWindow.drop_chapterFinish.Text);
break;
case 1: // Seconds
@@ -69,7 +69,7 @@ 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}",
+ query += string.Format(" --start-at duration:{0} --stop-at duration:{1}",
mainWindow.drop_chapterStart.Text, calculatedDuration);
break;
case 2: // Frames
@@ -77,7 +77,7 @@ namespace Handbrake.Functions
int.TryParse(mainWindow.drop_chapterFinish.Text, out end);
calculatedDuration = end - start;
- query += string.Format(" --start-at frame:{0} --stop-at frame:{1}",
+ query += string.Format(" --start-at frame:{0} --stop-at frame:{1}",
mainWindow.drop_chapterStart.Text, calculatedDuration);
break;
case 3: // Preview
@@ -86,7 +86,7 @@ namespace Handbrake.Functions
query += " --stop-at duration:" + duration + " ";
if (mainWindow.text_destination.Text != string.Empty)
- query += string.Format(" -o \"{0}\" ",
+ query += string.Format(" -o \"{0}\" ",
mainWindow.text_destination.Text.Replace(".m", "_sample.m"));
break;
default:
@@ -127,38 +127,13 @@ namespace Handbrake.Functions
#region Picture Settings Tab
- // Use MaxWidth for built-in presets and width for user settings.
- if (mainWindow.PictureSettings.PresetMaximumResolution.Width == 0)
- {
- if (mainWindow.PictureSettings.text_width.Value != 0)
- if (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex != 1)
- // Prevent usage for strict anamorphic
- query += " -w " + mainWindow.PictureSettings.text_width.Text;
- }
- else
- {
- if (mainWindow.PictureSettings.text_width.Value != 0)
- if (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex != 1)
- query += " -X " + mainWindow.PictureSettings.text_width.Text;
- }
+ if (mainWindow.PictureSettings.text_width.Value != 0)
+ if (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex != 1) // Prevent usage for strict anamorphic
+ query += " -w " + mainWindow.PictureSettings.text_width.Text;
- // Use MaxHeight for built-in presets and height for user settings.
- if (mainWindow.PictureSettings.PresetMaximumResolution.Height == 0)
- {
- if (mainWindow.PictureSettings.text_height.Value != 0)
- if (mainWindow.PictureSettings.text_height.Text != string.Empty)
- if (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex == 0 ||
- mainWindow.PictureSettings.drp_anamorphic.SelectedIndex == 3)
- // Prevent usage for strict anamorphic
- query += " -l " + mainWindow.PictureSettings.text_height.Text;
- }
- else
- {
- if (mainWindow.PictureSettings.text_height.Value != 0)
- if (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex == 0 ||
- mainWindow.PictureSettings.drp_anamorphic.SelectedIndex == 3)
- query += " -Y " + mainWindow.PictureSettings.text_height.Text;
- }
+ if (mainWindow.PictureSettings.text_height.Value != 0 && mainWindow.PictureSettings.text_height.Text != string.Empty)
+ if (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex == 0 || mainWindow.PictureSettings.drp_anamorphic.SelectedIndex == 3) // Prevent usage for strict anamorphic
+ query += " -l " + mainWindow.PictureSettings.text_height.Text;
string cropTop = mainWindow.PictureSettings.crop_top.Text;
string cropBottom = mainWindow.PictureSettings.crop_bottom.Text;
@@ -256,7 +231,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;
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index 9d5b9a9e5..95b153aa3 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -1,8 +1,7 @@
/* QueryParser.cs $
-
- This file is part of the HandBrake source code.
- Homepage: <http://handbrake.fr>.
- It may be used under the terms of the GNU General Public License. */
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
namespace Handbrake.Functions
{
@@ -13,8 +12,14 @@ namespace Handbrake.Functions
using System.Windows.Forms;
using Model;
+ /// <summary>
+ /// Parse a CLI Query
+ /// </summary>
public class QueryParser
{
+ /// <summary>
+ /// The Culture
+ /// </summary>
private static readonly CultureInfo Culture = new CultureInfo("en-US", false);
#region Varibles
@@ -433,9 +438,7 @@ namespace Handbrake.Functions
}
catch (Exception exc)
{
- MessageBox.Show(
- "An error has occured in the Query Parser.\n\n" +
- exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("An error has occured in the Query Parser.\n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endregion
@@ -446,8 +449,8 @@ namespace Handbrake.Functions
/// <summary>
/// Get the GUI equiv to a CLI mixdown
/// </summary>
- /// <param name="mixdown"></param>
- /// <returns></returns>
+ /// <param name="mixdown">The Audio Mixdown</param>
+ /// <returns>The GUI representation of the mixdown</returns>
private static string GetMixDown(string mixdown)
{
switch (mixdown.Trim())
@@ -470,8 +473,8 @@ namespace Handbrake.Functions
/// <summary>
/// Get the GUI equiv to a CLI audio encoder
/// </summary>
- /// <param name="audioEnc"></param>
- /// <returns></returns>
+ /// <param name="audioEnc">The Audio Encoder</param>
+ /// <returns>The GUI representation of that audio encoder</returns>
private static string GetAudioEncoder(string audioEnc)
{
switch (audioEnc)
diff --git a/win/C#/Functions/Scan.cs b/win/C#/Functions/Scan.cs
index 78d158564..8532b353c 100644
--- a/win/C#/Functions/Scan.cs
+++ b/win/C#/Functions/Scan.cs
@@ -53,6 +53,11 @@ namespace Handbrake.Functions
public event EventHandler ScanStatusChanged;
/// <summary>
+ /// Gets or sets a value indicating whether IsScanning.
+ /// </summary>
+ public bool IsScanning { get; set; }
+
+ /// <summary>
/// Scan a Source Path.
/// Title 0: scan all
/// </summary>
@@ -109,6 +114,7 @@ namespace Handbrake.Functions
{
try
{
+ IsScanning = true;
if (this.ScanStared != null)
this.ScanStared(this, new EventArgs());
@@ -152,6 +158,7 @@ namespace Handbrake.Functions
if (this.ScanCompleted != null)
this.ScanCompleted(this, new EventArgs());
+ IsScanning = false;
}
catch (Exception exc)
{