diff options
author | sr55 <[email protected]> | 2009-06-22 20:02:09 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-06-22 20:02:09 +0000 |
commit | 0c52900e6f5ed363b15313f6f0735b1fd51e18f8 (patch) | |
tree | f62c3b6ca6474bc8eace715c8c9903a62da7f5ee /win/C#/Functions | |
parent | df3b0eed16765ee555a4a18b80a51da0699cf5d6 (diff) |
WinGui:
- Combine all the Filters controls and widgets onto 1 panel. Replaces 12 files by 3.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2598 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/PresetLoader.cs | 80 | ||||
-rw-r--r-- | win/C#/Functions/QueryGenerator.cs | 67 |
2 files changed, 61 insertions, 86 deletions
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs index 4952e5d3d..bcc4b1b26 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -67,10 +67,10 @@ namespace Handbrake.Functions #endregion
#region Picture
- mainWindow.pictureSettings.check_autoCrop.Checked = true;
+ mainWindow.PictureSettings.check_autoCrop.Checked = true;
if (presetQuery.CropBottom == "0" && presetQuery.CropTop == "0")
if (presetQuery.CropLeft == "0" && presetQuery.CropRight == "0")
- mainWindow.pictureSettings.check_customCrop.Checked = true;
+ mainWindow.PictureSettings.check_customCrop.Checked = true;
if (pictureSettings) // only Load picture settings if the perset requires it
{
@@ -82,75 +82,60 @@ namespace Handbrake.Functions int.TryParse(presetQuery.CropLeft, out left);
int.TryParse(presetQuery.CropRight, out right);
- mainWindow.pictureSettings.check_customCrop.Checked = true;
- mainWindow.pictureSettings.crop_top.Value = top;
- mainWindow.pictureSettings.crop_bottom.Value = bottom;
- mainWindow.pictureSettings.crop_left.Value = left;
- mainWindow.pictureSettings.crop_right.Value = right;
+ mainWindow.PictureSettings.check_customCrop.Checked = true;
+ mainWindow.PictureSettings.crop_top.Value = top;
+ mainWindow.PictureSettings.crop_bottom.Value = bottom;
+ mainWindow.PictureSettings.crop_left.Value = left;
+ mainWindow.PictureSettings.crop_right.Value = right;
}
}
// Reset maxWidth and MaxHeight to 0
- mainWindow.pictureSettings.maxWidth = 0;
- mainWindow.pictureSettings.maxHeight = 0;
+ mainWindow.PictureSettings.maxWidth = 0;
+ mainWindow.PictureSettings.maxHeight = 0;
// Set the width and height
if (presetQuery.Width != 0)
- mainWindow.pictureSettings.text_width.Value = presetQuery.Width;
+ mainWindow.PictureSettings.text_width.Value = presetQuery.Width;
else if (presetQuery.MaxWidth == 0)
- mainWindow.pictureSettings.text_width.Value = 0;
+ mainWindow.PictureSettings.text_width.Value = 0;
- mainWindow.pictureSettings.text_height.Value = presetQuery.Height != 0 ? presetQuery.Height : 0;
+ mainWindow.PictureSettings.text_height.Value = presetQuery.Height != 0 ? presetQuery.Height : 0;
// Max Width/Height override Width/Height
if (presetQuery.MaxWidth != 0)
{
- mainWindow.pictureSettings.text_width.Value = presetQuery.MaxWidth;
- mainWindow.pictureSettings.maxWidth = presetQuery.MaxWidth;
+ mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth;
+ mainWindow.PictureSettings.maxWidth = presetQuery.MaxWidth;
}
if (presetQuery.MaxHeight != 0)
{
- mainWindow.pictureSettings.text_height.Value = presetQuery.MaxHeight;
- mainWindow.pictureSettings.maxHeight = presetQuery.MaxHeight;
+ mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight;
+ mainWindow.PictureSettings.maxHeight = presetQuery.MaxHeight;
}
- mainWindow.pictureSettings.setMax();
+ mainWindow.PictureSettings.setMax();
// Set the anamorphic mode 0,1,2,3
- mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;
+ mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;
// Custom Anamorphic Controls
- mainWindow.pictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked;
- mainWindow.pictureSettings.txt_displayWidth.Text = presetQuery.displayWidthValue.ToString();
- mainWindow.pictureSettings.txt_parWidth.Text = presetQuery.pixelAspectWidth.ToString();
- mainWindow.pictureSettings.txt_parHeight.Text = presetQuery.pixelAspectHeight.ToString();
- mainWindow.pictureSettings.drop_modulus.SelectedItem = presetQuery.AnamorphicModulus;
+ mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked;
+ mainWindow.PictureSettings.txt_displayWidth.Text = presetQuery.displayWidthValue.ToString();
+ mainWindow.PictureSettings.txt_parWidth.Text = presetQuery.pixelAspectWidth.ToString();
+ mainWindow.PictureSettings.txt_parHeight.Text = presetQuery.pixelAspectHeight.ToString();
+ mainWindow.PictureSettings.drop_modulus.SelectedItem = presetQuery.AnamorphicModulus;
#endregion
#region Filters
-
- mainWindow.ctl_decomb.setOption(presetQuery.Decomb);
-
- if (mainWindow.ctl_decomb.getDropValue == "Off")
- mainWindow.ctl_deinterlace.setOption(presetQuery.DeInterlace);
- else
- mainWindow.ctl_deinterlace.setOption("None"); // Don't want decomb and deinterlace on at the same time
-
- mainWindow.ctl_denoise.setOption(presetQuery.DeNoise);
- mainWindow.ctl_detelecine.setOption(presetQuery.DeTelecine);
-
- if (presetQuery.DeBlock != 0)
- {
- mainWindow.slider_deblock.Value = presetQuery.DeBlock;
- mainWindow.lbl_deblockVal.Text = presetQuery.DeBlock.ToString();
- }
- else
- {
- mainWindow.slider_deblock.Value = 4;
- mainWindow.lbl_deblockVal.Text = "Off";
- }
+ mainWindow.Filters.setDecomb(presetQuery.Decomb);
+ mainWindow.Filters.setDeInterlace(presetQuery.DeInterlace);
+ mainWindow.Filters.setDeNoise(presetQuery.DeNoise);
+ mainWindow.Filters.setDeTelecine(presetQuery.DeTelecine);
+ mainWindow.Filters.setDeBlock(presetQuery.DeBlock);
+ mainWindow.Filters.setGrayScale(presetQuery.Grayscale);
#endregion
#region Video
@@ -210,7 +195,6 @@ namespace Handbrake.Functions mainWindow.check_2PassEncode.CheckState = presetQuery.TwoPass ? CheckState.Checked : CheckState.Unchecked;
- mainWindow.check_grayscale.CheckState = presetQuery.Grayscale ? CheckState.Checked : CheckState.Unchecked;
mainWindow.drp_videoFramerate.Text = presetQuery.VideoFramerate;
@@ -232,12 +216,12 @@ namespace Handbrake.Functions #region Audio
// Clear the audio listing
- mainWindow.audioPanel.clearAudioList();
+ mainWindow.AudioSettings.clearAudioList();
if (presetQuery.AudioInformation != null)
foreach (AudioTrack track in presetQuery.AudioInformation)
{
- ListViewItem newTrack = new ListViewItem(mainWindow.audioPanel.getNewID().ToString());
+ ListViewItem newTrack = new ListViewItem(mainWindow.AudioSettings.getNewID().ToString());
newTrack.SubItems.Add("Automatic");
newTrack.SubItems.Add(track.Encoder);
@@ -248,7 +232,7 @@ namespace Handbrake.Functions else
newTrack.SubItems.Add(track.Bitrate);
newTrack.SubItems.Add(track.DRC);
- mainWindow.audioPanel.addTrackForPreset(newTrack);
+ mainWindow.AudioSettings.addTrackForPreset(newTrack);
}
#endregion
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs index b81842438..604688612 100644 --- a/win/C#/Functions/QueryGenerator.cs +++ b/win/C#/Functions/QueryGenerator.cs @@ -117,53 +117,53 @@ namespace Handbrake.Functions #region Picture Settings Tab
// Use MaxWidth for built-in presets and width for user settings.
- if (mainWindow.pictureSettings.maxWidth == 0)
+ if (mainWindow.PictureSettings.maxWidth == 0)
{
- if (mainWindow.pictureSettings.text_width.Text != "")
- if (mainWindow.pictureSettings.drp_anamorphic.SelectedIndex != 1) // Prevent usage for strict anamorphic
- query += " -w " + mainWindow.pictureSettings.text_width.Text;
+ if (mainWindow.PictureSettings.text_width.Text != "")
+ 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.Text != "")
- query += " -X " + mainWindow.pictureSettings.text_width.Text;
+ if (mainWindow.PictureSettings.text_width.Text != "")
+ query += " -X " + mainWindow.PictureSettings.text_width.Text;
}
// Use MaxHeight for built-in presets and height for user settings.
- if (mainWindow.pictureSettings.maxHeight == 0)
+ if (mainWindow.PictureSettings.maxHeight == 0)
{
- if (mainWindow.pictureSettings.text_height.Text != "0")
- if (mainWindow.pictureSettings.text_height.Text != "")
- 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;
+ if (mainWindow.PictureSettings.text_height.Text != "0")
+ if (mainWindow.PictureSettings.text_height.Text != "")
+ 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.Text != "")
- query += " -Y " + mainWindow.pictureSettings.text_height.Text;
+ if (mainWindow.PictureSettings.text_height.Text != "")
+ query += " -Y " + mainWindow.PictureSettings.text_height.Text;
}
- string cropTop = mainWindow.pictureSettings.crop_top.Text;
- string cropBottom = mainWindow.pictureSettings.crop_bottom.Text;
- string cropLeft = mainWindow.pictureSettings.crop_left.Text;
- string cropRight = mainWindow.pictureSettings.crop_right.Text;
+ string cropTop = mainWindow.PictureSettings.crop_top.Text;
+ string cropBottom = mainWindow.PictureSettings.crop_bottom.Text;
+ string cropLeft = mainWindow.PictureSettings.crop_left.Text;
+ string cropRight = mainWindow.PictureSettings.crop_right.Text;
- if (mainWindow.pictureSettings.check_customCrop.Checked)
+ if (mainWindow.PictureSettings.check_customCrop.Checked)
{
- if (mainWindow.pictureSettings.crop_top.Text == string.Empty)
+ if (mainWindow.PictureSettings.crop_top.Text == string.Empty)
cropTop = "0";
- if (mainWindow.pictureSettings.crop_bottom.Text == string.Empty)
+ if (mainWindow.PictureSettings.crop_bottom.Text == string.Empty)
cropBottom = "0";
- if (mainWindow.pictureSettings.crop_left.Text == string.Empty)
+ if (mainWindow.PictureSettings.crop_left.Text == string.Empty)
cropLeft = "0";
- if (mainWindow.pictureSettings.crop_right.Text == string.Empty)
+ if (mainWindow.PictureSettings.crop_right.Text == string.Empty)
cropRight = "0";
query += " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;
}
- switch (mainWindow.pictureSettings.drp_anamorphic.SelectedIndex)
+ switch (mainWindow.PictureSettings.drp_anamorphic.SelectedIndex)
{
case 1:
query += " --strict-anamorphic ";
@@ -173,23 +173,17 @@ namespace Handbrake.Functions break;
case 3:
query += " --custom-anamorphic ";
- query += " --display-width " + mainWindow.pictureSettings.txt_displayWidth.Text + " ";
- if (mainWindow.pictureSettings.check_KeepAR.Checked)
+ query += " --display-width " + mainWindow.PictureSettings.txt_displayWidth.Text + " ";
+ if (mainWindow.PictureSettings.check_KeepAR.Checked)
query += " --keep-display-aspect ";
- if (mainWindow.pictureSettings.txt_parWidth.Text != "" && mainWindow.pictureSettings.txt_parHeight.Text != "")
- query += " --pixel-aspect " + mainWindow.pictureSettings.txt_parWidth.Text + ":" + mainWindow.pictureSettings.txt_parHeight.Text + " ";
+ if (mainWindow.PictureSettings.txt_parWidth.Text != "" && mainWindow.PictureSettings.txt_parHeight.Text != "")
+ query += " --pixel-aspect " + mainWindow.PictureSettings.txt_parWidth.Text + ":" + mainWindow.PictureSettings.txt_parHeight.Text + " ";
break;
}
#endregion
#region Filters
- query += mainWindow.ctl_detelecine.getCLIQuery;
- query += mainWindow.ctl_decomb.getCLIQuery;
- query += mainWindow.ctl_deinterlace.getCLIQuery;
- query += mainWindow.ctl_denoise.getCLIQuery;
-
- if (mainWindow.slider_deblock.Value != 4)
- query += " --deblock=" + mainWindow.slider_deblock.Value;
+ query += mainWindow.Filters.getCLIQuery;
#endregion
#region Video Settings Tab
@@ -210,9 +204,6 @@ namespace Handbrake.Functions break;
}
- if (mainWindow.check_grayscale.Checked)
- query += " -g ";
-
// Video Settings
if (mainWindow.radio_avgBitrate.Checked)
query += " -b " + mainWindow.text_bitrate.Text;
@@ -260,7 +251,7 @@ namespace Handbrake.Functions #region Audio Settings Tab
- ListView audioTracks = mainWindow.audioPanel.getAudioPanel();
+ ListView audioTracks = mainWindow.AudioSettings.getAudioPanel();
List<string> tracks = new List<string>();
List<string> codecs = new List<string>();
List<string> mixdowns = new List<string>();
|