summaryrefslogtreecommitdiffstats
path: root/win/C#/frmMain.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-03-16 16:50:29 +0000
committersr55 <[email protected]>2008-03-16 16:50:29 +0000
commitab3ebdc5674f394edf50f436130cff8905a58e91 (patch)
treeadbccb8ce4f1950c10f6b358823801a17b509756 /win/C#/frmMain.cs
parent764c1ac7a990465199b5ee4e4c4e348383ba34c1 (diff)
WinGui:
- When selecting a destination, The audio encoder selection dropdown now repopulates with only compatible encoders (based on file container) - Misc other changes git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1343 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r--win/C#/frmMain.cs48
1 files changed, 46 insertions, 2 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 424142ef8..b83137278 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -377,6 +377,8 @@ namespace Handbrake
MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else
{
+ setAudioByContainer(DVD_Save.FileName);
+
text_destination.Text = DVD_Save.FileName;
// Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing)
@@ -398,8 +400,49 @@ namespace Handbrake
#endregion
+ #region Reusable Functions
+ private void setAudioByContainer(String path)
+ {
+ if ((path.EndsWith(".mp4")) || (path.EndsWith(".mp4")))
+ {
+ drp_audioCodec.Items.Clear();
+ drp_audioCodec.Items.Add("AAC");
+ drp_audioCodec.Items.Add("AAC + AC3");
+ drp_audioCodec.SelectedIndex = 0;
+ }
+ else if (path.EndsWith(".avi"))
+ {
+ drp_audioCodec.Items.Clear();
+ drp_audioCodec.Items.Add("MP3");
+ drp_audioCodec.Items.Add("AC3");
+ drp_audioCodec.SelectedIndex = 0;
+ }
+ else if (path.EndsWith(".ogm"))
+ {
+ drp_audioCodec.Items.Clear();
+ drp_audioCodec.Items.Add("Vorbis");
+ drp_audioCodec.SelectedIndex = 0;
+ }
+ else if (path.EndsWith(".mkv"))
+ {
+ drp_audioCodec.Items.Clear();
+ drp_audioCodec.Items.Add("AAC");
+ drp_audioCodec.Items.Add("AAC + AC3");
+ drp_audioCodec.Items.Add("MP3");
+ drp_audioCodec.Items.Add("AC3");
+ drp_audioCodec.Items.Add("Vorbis");
+ drp_audioCodec.SelectedIndex = 0;
+ }
+ }
+ #endregion
+
#region frmMain Actions
+ private void text_destination_TextChanged(object sender, EventArgs e)
+ {
+ setAudioByContainer(text_destination.Text);
+ }
+
private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
{
// Reset some values on the form
@@ -1134,7 +1177,7 @@ namespace Handbrake
selectedPreset = treeView_presets.SelectedNode.Text;
if (!selectedPreset.StartsWith("--"))
- MessageBox.Show("Sorry, You can not remove any of the built in presets.","Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ MessageBox.Show("Sorry, You can not remove any of the built in presets.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// Scan through the users presets and dump them all in an arraylist
@@ -1163,7 +1206,7 @@ namespace Handbrake
int c = 0;
foreach (string item in user_presets)
{
- string preset_name = selectedPreset.Replace("--","");
+ string preset_name = selectedPreset.Replace("--", "");
if (item.Contains(preset_name))
modified_presets_list.RemoveAt(c);
c++;
@@ -1296,6 +1339,7 @@ namespace Handbrake
#endregion
+
// This is the END of the road ------------------------------------------------------------------------------
}
} \ No newline at end of file