summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-04-04 16:09:04 +0000
committersr55 <[email protected]>2008-04-04 16:09:04 +0000
commit8747cd2227c1d7e295e7c6596b6ba32a35be595b (patch)
tree8a1a003d3bf7882bafda9315cc6dee3158c3ca6a /win/C#/Functions
parent65fd8a79dbc5756d41349c22f82c659c892b75bc (diff)
- New Audio Panel (Query Parser, Query Generator, Preset Loader Functions all updated)
This includes minor changes to the UI (e.g in the 'Output Settings' box) - UI Improvments for Windows Vista and XP where non Classic theme is used. - Activity Window can now view the log whilst an encode is going. (Doesn't live update... yet TODO!) - Changed Radio File/Folder option for Source Browse to a single checkbox. Folder view by default. Check "File mode" for file selection dialog. - Misc other UI changes - Update checker won't display an error message during statup if one occurs whilst checking the update. The message was hidden behind the splash screen. This is now not a problem. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1375 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/CLI.cs2
-rw-r--r--win/C#/Functions/Common.cs292
-rw-r--r--win/C#/Functions/QueryParser.cs345
-rw-r--r--win/C#/Functions/RssReader.cs2
-rw-r--r--win/C#/Functions/x264Panel.cs5
5 files changed, 462 insertions, 184 deletions
diff --git a/win/C#/Functions/CLI.cs b/win/C#/Functions/CLI.cs
index 2a956ac39..c511953f0 100644
--- a/win/C#/Functions/CLI.cs
+++ b/win/C#/Functions/CLI.cs
@@ -1,7 +1,7 @@
/* CLI.cs $
This file is part of the HandBrake source code.
- Homepage: <http://handbrake.m0k.org/>.
+ Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
using System;
diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs
index 0541fbb99..c911b836e 100644
--- a/win/C#/Functions/Common.cs
+++ b/win/C#/Functions/Common.cs
@@ -1,7 +1,7 @@
/* Common.cs $
This file is part of the HandBrake source code.
- Homepage: <http://handbrake.m0k.org/>.
+ Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
using System;
@@ -43,11 +43,11 @@ namespace Handbrake.Functions
catch (Exception exc)
{
if (debug == true)
- MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc.ToString(),"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
-
+
/*
* Function which generates the filename and path automatically based on the Source Name, DVD title and DVD Chapters
*/
@@ -86,7 +86,7 @@ namespace Handbrake.Functions
{
if (Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")
filePath = Properties.Settings.Default.autoNamePath + "\\";
- }
+ }
mainWindow.text_destination.Text = filePath + source + "_T" + title + "_C" + cs + dash + cf + ".mp4";
}
else
@@ -163,12 +163,6 @@ namespace Handbrake.Functions
mainWindow.text_destination.Text = presetQuery.Destination;
mainWindow.drp_videoEncoder.Text = presetQuery.VideoEncoder;
- mainWindow.drp_audioCodec.Text = presetQuery.AudioEncoder;
-
- if (presetQuery.AudioEncoder == "AAC + AC3")
- {
- mainWindow.text_destination.Text = mainWindow.text_destination.Text.Replace(".mp4", ".m4v");
- }
if (presetQuery.IpodAtom == true)
mainWindow.check_iPodAtom.CheckState = CheckState.Checked;
@@ -180,7 +174,7 @@ namespace Handbrake.Functions
else
mainWindow.check_optimiseMP4.CheckState = CheckState.Unchecked;
- #endregion
+ #endregion
// Picture Settings Tab
#region Picture
@@ -275,7 +269,7 @@ namespace Handbrake.Functions
mainWindow.check_largeFile.BackColor = Color.Transparent;
}
-
+
#endregion
@@ -294,11 +288,52 @@ namespace Handbrake.Functions
// Audio Settings Tab
#region Audio
- mainWindow.drp_audioBitrate.Text = presetQuery.AudioBitrate;
- mainWindow.drp_audioSampleRate.Text = presetQuery.AudioSampleBitrate;
- mainWindow.drp_track1Audio.Text = presetQuery.AudioTrack1;
- mainWindow.drp_track2Audio.Text = presetQuery.AudioTrack2;
- mainWindow.drp_audioMixDown.Text = presetQuery.AudioTrackMix;
+
+ if (presetQuery.AudioTrack1 == "")
+ mainWindow.drp_track1Audio.Text = "Automatic";
+ else
+ mainWindow.drp_track1Audio.Text = presetQuery.AudioTrack1;
+
+ if (presetQuery.AudioTrack2 == "None")
+ {
+ if (presetQuery.AudioEncoder2 != null)
+ {
+ mainWindow.drp_track2Audio.SelectedIndex = 1;
+ mainWindow.drp_audsr_2.Enabled = true;
+ mainWindow.drp_audmix_2.Enabled = true;
+ mainWindow.drp_audenc_2.Enabled = true;
+ mainWindow.drp_audbit_2.Enabled = true;
+ }
+ else
+ {
+ mainWindow.drp_track2Audio.SelectedIndex = 0;
+ mainWindow.drp_audsr_2.Enabled = false;
+ mainWindow.drp_audmix_2.Enabled = false;
+ mainWindow.drp_audenc_2.Enabled = false;
+ mainWindow.drp_audbit_2.Enabled = false;
+ }
+
+ }
+ else
+ mainWindow.drp_track2Audio.Text = presetQuery.AudioTrack2;
+
+ if (presetQuery.AudioEncoder1 != null)
+ mainWindow.drp_audenc_1.Text = presetQuery.AudioEncoder1;
+ mainWindow.drp_audenc_2.Text = presetQuery.AudioEncoder2;
+
+ if (presetQuery.AudioBitrate1 != null)
+ mainWindow.drp_audbit_1.Text = presetQuery.AudioBitrate1;
+ mainWindow.drp_audbit_2.Text = presetQuery.AudioBitrate2;
+
+ if (presetQuery.AudioSamplerate1 != null)
+ mainWindow.drp_audsr_1.Text = presetQuery.AudioSamplerate1;
+ mainWindow.drp_audsr_2.Text = presetQuery.AudioSamplerate2;
+
+ mainWindow.drp_audmix_1.Text = presetQuery.AudioTrackMix1;
+ mainWindow.drp_audmix_2.Text = presetQuery.AudioTrackMix2;
+
+
+
mainWindow.drp_subtitle.Text = presetQuery.Subtitles;
if (presetQuery.ForcedSubtitles == true)
@@ -373,7 +408,6 @@ namespace Handbrake.Functions
string destination = mainWindow.text_destination.Text;
string videoEncoder = mainWindow.drp_videoEncoder.Text;
- string audioEncoder = mainWindow.drp_audioCodec.Text;
string width = mainWindow.text_width.Text;
string height = mainWindow.text_height.Text;
@@ -400,28 +434,6 @@ namespace Handbrake.Functions
break;
}
- switch (audioEncoder)
- {
- case "AAC":
- audioEncoder = " -E faac";
- break;
- case "MP3":
- audioEncoder = " -E lame";
- break;
- case "Vorbis":
- audioEncoder = " -E vorbis";
- break;
- case "AC3":
- audioEncoder = " -E ac3";
- break;
- case "AAC + AC3":
- audioEncoder = " -E aac+ac3";
- break;
- default:
- audioEncoder = " -E faac";
- break;
- }
-
if (width != "")
width = " -w " + width;
@@ -436,7 +448,7 @@ namespace Handbrake.Functions
}
- string queryDestination = destination + videoEncoder + audioEncoder + width + height;
+ string queryDestination = destination + videoEncoder + width + height;
#endregion
// Picture Settings Tab
@@ -508,7 +520,7 @@ namespace Handbrake.Functions
pixelRatio = " -P ";
else
pixelRatio = " ";
-
+
if (mainWindow.check_deblock.Checked)
deblock = " --deblock";
@@ -519,7 +531,7 @@ namespace Handbrake.Functions
if (mainWindow.check_vfr.Checked)
vfr = " -V ";
-
+
string queryPictureSettings = cropOut + deinterlace + deblock + detelecine + vfr + grayscale + pixelRatio + lanamorphic;
#endregion
@@ -610,25 +622,31 @@ namespace Handbrake.Functions
// Audio Settings Tab
#region Audio Settings Tab
- string audioBitrate = mainWindow.drp_audioBitrate.Text;
- string audioSampleRate = mainWindow.drp_audioSampleRate.Text;
- string track1 = mainWindow.drp_track1Audio.Text;
- string track2 = mainWindow.drp_track2Audio.Text;
+ // Used Varibles
+ string audioBitrate = "";
string audioChannels = "";
- string Mixdown = mainWindow.drp_audioMixDown.Text;
string SixChannelAudio = "";
- string subtitles = mainWindow.drp_subtitle.Text;
string subScan = "";
string forced = "";
string drc = "";
+ string audioSampleRate = "";
+ string audioEncoder = "";
- if (audioBitrate != "")
- audioBitrate = " -B " + audioBitrate;
+ // Track 1
+ string track1 = mainWindow.drp_track1Audio.Text;
+ string vencoder1 = mainWindow.drp_audenc_1.Text;
+ string audioBitrate1 = mainWindow.drp_audbit_1.Text;
+ string audioSampleRate1 = mainWindow.drp_audsr_1.Text;
+ string Mixdown1 = mainWindow.drp_audmix_1.Text;
- if (audioSampleRate != "")
- audioSampleRate = " -R " + audioSampleRate;
+ // Track 2
+ string track2 = mainWindow.drp_track2Audio.Text;
+ string vencoder2 = mainWindow.drp_audenc_2.Text;
+ string audioBitrate2 = mainWindow.drp_audbit_2.Text;
+ string audioSampleRate2 = mainWindow.drp_audsr_2.Text;
+ string Mixdown2 = mainWindow.drp_audmix_2.Text;
- // Audio Track 1
+ // Audio Track Selections
if (track1 == "Automatic")
audioChannels = "";
else if (track1 == "")
@@ -642,7 +660,6 @@ namespace Handbrake.Functions
audioChannels = " -a " + tempSub[0];
}
- // Audio Track 2
if (audioChannels != "")
{
if ((track2 != "") && (track2 != "None"))
@@ -662,38 +679,169 @@ namespace Handbrake.Functions
}
}
+ // Audio Mixdown Selections
+ switch (Mixdown1)
+ {
+ case "Automatic":
+ Mixdown1 = "";
+ break;
+ case "Mono":
+ Mixdown1 = "mono";
+ break;
+ case "Stereo":
+ Mixdown1 = "stereo";
+ break;
+ case "Dolby Surround":
+ Mixdown1 = "dpl1";
+ break;
+ case "Dolby Pro Logic II":
+ Mixdown1 = "dpl2";
+ break;
+ case "6 Channel Discrete":
+ Mixdown1 = "6ch";
+ break;
+ default:
+ Mixdown1 = "";
+ break;
+ }
+ if (Mixdown1 != "")
+ SixChannelAudio = " -6 " + Mixdown1;
+ else
+ {
+ if (mainWindow.drp_track2Audio.Text == "None")
+ SixChannelAudio = "";
+ else
+ {
+ if (mainWindow.drp_audmix_2.Text == "Automatic")
+ SixChannelAudio = "";
+ else
+ SixChannelAudio = " -6 dpl2";
+ }
+ }
- switch (Mixdown)
+ switch (Mixdown2)
{
case "Automatic":
- Mixdown = "";
+ Mixdown2 = "";
break;
case "Mono":
- Mixdown = "mono";
+ Mixdown2 = "mono";
break;
case "Stereo":
- Mixdown = "stereo";
+ Mixdown2 = "stereo";
break;
case "Dolby Surround":
- Mixdown = "dpl1";
+ Mixdown2 = "dpl1";
break;
case "Dolby Pro Logic II":
- Mixdown = "dpl2";
+ Mixdown2 = "dpl2";
break;
case "6 Channel Discrete":
- Mixdown = "6ch";
+ Mixdown2 = "6ch";
break;
default:
- Mixdown = "";
+ Mixdown2 = "";
break;
}
- if (Mixdown != "")
- SixChannelAudio = " -6 " + Mixdown;
- else
- SixChannelAudio = "";
+ if (Mixdown2 != "")
+ {
+ if (SixChannelAudio != "")
+ SixChannelAudio = SixChannelAudio + "," + Mixdown2;
+ else
+ SixChannelAudio = " -6 " + Mixdown2;
+ }
+ // Audio Encoder Selections
+ switch (mainWindow.drp_audenc_1.Text)
+ {
+ case "AAC":
+ audioEncoder = " -E faac";
+ break;
+ case "MP3":
+ audioEncoder = " -E lame";
+ break;
+ case "Vorbis":
+ audioEncoder = " -E vorbis";
+ break;
+ case "AC3":
+ audioEncoder = " -E ac3";
+ break;
+ case "AAC + AC3":
+ audioEncoder = " -E aac+ac3";
+ break;
+ default:
+ break;
+ }
+
+ switch (mainWindow.drp_audenc_2.Text)
+ {
+ case "AAC":
+ if (audioEncoder == "")
+ audioEncoder = " -E faac";
+ else
+ audioEncoder = audioEncoder + ",faac";
+ break;
+ case "MP3":
+ if (audioEncoder == "")
+ audioEncoder = " -E lame";
+ else
+ audioEncoder = audioEncoder + ",lame";
+ break;
+ case "Vorbis":
+ if (audioEncoder == "")
+ audioEncoder = " -E vorbis";
+ else
+ audioEncoder = audioEncoder + ",vorbis";
+ break;
+ case "AC3":
+ if (audioEncoder == "")
+ audioEncoder = " -E ac3";
+ else
+ audioEncoder = audioEncoder + ",ac3";
+ break;
+ case "AAC + AC3":
+ if (audioEncoder == "")
+ audioEncoder = " -E aac+ac3";
+ else
+ audioEncoder = audioEncoder + ",aac+ac3";
+ break;
+ default:
+ break;
+ }
+
+ // Audio BitRate Selections
+ if (audioBitrate1 != "")
+ audioBitrate = " -B " + audioBitrate1;
+
+ if (audioBitrate2 != "")
+ {
+ if (audioBitrate == "")
+ audioBitrate = " -B " + audioBitrate2;
+ else
+ audioBitrate = audioBitrate + "," + audioBitrate2;
+ }
+
+ // Audio SampleRate Selections
+ if (audioSampleRate1 != "")
+ audioSampleRate = " -R " + audioSampleRate1;
+
+ if (audioSampleRate2 != "")
+ {
+ if (audioSampleRate == "")
+ audioSampleRate = " -R " + audioSampleRate2;
+ else
+ audioSampleRate = audioSampleRate + "," + audioSampleRate2;
+ }
+
+ //Dynamic Range Compression (expects a float but a double is used for ease)
+ double value = mainWindow.slider_drc.Value / 10.0;
+ value++;
+ drc = " -D " + value;
+
+ // Subtitles
+ string subtitles = mainWindow.drp_subtitle.Text;
if (subtitles == "None")
subtitles = "";
else if (subtitles == "")
@@ -713,12 +861,8 @@ namespace Handbrake.Functions
if (mainWindow.check_forced.Checked)
forced = " -F ";
- //Dynamic Range Compression (expects a float but a double is used for ease)
- double value = mainWindow.slider_drc.Value / 10.0;
- value++;
- drc = " -D " + value;
- string queryAudioSettings = audioBitrate + audioSampleRate + drc + audioChannels + SixChannelAudio + subScan + subtitles + forced;
+ string queryAudioSettings = audioChannels + SixChannelAudio + audioEncoder + audioBitrate + audioSampleRate + drc + subScan + subtitles + forced;
#endregion
// Chapter Markers Tab
@@ -773,7 +917,7 @@ namespace Handbrake.Functions
{
string path = Path.Combine(Path.GetTempPath(), "chapters.csv");
ChapterMarkers = " --markers=" + "\"" + path + "\"";
- }
+ }
}
string chapter_markers = ChapterMarkers;
@@ -856,7 +1000,7 @@ namespace Handbrake.Functions
private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)
{
try
- {
+ {
StringBuilder csv = new StringBuilder();
foreach (DataGridViewRow row in mainWindow.data_chpt.Rows)
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index d83c1dc1d..6a39e0205 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -1,7 +1,7 @@
/* QueryParser.cs $
This file is part of the HandBrake source code.
- Homepage: <http://handbrake.m0k.org/>.
+ Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
using System;
@@ -111,20 +111,7 @@ namespace Handbrake.Functions
return this.q_videoEncoder;
}
}
-
- private string q_audioEncoder;
- /// <summary>
- /// Returns an String
- /// The Audio Encoder used.
- /// </summary>
- public string AudioEncoder
- {
- get
- {
- return this.q_audioEncoder;
- }
- }
-#endregion
+ #endregion
#region Picture Settings
private int q_videoWidth;
@@ -439,63 +426,125 @@ namespace Handbrake.Functions
#endregion
#region Audio Settings
- private string q_audioBitrate;
+ private string q_audioTrack1;
/// <summary>
- /// Returns a string with the audio bitrate
+ /// Returns a string with the First selected Audio track
/// </summary>
- public string AudioBitrate
+ public string AudioTrack1
{
get
{
- return this.q_audioBitrate;
+ return this.q_audioTrack1;
}
}
- private string q_audioSamplerate;
+ private string q_audioTrack2;
/// <summary>
- /// Returns a string with the audio sample rate
+ /// Returns a string with the First selected Audio track
/// </summary>
- public string AudioSampleBitrate
+ public string AudioTrack2
{
get
{
- return this.q_audioSamplerate;
+ return this.q_audioTrack2;
}
}
- private string q_audioTrack1;
+ private string q_audioTrackMix1;
/// <summary>
- /// Returns a string with the First selected Audio track
+ /// Returns a string with the First selected Audio track Mix
/// </summary>
- public string AudioTrack1
+ public string AudioTrackMix1
{
get
{
- return this.q_audioTrack1;
+ return this.q_audioTrackMix1;
}
}
- private string q_audioTrack2;
+ private string q_audioTrackMix2;
/// <summary>
- /// Returns a string with the First selected Audio track
+ /// Returns a string with the First selected Audio track Mix
/// </summary>
- public string AudioTrack2
+ public string AudioTrackMix2
{
get
{
- return this.q_audioTrack2;
+ return this.q_audioTrackMix2;
}
}
- private string q_audioTrackMix;
+ private string q_audioEncoder1;
/// <summary>
- /// Returns a string with the First selected Audio track Mix
+ /// Returns an String
+ /// The Audio Encoder used.
/// </summary>
- public string AudioTrackMix
+ public string AudioEncoder1
{
get
{
- return this.q_audioTrackMix;
+ return this.q_audioEncoder1;
+ }
+ }
+
+ private string q_audioEncoder2;
+ /// <summary>
+ /// Returns an String
+ /// The Audio Encoder used.
+ /// </summary>
+ public string AudioEncoder2
+ {
+ get
+ {
+ return this.q_audioEncoder2;
+ }
+ }
+
+ private string q_audioBitrate1;
+ /// <summary>
+ /// Returns a string with the audio bitrate
+ /// </summary>
+ public string AudioBitrate1
+ {
+ get
+ {
+ return this.q_audioBitrate1;
+ }
+ }
+
+ private string q_audioBitrate2;
+ /// <summary>
+ /// Returns a string with the audio bitrate
+ /// </summary>
+ public string AudioBitrate2
+ {
+ get
+ {
+ return this.q_audioBitrate2;
+ }
+ }
+
+ private string q_audioSamplerate1;
+ /// <summary>
+ /// Returns a string with the audio sample rate
+ /// </summary>
+ public string AudioSamplerate1
+ {
+ get
+ {
+ return this.q_audioSamplerate1;
+ }
+ }
+
+ private string q_audioSamplerate2;
+ /// <summary>
+ /// Returns a string with the audio sample rate
+ /// </summary>
+ public string AudioSamplerate2
+ {
+ get
+ {
+ return this.q_audioSamplerate2;
}
}
@@ -511,7 +560,6 @@ namespace Handbrake.Functions
}
}
-
private string q_subtitles;
/// <summary>
/// Returns a string with the selected subtitle track
@@ -570,7 +618,7 @@ namespace Handbrake.Functions
{
QueryParser thisQuery = new QueryParser();
- #region reg exp
+ #region Regular Expressions
//Source
Regex r1 = new Regex(@"(-i)(?:\s\"")([a-zA-Z0-9:\\\s\.]+)(?:\"")");
Match source = r1.Match(input.Replace('"', '\"'));
@@ -581,12 +629,11 @@ namespace Handbrake.Functions
//Destination
Regex r2 = new Regex(@"(-o)(?:\s\"")([a-zA-Z0-9_\-:\\\s\.]+)(?:\"")");
Match destination = r2.Match(input.Replace('"', '\"'));
- Match width = Regex.Match(input, @"-w ([0-9]*)");
- Match height = Regex.Match(input, @"-l ([0-9]*)");
Match videoEncoder = Regex.Match(input, @"-e ([a-zA-Z0-9]*)");
- Match audioEncoder = Regex.Match(input, @"-E ([a-zA-Z0-9+]*)");
//Picture Settings Tab
+ Match width = Regex.Match(input, @"-w ([0-9]*)");
+ Match height = Regex.Match(input, @"-l ([0-9]*)");
Match deinterlace = Regex.Match(input, @"--deinterlace=([a-z]*)");
Match denoise = Regex.Match(input, @"--denoise=([a-z]*)");
Match deblock = Regex.Match(input, @"--deblock");
@@ -610,15 +657,21 @@ namespace Handbrake.Functions
Match optimizeMP4 = Regex.Match(input, @"-O");
//Audio Settings Tab
- Match subtitles = Regex.Match(input, @"-s ([0-9a-zA-Z]*)");
- Match subScan = Regex.Match(input, @"-U");
- Match audioBitrate = Regex.Match(input, @"-B ([0-9]*)");
- Match audioSampleRate = Regex.Match(input, @"-R ([0-9.]*)");
- Match audioChannelsMix = Regex.Match(input, @"-6 ([0-9a-z0-9]*)"); // 1 -6 dpl2 // Broken
Match audioTrack1 = Regex.Match(input, @"-a ([0-9]*)");
Match audioTrack2 = Regex.Match(input, @"-a ([0-9]*),([0-9]*)");
- Match forcedSubtitles = Regex.Match(input, @"-F");
+ Match audioTrack1Mix = Regex.Match(input, @"-6 ([0-9a-z0-9]*)");
+ Match audioTrack2Mix = Regex.Match(input, @"-6 ([0-9a-z0-9]*),([0-9a-z0-9]*)");
+ Match audioEncoder1 = Regex.Match(input, @"-E ([a-zA-Z0-9+]*)");
+ Match audioEncoder2 = Regex.Match(input, @"-E ([a-zA-Z0-9+]*),([a-zA-Z0-9+]*)");
+ Match audioBitrate1 = Regex.Match(input, @"-B ([0-9]*)");
+ Match audioBitrate2 = Regex.Match(input, @"-B ([0-9]*),([0-9]*)");
+ Match audioSampleRate1 = Regex.Match(input, @"-R ([0-9.]*)");
+ Match audioSampleRate2 = Regex.Match(input, @"-R ([0-9.]*),([0-9.]*)");
+
Match drc = Regex.Match(input, @"-D ([0-9.]*)");
+ Match subtitles = Regex.Match(input, @"-s ([0-9a-zA-Z]*)");
+ Match subScan = Regex.Match(input, @"-U");
+ Match forcedSubtitles = Regex.Match(input, @"-F");
//H264 Tab
Match x264 = Regex.Match(input, @"-x ([,a-zA-Z0-9=:-]*)");
@@ -627,11 +680,12 @@ namespace Handbrake.Functions
Match verbose = Regex.Match(input, @"-v");
#endregion
+ #region Set Varibles
try
{
- //
- // Source
- //
+ /*
+ * Source
+ */
#region Source Tab
thisQuery.q_source = source.ToString().Replace("-i ", "").Replace("\"", "");
@@ -657,9 +711,9 @@ namespace Handbrake.Functions
#endregion
- //
- // Destination
- //
+ /*
+ * Destination
+ */
#region Destination
thisQuery.q_destination = destination.ToString().Replace("-o ", "").Replace("\"", "");
@@ -690,30 +744,12 @@ namespace Handbrake.Functions
}
thisQuery.q_videoEncoder = videoEncoderConvertion;
- audioEncoderConvertion = audioEncoder.ToString().Replace("-E ", "");
- switch (audioEncoderConvertion)
- {
- case "faac":
- audioEncoderConvertion = "AAC";
- break;
- case "lame":
- audioEncoderConvertion = "MP3";
- break;
- case "vorbis":
- audioEncoderConvertion = "Vorbis";
- break;
- case "ac3":
- audioEncoderConvertion = "AC3";
- break;
- case "aac+ac3":
- audioEncoderConvertion = "AAC + AC3";
- break;
- default:
- audioEncoderConvertion = "AAC";
- break;
- }
- thisQuery.q_audioEncoder = audioEncoderConvertion;
+ #endregion
+ /*
+ * Picture Settings Tab
+ */
+ #region Picture Tab
if (width.Success != false)
thisQuery.q_videoWidth = int.Parse(width.ToString().Replace("-w ", ""));
@@ -721,12 +757,7 @@ namespace Handbrake.Functions
if (height.Success != false)
thisQuery.q_videoHeight = int.Parse(height.ToString().Replace("-l ", ""));
- #endregion
- //
- //Picture Settings Tab
- //
- #region Picture Tab
if (crop.Success != false)
{
thisQuery.q_cropValues = crop.ToString().Replace("--crop ", "");
@@ -791,9 +822,9 @@ namespace Handbrake.Functions
#endregion
- //
- //Video Settings Tab
- //
+ /*
+ * Video Settings Tab
+ */
#region Video
thisQuery.q_grayscale = grayscale.Success;
thisQuery.q_twoPass = twoPass.Success;
@@ -802,7 +833,7 @@ namespace Handbrake.Functions
if (videoFramerate.Success != false)
thisQuery.q_videoFramerate = videoFramerate.ToString().Replace("-r ", "");
else
- thisQuery.q_videoFramerate = "Automatic";
+ thisQuery.q_videoFramerate = "Same as source";
if (videoBitrate.Success != false)
thisQuery.q_avgBitrate = videoBitrate.ToString().Replace("-b ", "");
@@ -821,16 +852,11 @@ namespace Handbrake.Functions
#endregion
- //
- //Audio Settings Tab
- //
+ /*
+ * Audio Settings Tab
+ */
#region Audio
- if (audioBitrate.Success != false)
- thisQuery.q_audioBitrate = audioBitrate.ToString().Replace("-B ", "");
-
- if (audioSampleRate.Success != false)
- thisQuery.q_audioSamplerate = audioSampleRate.ToString().Replace("-R ", "");
-
+ // Tracks
if (audioTrack1.Success != false)
thisQuery.q_audioTrack1 = audioTrack1.ToString().Replace("-a ", "");
else
@@ -843,33 +869,145 @@ namespace Handbrake.Functions
}
else
thisQuery.q_audioTrack2 = "None";
+
+ // Mixdowns
+ thisQuery.q_audioTrackMix1 = "Automatic";
+ if (audioTrack1Mix.Success != false)
+ {
+ switch (audioTrack1Mix.ToString().Replace("-6 ", "").Replace(" ", ""))
+ {
+ case "mono":
+ thisQuery.q_audioTrackMix1 = "Mono";
+ break;
+ case "stereo":
+ thisQuery.q_audioTrackMix1 = "Stereo";
+ break;
+ case "dpl1":
+ thisQuery.q_audioTrackMix1 = "Dolby Surround";
+ break;
+ case "dpl2":
+ thisQuery.q_audioTrackMix1 = "Dolby Pro Logic II";
+ break;
+ case "6ch":
+ thisQuery.q_audioTrackMix1 = "6 Channel Discrete";
+ break;
+ default:
+ thisQuery.q_audioTrackMix1 = "Automatic";
+ break;
+ }
+ }
- thisQuery.q_audioTrackMix = "Automatic";
- if (audioChannelsMix.Success != false)
+ thisQuery.q_audioTrackMix2 = "Automatic";
+ if (audioTrack2Mix.Success != false)
{
- switch (audioChannelsMix.ToString().Replace("-6 ", "").Replace(" ", ""))
+ string[] audio2mix = audioTrack2Mix.ToString().Split(',');
+ audio2mix[1] = audio2mix[1].Trim();
+ switch (audio2mix[1])
{
case "mono":
- thisQuery.q_audioTrackMix = "Mono";
+ thisQuery.q_audioTrackMix2 = "Mono";
break;
case "stereo":
- thisQuery.q_audioTrackMix = "Stereo";
+ thisQuery.q_audioTrackMix2 = "Stereo";
break;
case "dpl1":
- thisQuery.q_audioTrackMix = "Dolby Surround";
+ thisQuery.q_audioTrackMix2 = "Dolby Surround";
break;
case "dpl2":
- thisQuery.q_audioTrackMix = "Dolby Pro Logic II";
+ thisQuery.q_audioTrackMix2 = "Dolby Pro Logic II";
break;
case "6ch":
- thisQuery.q_audioTrackMix = "6 Channel Discrete";
+ thisQuery.q_audioTrackMix2 = "6 Channel Discrete";
break;
default:
- thisQuery.q_audioTrackMix = "Automatic";
+ thisQuery.q_audioTrackMix2 = "Automatic";
break;
}
+ }
+ // Audio Encoders
+ if (audioEncoder1.Success != false)
+ {
+ audioEncoderConvertion = audioEncoder1.ToString().Replace("-E ", "");
+ switch (audioEncoderConvertion)
+ {
+ case "faac":
+ audioEncoderConvertion = "AAC";
+ break;
+ case "lame":
+ audioEncoderConvertion = "MP3";
+ break;
+ case "vorbis":
+ audioEncoderConvertion = "Vorbis";
+ break;
+ case "ac3":
+ audioEncoderConvertion = "AC3";
+ break;
+ case "aac+ac3":
+ audioEncoderConvertion = "AAC + AC3";
+ break;
+ default:
+ audioEncoderConvertion = "AAC";
+ break;
+ }
+ thisQuery.q_audioEncoder1 = audioEncoderConvertion;
}
+
+ if (audioEncoder2.Success != false)
+ {
+ audioEncoderConvertion = audioEncoder2.ToString().Replace("-E ", "");
+ string[] audio2enc = audioEncoder2.ToString().Split(',');
+ audio2enc[1] = audio2enc[1].Trim();
+ switch (audio2enc[1])
+ {
+ case "faac":
+ audioEncoderConvertion = "AAC";
+ break;
+ case "lame":
+ audioEncoderConvertion = "MP3";
+ break;
+ case "vorbis":
+ audioEncoderConvertion = "Vorbis";
+ break;
+ case "ac3":
+ audioEncoderConvertion = "AC3";
+ break;
+ case "aac+ac3":
+ audioEncoderConvertion = "AAC + AC3";
+ break;
+ default:
+ audioEncoderConvertion = "AAC";
+ break;
+ }
+ thisQuery.q_audioEncoder2 = audioEncoderConvertion;
+ }
+
+
+ // Audio Bitrate
+ if (audioBitrate1.Success != false)
+ thisQuery.q_audioBitrate1 = audioBitrate1.ToString().Replace("-B ", "").Trim();
+ else
+ thisQuery.q_audioBitrate1 = "";
+
+ if (audioBitrate2.Success != false)
+ {
+ string[] audioBitrateSelect = audioBitrate2.ToString().Split(',');
+ thisQuery.q_audioBitrate2 = audioBitrateSelect[1].Trim();
+ }
+ else
+ thisQuery.q_audioBitrate2 = "";
+
+ // Audio Sample Rate
+ if (audioSampleRate1.Success != false)
+ thisQuery.q_audioSamplerate1 = audioSampleRate1.ToString().Replace("-R ", "").Trim();
+
+ if (audioSampleRate2.Success != false)
+ {
+ string[] audioSRSelect = audioSampleRate2.ToString().Split(',');
+ thisQuery.q_audioSamplerate2 = audioSRSelect[1].Trim();
+ }
+
+
if (subtitles.Success != false)
thisQuery.q_subtitles = subtitles.ToString().Replace("-s ", "");
else
@@ -888,9 +1026,7 @@ namespace Handbrake.Functions
thisQuery.q_drc = drcValue;
}
else
- {
thisQuery.q_drc = 0;
- }
thisQuery.q_forcedSubs = forcedSubtitles.Success;
@@ -918,6 +1054,7 @@ namespace Handbrake.Functions
{
MessageBox.Show("An error has occured in the Query Parser. Please report this error on the forum in the 'Windows' support section. \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
+ #endregion
return thisQuery;
}
diff --git a/win/C#/Functions/RssReader.cs b/win/C#/Functions/RssReader.cs
index c8aa5a74d..44fffd21b 100644
--- a/win/C#/Functions/RssReader.cs
+++ b/win/C#/Functions/RssReader.cs
@@ -1,7 +1,7 @@
/* RssReader.cs $
This file is part of the HandBrake source code.
- Homepage: <http://handbrake.m0k.org/>.
+ Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
using System;
diff --git a/win/C#/Functions/x264Panel.cs b/win/C#/Functions/x264Panel.cs
index b781a8aad..e585a3939 100644
--- a/win/C#/Functions/x264Panel.cs
+++ b/win/C#/Functions/x264Panel.cs
@@ -307,7 +307,7 @@ namespace Handbrake.Functions
}
- #region Some Private Functions used by the above Public Functions
+ // Some Private Functions used by the above Public Functions
/*
* Used by on_x264_WidgetChange()
* Called when the current x264 option string contains multiple (or a single) item(s) in it seperated by :
@@ -920,7 +920,6 @@ namespace Handbrake.Functions
}
}
}
-
/*
* Take a single option and standardize it. Returns as a String
* Input: String. - Single X264 Option. Name only
@@ -996,7 +995,5 @@ namespace Handbrake.Functions
return cleanOptNameString;
}
-
- #endregion
}
}