summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-09-20 15:11:23 +0000
committersr55 <[email protected]>2008-09-20 15:11:23 +0000
commitb9601981bb42dc82e5d49377fbc6c2de989973cb (patch)
tree02bda4b9c43d029c1e2071f4cc884fe81da11390 /win/C#/Functions
parentb3b3fc83847dc15ac9d0aaed2f41e8ffd8228ef2 (diff)
WinGui:
- User presets and built in presets are now show in seperate colours. User preset's are shown in black and built in are blue. - Added cancel button to add preset. - Removed File Menu > Import. This is not required. Users can import old .hb files as text into the query editor if need be. - Adding a new user preset no longer stores Title and file input/output information. While these were never used, it's a waste of space storing them in the user presets file. - Added a comfirm dialog for removing presets. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1735 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Common.cs79
-rw-r--r--win/C#/Functions/Presets.cs17
2 files changed, 53 insertions, 43 deletions
diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs
index 3fc0b35e0..b954a02b7 100644
--- a/win/C#/Functions/Common.cs
+++ b/win/C#/Functions/Common.cs
@@ -431,7 +431,7 @@ namespace Handbrake.Functions
query += " -o " + '"' + mainWindow.text_destination.Text + '"';
#endregion
- query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text);
+ query += generateTabbedComponentsQuery(mainWindow);
return query;
}
@@ -466,7 +466,7 @@ namespace Handbrake.Functions
#endregion
- query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text);
+ query += generateTabbedComponentsQuery(mainWindow);
return query;
}
@@ -476,34 +476,28 @@ namespace Handbrake.Functions
/// <param name="mainWindow"></param>
/// <param name="source"></param>
/// <returns></returns>
- private string generateTabbedComponentsQuery(frmMain mainWindow, string source)
+ public string generateTabbedComponentsQuery(frmMain mainWindow)
{
string query = "";
+ // The Output Settings box above the tabbed section.
+ #region Output Settings Box
query += " -f " + mainWindow.drop_format.Text.ToLower().Replace(" file", "");
+ // These are output settings features
+ if (mainWindow.check_largeFile.Checked)
+ query += " -4 ";
+
+ if (mainWindow.check_iPodAtom.Checked)
+ query += " -I ";
+
+ if (mainWindow.check_optimiseMP4.Checked)
+ query += " -O ";
+ #endregion
+
// Picture Settings Tab
#region Picture Settings Tab
- switch (mainWindow.drp_videoEncoder.Text)
- {
- case "MPEG-4 (FFmpeg)":
- query += " -e ffmpeg";
- break;
- case "MPEG-4 (XviD)":
- query += " -e xvid";
- break;
- case "H.264 (x264)":
- query += " -e x264";
- break;
- case "VP3 (Theora)":
- query += " -e theora";
- break;
- default:
- query += " -e x264";
- break;
- }
-
if (mainWindow.text_width.Text != "")
query += " -w " + mainWindow.text_width.Text;
@@ -560,9 +554,6 @@ namespace Handbrake.Functions
query += " --decomb ";
}
- if (mainWindow.check_grayscale.Checked)
- query += " -g ";
-
if (mainWindow.drp_anamorphic.SelectedIndex == 1)
query += " -p ";
else if (mainWindow.drp_anamorphic.SelectedIndex == 2)
@@ -580,15 +571,28 @@ namespace Handbrake.Functions
// Video Settings Tab
#region Video Settings Tab
- // These are output settings features
- if (mainWindow.check_largeFile.Checked)
- query += " -4 ";
- if (mainWindow.check_iPodAtom.Checked)
- query += " -I ";
+ switch (mainWindow.drp_videoEncoder.Text)
+ {
+ case "MPEG-4 (FFmpeg)":
+ query += " -e ffmpeg";
+ break;
+ case "MPEG-4 (XviD)":
+ query += " -e xvid";
+ break;
+ case "H.264 (x264)":
+ query += " -e x264";
+ break;
+ case "VP3 (Theora)":
+ query += " -e theora";
+ break;
+ default:
+ query += " -e x264";
+ break;
+ }
- if (mainWindow.check_optimiseMP4.Checked)
- query += " -O ";
+ if (mainWindow.check_grayscale.Checked)
+ query += " -g ";
// Video Settings
if (mainWindow.text_bitrate.Text != "")
@@ -608,17 +612,15 @@ namespace Handbrake.Functions
if (mainWindow.check_2PassEncode.Checked)
query += " -2 ";
+ if (mainWindow.check_turbo.Checked)
+ query += " -T ";
+
if (mainWindow.drp_videoFramerate.Text != "Same as source")
{
if (!mainWindow.check_vfr.Checked)
query += " -r " + mainWindow.drp_videoFramerate.Text;
}
- if (mainWindow.check_turbo.Checked)
- query += " -T ";
-
-
-
switch (mainWindow.drp_deNoise.Text)
{
case "None":
@@ -673,7 +675,6 @@ namespace Handbrake.Functions
string Mixdown4 = mainWindow.drp_audmix_4.Text;
string drc4 = mainWindow.trackBar4.Value.ToString();
-
//
// Audio Track Selections
//
@@ -859,7 +860,7 @@ 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 source_name = mainWindow.text_source.Text;
- string[] sourceName = source.Split('\\');
+ string[] sourceName = source_name.Split('\\');
source_name = sourceName[sourceName.Length - 1];
source_name = source_name.Replace("\"", "");
diff --git a/win/C#/Functions/Presets.cs b/win/C#/Functions/Presets.cs
index 9c23aef1d..353846b23 100644
--- a/win/C#/Functions/Presets.cs
+++ b/win/C#/Functions/Presets.cs
@@ -87,11 +87,10 @@ namespace Handbrake.Functions
}
/// <summary>
- /// Get an Arraylist of all the preset names.
- /// Includes both built in and user presets.
+ /// Get a List of all the built in preset names.
/// </summary>
- /// <returns>Arraylist of preset names</returns>
- public List<string> getPresetNames()
+ /// <returns>List<String> of preset names</returns>
+ public List<string> getBuildInPresetNames()
{
List<string> names = new List<string>();
@@ -104,6 +103,16 @@ namespace Handbrake.Functions
names.Add(presetName[0]);
}
+ return names;
+ }
+
+ /// <summary>
+ /// Get a List of all the User preset names.
+ /// </summary>
+ /// <returns>List<String> of preset names</returns>
+ public List<string> getUserPresetNames()
+ {
+ List<string> names = new List<string>();
// User Presets
foreach (string item in user_presets)