summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/C#/Changelog.html4
-rw-r--r--win/C#/Controls/AudioPanel.cs34
-rw-r--r--win/C#/Controls/Subtitles.cs14
-rw-r--r--win/C#/Controls/x264Panel.Designer.cs40
-rw-r--r--win/C#/Controls/x264Panel.cs158
-rw-r--r--win/C#/Functions/Main.cs24
-rw-r--r--win/C#/Functions/PresetLoader.cs6
-rw-r--r--win/C#/Functions/QueryGenerator.cs2
-rw-r--r--win/C#/frmMain.cs10
9 files changed, 152 insertions, 140 deletions
diff --git a/win/C#/Changelog.html b/win/C#/Changelog.html
index 1b94d87c1..9be2005ed 100644
--- a/win/C#/Changelog.html
+++ b/win/C#/Changelog.html
@@ -23,11 +23,13 @@ Windows Platform Specific Changlog.<br />
- Fix issue where file extension could be mp4 when chapters is enabled. Problem in the autoname function.<br />
- Fix a regex error in the appcast reader and make it more robust to errors.<br />
- Fix issue with the destination File box double appending the file extension<br />
+ - Fix issue changing file format causing the audio encoder dropdown to be set to ""<br />
+ - Fixed an issue with autoName function and format dropdown with regards to AC3 in the audio list. Also, CC or SRT<br />
+
<h4>Backend / Not important changes</h4>
- Filters dropdowns re-arranged and updated for consistancy (Off, Custom ...)
-
<h2>Changes since Snapshot 1 - SVN2592</h2> <!-- Snapshot 2 -->
<h4>New Features</h4>
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs
index 67ee331d9..b394e3ca5 100644
--- a/win/C#/Controls/AudioPanel.cs
+++ b/win/C#/Controls/AudioPanel.cs
@@ -130,7 +130,7 @@ namespace Handbrake.Controls
value = ((tb_drc.Value - 1) / 10.0) + 1;
// Create a new row for the Audio list based on the currently selected items in the dropdown.
- ListViewItem newTrack = new ListViewItem(getNewID().ToString());
+ ListViewItem newTrack = new ListViewItem(GetNewID().ToString());
newTrack.SubItems.Add(drp_audioTrack.Text);
newTrack.SubItems.Add(drp_audioEncoder.Text);
newTrack.SubItems.Add(drp_audioMix.Text);
@@ -149,7 +149,7 @@ namespace Handbrake.Controls
}
private void btn_RemoveAudioTrack_Click(object sender, EventArgs e)
{
- removeAudioTrack();
+ RemoveAudioTrack();
}
// Audio List Menu
@@ -189,9 +189,9 @@ namespace Handbrake.Controls
}
private void audioList_remove_Click(object sender, EventArgs e)
{
- removeAudioTrack();
+ RemoveAudioTrack();
}
- private void removeAudioTrack()
+ private void RemoveAudioTrack()
{
// Remove the Item and reselect the control if the following conditions are met.
if (lv_audioList.SelectedItems.Count != 0)
@@ -221,7 +221,7 @@ namespace Handbrake.Controls
}
// Public Functions
- public void setTrackList(Parsing.Title selectedTitle)
+ public void SetTrackList(Parsing.Title selectedTitle)
{
drp_audioTrack.Items.Clear();
drp_audioTrack.Items.Add("Automatic");
@@ -263,20 +263,22 @@ namespace Handbrake.Controls
}
drp_audioMix.SelectedIndex = 0;
}
- public ListView getAudioPanel()
+ public ListView GetAudioPanel()
{
return lv_audioList;
}
- public void setAudioByContainer(String path)
+ public void SetContainer(String path)
{
+ string oldval = drp_audioEncoder.Text;
if ((path.Contains("MP4")) || (path.Contains("M4V")))
{
- string oldval = drp_audioEncoder.Text;
drp_audioEncoder.Items.Clear();
drp_audioEncoder.Items.Add("AAC (faac)");
drp_audioEncoder.Items.Add("AC3 Passthru");
if ((oldval != "AAC (faac)") && (oldval != "AC3 Passthru"))
drp_audioEncoder.SelectedIndex = 0;
+ else
+ drp_audioEncoder.SelectedItem = oldval;
}
else if (path.Contains("MKV"))
@@ -287,6 +289,7 @@ namespace Handbrake.Controls
drp_audioEncoder.Items.Add("AC3 Passthru");
drp_audioEncoder.Items.Add("DTS Passthru");
drp_audioEncoder.Items.Add("Vorbis (vorbis)");
+ drp_audioEncoder.SelectedItem = oldval;
if (drp_audioEncoder.Text == string.Empty)
drp_audioEncoder.SelectedIndex = 0;
@@ -299,22 +302,31 @@ namespace Handbrake.Controls
row.SubItems[2].Text = drp_audioEncoder.Items[0].ToString();
}
}
- public void addTrackForPreset(ListViewItem item)
+ public void AddTrackForPreset(ListViewItem item)
{
lv_audioList.Items.Add(item);
if (this.AudioListChanged != null)
this.AudioListChanged(this, new EventArgs());
}
- public void clearAudioList()
+ public void ClearAudioList()
{
lv_audioList.Items.Clear();
if (this.AudioListChanged != null)
this.AudioListChanged(this, new EventArgs());
}
- public int getNewID()
+ public int GetNewID()
{
return lv_audioList.Items.Count + 1;
}
+ public Boolean RequiresM4V()
+ {
+ foreach (ListViewItem item in lv_audioList.Items)
+ {
+ if (item.SubItems[2].Text.Contains("AC3"))
+ return true;
+ }
+ return false;
+ }
// Helper Functions
private void reGenerateListIDs()
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs
index e4142bd44..e23718c0a 100644
--- a/win/C#/Controls/Subtitles.cs
+++ b/win/C#/Controls/Subtitles.cs
@@ -22,6 +22,8 @@ namespace Handbrake.Controls
}
private int FileContainer;
+
+ // Public Functions
public void setSubtitleTrackAuto()
{
// Handle Native Language and "Dub Foreign language audio" and "Use Foreign language audio and Subtitles" Options
@@ -57,6 +59,18 @@ namespace Handbrake.Controls
}
}
}
+ public Boolean RequiresM4V()
+ {
+ foreach (ListViewItem item in lv_subList.Items)
+ {
+ if (!string.IsNullOrEmpty(item.SubItems[5].Text))
+ return true;
+
+ if (item.SubItems[1].Text.Contains("(Text)"))
+ return true;
+ }
+ return false;
+ }
// Controls
private void btn_addSubTrack_Click(object sender, EventArgs e)
diff --git a/win/C#/Controls/x264Panel.Designer.cs b/win/C#/Controls/x264Panel.Designer.cs
index 76a156c61..664586ef5 100644
--- a/win/C#/Controls/x264Panel.Designer.cs
+++ b/win/C#/Controls/x264Panel.Designer.cs
@@ -88,7 +88,7 @@ namespace Handbrake.Controls
this.ToolTip.SetToolTip(this.slider_psytrellis, "Psychovisual Trellis tries to retain more sharpness and detail, but can cause art" +
"ifacting. \r\nIt is considered experimental, which is why it\'s off by default. Goo" +
"d values are 0.1 to 0.2.");
- this.slider_psytrellis.Scroll += new System.EventHandler(this.slider_psytrellis_Scroll);
+ this.slider_psytrellis.Scroll += new System.EventHandler(this.widgetControlChanged);
//
// lbl_psytrellis
//
@@ -115,7 +115,7 @@ namespace Handbrake.Controls
this.slider_psyrd.Size = new System.Drawing.Size(131, 45);
this.slider_psyrd.TabIndex = 83;
this.ToolTip.SetToolTip(this.slider_psyrd, resources.GetString("slider_psyrd.ToolTip"));
- this.slider_psyrd.Scroll += new System.EventHandler(this.slider_psyrd_Scroll);
+ this.slider_psyrd.Scroll += new System.EventHandler(this.widgetControlChanged);
//
// lbl_adaptBFrames
//
@@ -140,7 +140,7 @@ namespace Handbrake.Controls
this.drop_adaptBFrames.Size = new System.Drawing.Size(121, 21);
this.drop_adaptBFrames.TabIndex = 82;
this.ToolTip.SetToolTip(this.drop_adaptBFrames, resources.GetString("drop_adaptBFrames.ToolTip"));
- this.drop_adaptBFrames.SelectedIndexChanged += new System.EventHandler(this.drop_adaptBFrames_SelectedIndexChanged);
+ this.drop_adaptBFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// label43
//
@@ -190,7 +190,7 @@ namespace Handbrake.Controls
this.check_Cabac.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.ToolTip.SetToolTip(this.check_Cabac, resources.GetString("check_Cabac.ToolTip"));
this.check_Cabac.UseVisualStyleBackColor = true;
- this.check_Cabac.CheckedChanged += new System.EventHandler(this.check_Cabac_CheckedChanged);
+ this.check_Cabac.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// check_noDCTDecimate
//
@@ -205,7 +205,7 @@ namespace Handbrake.Controls
this.check_noDCTDecimate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.ToolTip.SetToolTip(this.check_noDCTDecimate, resources.GetString("check_noDCTDecimate.ToolTip"));
this.check_noDCTDecimate.UseVisualStyleBackColor = true;
- this.check_noDCTDecimate.CheckedChanged += new System.EventHandler(this.check_noDCTDecimate_CheckedChanged);
+ this.check_noDCTDecimate.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// check_noFastPSkip
//
@@ -221,7 +221,7 @@ namespace Handbrake.Controls
this.ToolTip.SetToolTip(this.check_noFastPSkip, "This can help with blocking on solid colors like blue skies, but it also slows do" +
"wn the encode.");
this.check_noFastPSkip.UseVisualStyleBackColor = true;
- this.check_noFastPSkip.CheckedChanged += new System.EventHandler(this.check_noFastPSkip_CheckedChanged);
+ this.check_noFastPSkip.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// lbl_trellis
//
@@ -246,7 +246,7 @@ namespace Handbrake.Controls
this.drop_trellis.Size = new System.Drawing.Size(94, 21);
this.drop_trellis.TabIndex = 75;
this.ToolTip.SetToolTip(this.drop_trellis, resources.GetString("drop_trellis.ToolTip"));
- this.drop_trellis.SelectedIndexChanged += new System.EventHandler(this.drop_trellis_SelectedIndexChanged);
+ this.drop_trellis.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// drop_deblockBeta
//
@@ -272,7 +272,7 @@ namespace Handbrake.Controls
this.drop_deblockBeta.Size = new System.Drawing.Size(68, 21);
this.drop_deblockBeta.TabIndex = 74;
this.ToolTip.SetToolTip(this.drop_deblockBeta, resources.GetString("drop_deblockBeta.ToolTip"));
- this.drop_deblockBeta.SelectedIndexChanged += new System.EventHandler(this.drop_deblockBeta_SelectedIndexChanged);
+ this.drop_deblockBeta.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// label41
//
@@ -307,7 +307,7 @@ namespace Handbrake.Controls
this.drop_deblockAlpha.Size = new System.Drawing.Size(68, 21);
this.drop_deblockAlpha.TabIndex = 73;
this.ToolTip.SetToolTip(this.drop_deblockAlpha, resources.GetString("drop_deblockAlpha.ToolTip"));
- this.drop_deblockAlpha.SelectedIndexChanged += new System.EventHandler(this.drop_deblockAlpha_SelectedIndexChanged);
+ this.drop_deblockAlpha.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// panel3
//
@@ -349,7 +349,7 @@ namespace Handbrake.Controls
this.check_8x8DCT.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.ToolTip.SetToolTip(this.check_8x8DCT, resources.GetString("check_8x8DCT.ToolTip"));
this.check_8x8DCT.UseVisualStyleBackColor = true;
- this.check_8x8DCT.CheckedChanged += new System.EventHandler(this.check_8x8DCT_CheckedChanged);
+ this.check_8x8DCT.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// label45
//
@@ -373,7 +373,7 @@ namespace Handbrake.Controls
this.drop_analysis.Size = new System.Drawing.Size(63, 21);
this.drop_analysis.TabIndex = 71;
this.ToolTip.SetToolTip(this.drop_analysis, resources.GetString("drop_analysis.ToolTip"));
- this.drop_analysis.SelectedIndexChanged += new System.EventHandler(this.drop_analysis_SelectedIndexChanged);
+ this.drop_analysis.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// label48
//
@@ -405,7 +405,7 @@ namespace Handbrake.Controls
this.drop_subpixelMotionEstimation.Size = new System.Drawing.Size(139, 21);
this.drop_subpixelMotionEstimation.TabIndex = 70;
this.ToolTip.SetToolTip(this.drop_subpixelMotionEstimation, resources.GetString("drop_subpixelMotionEstimation.ToolTip"));
- this.drop_subpixelMotionEstimation.SelectedIndexChanged += new System.EventHandler(this.drop_subpixelMotionEstimation_SelectedIndexChanged);
+ this.drop_subpixelMotionEstimation.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// lbl_merange
//
@@ -488,7 +488,7 @@ namespace Handbrake.Controls
this.drop_MotionEstimationRange.Size = new System.Drawing.Size(139, 21);
this.drop_MotionEstimationRange.TabIndex = 69;
this.ToolTip.SetToolTip(this.drop_MotionEstimationRange, resources.GetString("drop_MotionEstimationRange.ToolTip"));
- this.drop_MotionEstimationRange.SelectedIndexChanged += new System.EventHandler(this.drop_MotionEstimationRange_SelectedIndexChanged);
+ this.drop_MotionEstimationRange.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// label54
//
@@ -516,7 +516,7 @@ namespace Handbrake.Controls
this.drop_MotionEstimationMethod.Size = new System.Drawing.Size(139, 21);
this.drop_MotionEstimationMethod.TabIndex = 68;
this.ToolTip.SetToolTip(this.drop_MotionEstimationMethod, resources.GetString("drop_MotionEstimationMethod.ToolTip"));
- this.drop_MotionEstimationMethod.SelectedIndexChanged += new System.EventHandler(this.drop_MotionEstimationMethod_SelectedIndexChanged);
+ this.drop_MotionEstimationMethod.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// check_pyrmidalBFrames
//
@@ -530,7 +530,7 @@ namespace Handbrake.Controls
this.check_pyrmidalBFrames.Text = "Pyramidal B-Frames:";
this.ToolTip.SetToolTip(this.check_pyrmidalBFrames, resources.GetString("check_pyrmidalBFrames.ToolTip"));
this.check_pyrmidalBFrames.UseVisualStyleBackColor = true;
- this.check_pyrmidalBFrames.CheckedChanged += new System.EventHandler(this.check_pyrmidalBFrames_CheckedChanged);
+ this.check_pyrmidalBFrames.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// check_weightedBFrames
//
@@ -544,7 +544,7 @@ namespace Handbrake.Controls
this.check_weightedBFrames.Text = "Weighted B-Frames:";
this.ToolTip.SetToolTip(this.check_weightedBFrames, resources.GetString("check_weightedBFrames.ToolTip"));
this.check_weightedBFrames.UseVisualStyleBackColor = true;
- this.check_weightedBFrames.CheckedChanged += new System.EventHandler(this.check_weightedBFrames_CheckedChanged);
+ this.check_weightedBFrames.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// lbl_direct_prediction
//
@@ -570,7 +570,7 @@ namespace Handbrake.Controls
this.drop_directPrediction.Size = new System.Drawing.Size(121, 21);
this.drop_directPrediction.TabIndex = 57;
this.ToolTip.SetToolTip(this.drop_directPrediction, resources.GetString("drop_directPrediction.ToolTip"));
- this.drop_directPrediction.SelectedIndexChanged += new System.EventHandler(this.drop_directPrediction_SelectedIndexChanged);
+ this.drop_directPrediction.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// label62
//
@@ -611,7 +611,7 @@ namespace Handbrake.Controls
this.ToolTip.SetToolTip(this.drop_bFrames, "Sane values are 1-6. \r\nB-Frames are smaller than other frames, so they let you pa" +
"ck in more quality at the same bitrate. \r\nUse more of them with animated materia" +
"l.");
- this.drop_bFrames.SelectedIndexChanged += new System.EventHandler(this.drop_bFrames_SelectedIndexChanged);
+ this.drop_bFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// label64
//
@@ -652,7 +652,7 @@ namespace Handbrake.Controls
this.ToolTip.SetToolTip(this.drop_refFrames, "Sane values are 1-6. \r\nThe more you add, the higher the quality, but the slower t" +
"he encode. Be careful... too many and QuickTime struggles to play the video back" +
".");
- this.drop_refFrames.SelectedIndexChanged += new System.EventHandler(this.drop_refFrames_SelectedIndexChanged);
+ this.drop_refFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
//
// check_mixedReferences
//
@@ -668,7 +668,7 @@ namespace Handbrake.Controls
this.ToolTip.SetToolTip(this.check_mixedReferences, "With this on, different references can be used for different parts of each 16x16 " +
"pixel macroblock, increasing quality.");
this.check_mixedReferences.UseVisualStyleBackColor = true;
- this.check_mixedReferences.CheckedChanged += new System.EventHandler(this.check_mixedReferences_CheckedChanged);
+ this.check_mixedReferences.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
//
// ToolTip
//
diff --git a/win/C#/Controls/x264Panel.cs b/win/C#/Controls/x264Panel.cs
index 67da54485..6df49e744 100644
--- a/win/C#/Controls/x264Panel.cs
+++ b/win/C#/Controls/x264Panel.cs
@@ -16,7 +16,7 @@ namespace Handbrake.Controls
InitializeComponent();
if (Properties.Settings.Default.tooltipEnable)
- setToolTipActive(true);
+ ToolTip.Active = true;
reset2Defaults();
}
@@ -26,91 +26,76 @@ namespace Handbrake.Controls
get { return rtf_x264Query.Text; }
set { rtf_x264Query.Text = value; }
}
- private void setToolTipActive(Boolean active)
- {
- ToolTip.Active = active;
- }
- #region Controls Changed
- private void drop_refFrames_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("ref");
- }
- private void check_mixedReferences_CheckedChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("mixed-refs");
- }
- private void drop_bFrames_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("bframes");
- }
- private void drop_directPrediction_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("direct");
- }
- private void check_weightedBFrames_CheckedChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("weightb");
- }
- private void check_pyrmidalBFrames_CheckedChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("b-pyramid");
- }
- private void drop_MotionEstimationMethod_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("me");
- }
- private void drop_MotionEstimationRange_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("merange");
- }
- private void drop_subpixelMotionEstimation_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("subq");
- }
- private void drop_analysis_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("analyse");
- }
- private void check_8x8DCT_CheckedChanged(object sender, EventArgs e)
+ private void widgetControlChanged(object sender, EventArgs e)
{
- on_x264_WidgetChange("8x8dct");
- }
- private void drop_deblockAlpha_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("deblock");
- }
- private void drop_deblockBeta_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("deblock");
- }
- private void drop_trellis_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("trellis");
- }
- private void check_noFastPSkip_CheckedChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("no-fast-pskip");
- }
- private void check_noDCTDecimate_CheckedChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("no-dct-decimate");
- }
- private void check_Cabac_CheckedChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("cabac");
- }
- private void slider_psyrd_Scroll(object sender, EventArgs e)
- {
- on_x264_WidgetChange("psy-rd");
- }
- private void slider_psytrellis_Scroll(object sender, EventArgs e)
- {
- on_x264_WidgetChange("psy-rd");
- }
- private void drop_adaptBFrames_SelectedIndexChanged(object sender, EventArgs e)
- {
- on_x264_WidgetChange("b-adapt");
+ Control changedControlName = (Control) sender;
+ string controlName = "";
+
+ switch (changedControlName.Name.Trim())
+ {
+ case "drop_refFrames":
+ controlName = "ref";
+ break;
+ case "check_mixedReferences":
+ controlName = "mixed-refs";
+ break;
+ case "drop_bFrames":
+ controlName = "bframes";
+ break;
+ case "drop_directPrediction":
+ controlName = "direct";
+ break;
+ case "check_weightedBFrames":
+ controlName = "weightb";
+ break;
+ case "check_pyrmidalBFrames":
+ controlName = "b-pyramid";
+ break;
+ case "drop_MotionEstimationMethod":
+ controlName = "me";
+ break;
+ case "drop_MotionEstimationRange":
+ controlName = "merange";
+ break;
+ case "drop_subpixelMotionEstimation":
+ controlName = "subq";
+ break;
+ case "drop_analysis":
+ controlName = "analyse";
+ break;
+ case "check_8x8DCT":
+ controlName = "8x8dct";
+ break;
+ case "drop_deblockAlpha":
+ controlName = "deblock";
+ break;
+ case "drop_deblockBeta":
+ controlName = "deblock";
+ break;
+ case "drop_trellis":
+ controlName = "trellis";
+ break;
+ case "check_noFastPSkip":
+ controlName = "no-fast-pskip";
+ break;
+ case "check_noDCTDecimate":
+ controlName = "no-dct-decimate";
+ break;
+ case "check_Cabac":
+ controlName = "cabac";
+ break;
+ case "slider_psyrd":
+ controlName = "psy-rd";
+ break;
+ case "slider_psytrellis":
+ controlName = "psy-rd";
+ break;
+ case "drop_adaptBFrames":
+ controlName = "b-adapt";
+ break;
+ }
+ on_x264_WidgetChange(controlName);
}
private void rtf_x264Query_TextChanged(object sender, EventArgs e)
{
@@ -131,8 +116,7 @@ namespace Handbrake.Controls
rtf_x264Query.Text = "";
reset2Defaults();
}
- #endregion
-
+
/// <summary>
/// Reset all components to defaults and clears the x264 rtf box
/// </summary>
@@ -1012,4 +996,4 @@ namespace Handbrake.Controls
}
}
}
-}
+} \ No newline at end of file
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 55b95c4a8..7516e52da 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -124,21 +124,21 @@ namespace Handbrake.Functions
/// Function which generates the filename and path automatically based on
/// the Source Name, DVD title and DVD Chapters
/// </summary>
- public static string autoName(ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)
+ public static string autoName(frmMain mainWindow ) //ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)
{
string AutoNamePath = string.Empty;
- if (drpDvdtitle.Text != "Automatic")
+ if (mainWindow.drp_dvdtitle.Text != "Automatic")
{
// Get the Source Name
- string sourceName = Path.GetFileNameWithoutExtension(source);
+ string sourceName = Path.GetFileNameWithoutExtension(mainWindow.sourcePath);
// Get the Selected Title Number
- string[] titlesplit = drpDvdtitle.Text.Split(' ');
+ string[] titlesplit = mainWindow.drp_dvdtitle.Text.Split(' ');
string dvdTitle = titlesplit[0].Replace("Automatic", "");
// Get the Chapter Start and Chapter End Numbers
- string chapterStart = chapter_start.Replace("Auto", "");
- string chapterFinish = chatper_end.Replace("Auto", "");
+ string chapterStart = mainWindow.drop_chapterStart.Text.Replace("Auto", "");
+ string chapterFinish = mainWindow.drop_chapterFinish.Text.Replace("Auto", "");
string combinedChapterTag = chapterStart;
if (chapterFinish != chapterStart && chapterFinish != "")
combinedChapterTag = chapterStart + "-" + chapterFinish;
@@ -154,19 +154,19 @@ namespace Handbrake.Functions
destinationFilename = sourceName + "_T" + dvdTitle + "_C" + combinedChapterTag;
// Add the appropriate file extension
- if (format == 0)
+ if (mainWindow.drop_format.SelectedIndex == 0)
{
- if (Properties.Settings.Default.useM4v || chapters)
+ if (Properties.Settings.Default.useM4v || mainWindow.Check_ChapterMarkers.Checked || mainWindow.AudioSettings.RequiresM4V() || mainWindow.Subtitles.RequiresM4V())
destinationFilename += ".m4v";
else
destinationFilename += ".mp4";
}
- else if (format == 1)
+ else if (mainWindow.drop_format.SelectedIndex == 1)
destinationFilename += ".mkv";
// Now work out the path where the file will be stored.
// First case: If the destination box doesn't already contain a path, make one.
- if (!dest.Contains(Path.DirectorySeparatorChar.ToString()))
+ if (!mainWindow.text_destination.Text.Contains(Path.DirectorySeparatorChar.ToString()))
{
// If there is an auto name path, use it...
if (Properties.Settings.Default.autoNamePath.Trim() != "" && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")
@@ -177,8 +177,8 @@ namespace Handbrake.Functions
else // Otherwise, use the path that is already there.
{
// Use the path and change the file extension to match the previous destination
- AutoNamePath = Path.Combine(Path.GetDirectoryName(dest), destinationFilename);
- AutoNamePath = Path.ChangeExtension(AutoNamePath, Path.GetExtension(dest));
+ AutoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text), destinationFilename);
+ AutoNamePath = Path.ChangeExtension(AutoNamePath, Path.GetExtension(mainWindow.text_destination.Text));
}
}
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs
index 4345f6f9a..90f16f658 100644
--- a/win/C#/Functions/PresetLoader.cs
+++ b/win/C#/Functions/PresetLoader.cs
@@ -205,12 +205,12 @@ namespace Handbrake.Functions
#region Audio
// Clear the audio listing
- mainWindow.AudioSettings.clearAudioList();
+ mainWindow.AudioSettings.ClearAudioList();
if (presetQuery.AudioInformation != null)
foreach (AudioTrack track in presetQuery.AudioInformation)
{
- ListViewItem newTrack = new ListViewItem(mainWindow.AudioSettings.getNewID().ToString());
+ ListViewItem newTrack = new ListViewItem(mainWindow.AudioSettings.GetNewID().ToString());
newTrack.SubItems.Add("Automatic");
newTrack.SubItems.Add(track.Encoder);
@@ -221,7 +221,7 @@ namespace Handbrake.Functions
else
newTrack.SubItems.Add(track.Bitrate);
newTrack.SubItems.Add(track.DRC);
- mainWindow.AudioSettings.addTrackForPreset(newTrack);
+ mainWindow.AudioSettings.AddTrackForPreset(newTrack);
}
#endregion
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index 0fb6248e6..198be2d43 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -227,7 +227,7 @@ namespace Handbrake.Functions
#region Audio Settings Tab
- ListView audioTracks = mainWindow.AudioSettings.getAudioPanel();
+ ListView audioTracks = mainWindow.AudioSettings.GetAudioPanel();
List<string> tracks = new List<string>();
List<string> codecs = new List<string>();
List<string> mixdowns = new List<string>();
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index f50c544d0..662491551 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -926,7 +926,7 @@ namespace Handbrake
drop_chapterFinish.Text = drop_chapterFinish.Items[drop_chapterFinish.Items.Count - 1].ToString();
// Populate the Audio Channels Dropdown
- AudioSettings.setTrackList(selectedTitle);
+ AudioSettings.SetTrackList(selectedTitle);
// Populate the Subtitles dropdown
Subtitles.drp_subtitleTracks.Items.Clear();
@@ -939,7 +939,7 @@ namespace Handbrake
// Run the autoName & chapterNaming functions
if (Properties.Settings.Default.autoNaming)
{
- string autoPath = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, sourcePath, text_destination.Text, drop_format.SelectedIndex, Check_ChapterMarkers.Checked);
+ string autoPath = Main.autoName(this);
if (autoPath != null)
text_destination.Text = autoPath;
else
@@ -1014,7 +1014,7 @@ namespace Handbrake
// Run the Autonaming function
if (Properties.Settings.Default.autoNaming)
- text_destination.Text = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, sourcePath, text_destination.Text, drop_format.SelectedIndex, Check_ChapterMarkers.Checked);
+ text_destination.Text = Main.autoName(this);
// Disable chapter markers if only 1 chapter is selected.
if (chapterStart == chapterEnd)
@@ -1097,7 +1097,7 @@ namespace Handbrake
switch (drop_format.SelectedIndex)
{
case 0:
- if (Properties.Settings.Default.useM4v)
+ if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() || Subtitles.RequiresM4V())
setExtension(".m4v");
else
setExtension(".mp4");
@@ -1107,7 +1107,7 @@ namespace Handbrake
break;
}
- AudioSettings.setAudioByContainer(drop_format.Text);
+ AudioSettings.SetContainer(drop_format.Text);
Subtitles.setContainer(drop_format.SelectedIndex);
if ((drop_format.Text.Contains("MP4")) || (drop_format.Text.Contains("M4V")))