summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-09-11 21:34:05 +0000
committersr55 <[email protected]>2008-09-11 21:34:05 +0000
commite8eecb6a769f4ab46b6820ff642c9b817c1c5e11 (patch)
tree06c306e577560d6548cee9e8bc66b55d04656c6d /win/C#/Functions
parent3542367d63f7fb4d443645e5a61ff60ae709382b (diff)
WinGui:
- Slider control for deblock. - Fix: Load normal preset if userdefault setting string is empty. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1690 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Common.cs18
-rw-r--r--win/C#/Functions/Presets.cs2
-rw-r--r--win/C#/Functions/QueryParser.cs16
3 files changed, 24 insertions, 12 deletions
diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs
index 96c56a856..7b3e36fc9 100644
--- a/win/C#/Functions/Common.cs
+++ b/win/C#/Functions/Common.cs
@@ -135,11 +135,17 @@ namespace Handbrake.Functions
else
mainWindow.check_detelecine.CheckState = CheckState.Unchecked;
-
- if (presetQuery.DeBlock == true)
- mainWindow.check_deblock.CheckState = CheckState.Checked;
+ if (presetQuery.DeBlock != 0)
+ {
+ mainWindow.slider_deblock.Value = presetQuery.DeBlock;
+ mainWindow.lbl_deblockVal.Text = presetQuery.DeBlock.ToString();
+ }
else
- mainWindow.check_deblock.CheckState = CheckState.Unchecked;
+ {
+ mainWindow.slider_deblock.Value = 0;
+ mainWindow.lbl_deblockVal.Text = "0";
+ }
+
if (presetQuery.Anamorphic == true)
@@ -573,8 +579,8 @@ namespace Handbrake.Functions
else if (mainWindow.drp_anamorphic.SelectedIndex == 2)
query += " -P ";
- if (mainWindow.check_deblock.Checked)
- query += " --deblock";
+ if (mainWindow.slider_deblock.Value != 0)
+ query += " --deblock=" + mainWindow.slider_deblock.Value;
if (mainWindow.check_detelecine.Checked)
query += " --detelecine";
diff --git a/win/C#/Functions/Presets.cs b/win/C#/Functions/Presets.cs
index 0e176b12a..9c23aef1d 100644
--- a/win/C#/Functions/Presets.cs
+++ b/win/C#/Functions/Presets.cs
@@ -207,13 +207,11 @@ namespace Handbrake.Functions
// close the stream
line.Close();
line.Dispose();
- MessageBox.Show("Your profile has been sucessfully added.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
catch (Exception exc)
{
MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.\n Error Information: \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
-
}
// Check if a preset already exists in either the built in or user presets
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index 80fe989f8..347e3f988 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -231,11 +231,11 @@ namespace Handbrake.Functions
}
}
- private Boolean q_deBlock;
+ private int q_deBlock;
/// <summary>
/// Returns a boolean to indicate wither DeBlock is on or off.
/// </summary>
- public Boolean DeBlock
+ public int DeBlock
{
get
{
@@ -814,7 +814,7 @@ namespace Handbrake.Functions
Match height = Regex.Match(input, @"-l ([0-9]*)");
Match deinterlace = Regex.Match(input, @"--deinterlace=\""([a-zA-Z]*)\""");
Match denoise = Regex.Match(input, @"--denoise=\""([a-zA-Z]*)\""");
- Match deblock = Regex.Match(input, @"--deblock");
+ Match deblock = Regex.Match(input, @"--deblock=([0-9]*)");
Match detelecine = Regex.Match(input, @"--detelecine");
Match anamorphic = Regex.Match(input, @" -p ");
Match chapterMarkers = Regex.Match(input, @" -m");
@@ -953,8 +953,16 @@ namespace Handbrake.Functions
thisQuery.q_cropRight = actCropValues[3];
}
+ // Deblock Slider
+ string deblockValue = "";
+ thisQuery.q_deBlock = 0;
+ if (deblock.Success != false)
+ deblockValue = deblock.ToString().Replace("--deblock=", "");
+
+ if (deblockValue != "")
+ int.TryParse(deblockValue, out thisQuery.q_deBlock);
+
thisQuery.q_detelecine = detelecine.Success;
- thisQuery.q_deBlock = deblock.Success;
thisQuery.q_decomb = decomb.Success;
thisQuery.q_deinterlace = "None";