summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2007-07-09 16:45:25 +0000
committersr55 <[email protected]>2007-07-09 16:45:25 +0000
commit4a9e63938dd90a1ae640d9087daf24592fafb15f (patch)
treea6f18e6d8f1a9715e18559f91c1d3126932f4bd6
parent16222f64e3f0f6dc7c256111bc191d3ff69419f6 (diff)
WinGui:
- Another chunk of code ported to C# git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@661 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/HandBrakeCS.csproj2
-rw-r--r--win/C#/HandBrakeCS.suobin32256 -> 32256 bytes
-rw-r--r--win/C#/frmMain.Designer.cs23
-rw-r--r--win/C#/frmMain.cs246
-rw-r--r--win/C#/frmReadDVD.cs2
5 files changed, 267 insertions, 6 deletions
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj
index aed93e217..246a4918d 100644
--- a/win/C#/HandBrakeCS.csproj
+++ b/win/C#/HandBrakeCS.csproj
@@ -61,7 +61,7 @@
<Compile Include="frmOptions.Designer.cs">
<DependentUpon>frmOptions.cs</DependentUpon>
</Compile>
- <Compile Include="HandBrake.cs" />
+ <Compile Include="HB.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmAbout.resx">
diff --git a/win/C#/HandBrakeCS.suo b/win/C#/HandBrakeCS.suo
index 7833f2b67..627f73aff 100644
--- a/win/C#/HandBrakeCS.suo
+++ b/win/C#/HandBrakeCS.suo
Binary files differ
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs
index d55eabf26..80c5d4bc9 100644
--- a/win/C#/frmMain.Designer.cs
+++ b/win/C#/frmMain.Designer.cs
@@ -241,6 +241,7 @@ namespace Handbrake
this.drp_dvdtitle.TabIndex = 39;
this.drp_dvdtitle.Text = "Automatic";
this.ToolTip.SetToolTip(this.drp_dvdtitle, "The title number you wish to encode.");
+ this.drp_dvdtitle.SelectedIndexChanged += new System.EventHandler(this.drp_dvdtitle_SelectedIndexChanged);
//
// RadioISO
//
@@ -702,6 +703,7 @@ namespace Handbrake
this.text_height.Name = "text_height";
this.text_height.Size = new System.Drawing.Size(64, 21);
this.text_height.TabIndex = 8;
+ this.text_height.TextChanged += new System.EventHandler(this.text_height_TextChanged);
//
// Label55
//
@@ -722,6 +724,7 @@ namespace Handbrake
this.text_width.Name = "text_width";
this.text_width.Size = new System.Drawing.Size(64, 21);
this.text_width.TabIndex = 7;
+ this.text_width.TextChanged += new System.EventHandler(this.text_width_TextChanged);
//
// btn_destBrowse
//
@@ -764,6 +767,7 @@ namespace Handbrake
this.drp_videoEncoder.Size = new System.Drawing.Size(156, 21);
this.drp_videoEncoder.TabIndex = 5;
this.drp_videoEncoder.Text = "H.264";
+ this.drp_videoEncoder.SelectedIndexChanged += new System.EventHandler(this.drp_videoEncoder_SelectedIndexChanged);
//
// Label47
//
@@ -791,6 +795,7 @@ namespace Handbrake
this.drp_audioCodec.Size = new System.Drawing.Size(111, 21);
this.drp_audioCodec.TabIndex = 6;
this.drp_audioCodec.Text = "AAC";
+ this.drp_audioCodec.SelectedIndexChanged += new System.EventHandler(this.drp_audioCodec_SelectedIndexChanged);
//
// Label12
//
@@ -988,6 +993,7 @@ namespace Handbrake
this.drp_crop.Size = new System.Drawing.Size(123, 21);
this.drp_crop.TabIndex = 9;
this.drp_crop.Text = "No Crop";
+ this.drp_crop.SelectedIndexChanged += new System.EventHandler(this.drp_crop_SelectedIndexChanged);
//
// text_right
//
@@ -1075,6 +1081,7 @@ namespace Handbrake
this.check_largeFile.TabIndex = 51;
this.check_largeFile.Text = "Larger mp4 Files (> 4GB)";
this.check_largeFile.UseVisualStyleBackColor = true;
+ this.check_largeFile.Click += new System.EventHandler(this.check_largeFile_CheckedChanged);
//
// check_turbo
//
@@ -1086,6 +1093,7 @@ namespace Handbrake
this.check_turbo.TabIndex = 50;
this.check_turbo.Text = "Turbo 1st Pass";
this.check_turbo.UseVisualStyleBackColor = true;
+ this.check_turbo.Click += new System.EventHandler(this.check_turbo_CheckedChanged);
//
// Label36
//
@@ -1107,6 +1115,7 @@ namespace Handbrake
this.Check_ChapterMarkers.TabIndex = 48;
this.Check_ChapterMarkers.Text = "Chapter Markers";
this.Check_ChapterMarkers.UseVisualStyleBackColor = true;
+ this.Check_ChapterMarkers.CheckedChanged += new System.EventHandler(this.Check_ChapterMarkers_CheckedChanged);
//
// Label28
//
@@ -1148,6 +1157,7 @@ namespace Handbrake
this.CheckCRF.TabIndex = 44;
this.CheckCRF.Text = "Enable CRF";
this.CheckCRF.UseVisualStyleBackColor = true;
+ this.CheckCRF.Click += new System.EventHandler(this.CheckCRF_CheckedChanged);
//
// CheckPixelRatio
//
@@ -1159,6 +1169,7 @@ namespace Handbrake
this.CheckPixelRatio.TabIndex = 40;
this.CheckPixelRatio.Text = "Anamorphic PAR";
this.CheckPixelRatio.UseVisualStyleBackColor = true;
+ this.CheckPixelRatio.CheckedChanged += new System.EventHandler(this.CheckPixelRatio_CheckedChanged);
//
// Label23
//
@@ -1355,6 +1366,7 @@ namespace Handbrake
this.drp_audioMixDown.Size = new System.Drawing.Size(173, 21);
this.drp_audioMixDown.TabIndex = 50;
this.drp_audioMixDown.Text = "Automatic";
+ this.drp_audioMixDown.SelectedIndexChanged += new System.EventHandler(this.drp_audioMixDown_SelectedIndexChanged);
//
// drp_audioChannels
//
@@ -1372,6 +1384,17 @@ namespace Handbrake
this.drp_audioBitrate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.drp_audioBitrate.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.drp_audioBitrate.FormattingEnabled = true;
+ this.drp_audioBitrate.Items.AddRange(new object[] {
+ "32",
+ "40",
+ "48",
+ "56",
+ "64",
+ "80",
+ "86",
+ "112",
+ "128",
+ "160"});
this.drp_audioBitrate.Location = new System.Drawing.Point(157, 37);
this.drp_audioBitrate.Name = "drp_audioBitrate";
this.drp_audioBitrate.Size = new System.Drawing.Size(101, 21);
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index f20fb15dd..2abc7c7b3 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -141,6 +141,7 @@ namespace Handbrake
{
File_Open.ShowDialog();
}
+
private void mnu_save_Click(object sender, EventArgs e)
{
File_Save.ShowDialog();
@@ -373,6 +374,13 @@ namespace Handbrake
DVD_Save.ShowDialog();
text_destination.Text = DVD_Save.FileName;
+
+ if (Check_ChapterMarkers.CheckState.ToString() == "Checked")
+ {
+ string destination = text_destination.Text;
+ destination = destination.Replace(".mp4", ".m4v");
+ text_destination.Text = destination;
+ }
}
private void btn_h264Clear_Click(object sender, EventArgs e)
@@ -503,8 +511,241 @@ namespace Handbrake
System.Diagnostics.Process.Start("http://handbrake.m0k.org/trac/wiki/x264Options");
}
+ private void text_width_TextChanged(object sender, EventArgs e)
+ {
+ try
+ {
+ if (CheckPixelRatio.CheckState.ToString() == "Checked") {
+ text_width.Text = "";
+ } else {
+ if ((int.Parse(text_width.Text) % 16) != 0){
+ text_width.BackColor = Color.LightCoral;
+ }else {
+ text_width.BackColor = Color.LightGreen;
+ }
+ }
+
+ if (!lbl_Aspect.Text.Equals("Select a Title")){
+ int height = int.Parse(text_width.Text) / int.Parse(lbl_Aspect.Text);
+ int mod16 = height % 16;
+ height = height - mod16;
+ text_height.Text = height.ToString();
+ }
+
+ } catch(Exception){
+ }
+ }
+
+ private void text_height_TextChanged(object sender, EventArgs e)
+ {
+ try
+ {
+ if (CheckPixelRatio.CheckState.ToString() == "Checked")
+ {
+ text_height.Text = "";
+ }
+ else
+ {
+ if ((int.Parse(text_height.Text) % 16) != 0)
+ {
+ text_height.BackColor = Color.LightCoral;
+ }
+ else
+ {
+ text_height.BackColor = Color.LightGreen;
+ }
+ }
+ } catch(Exception){
+ }
+ }
+
+ private void drp_crop_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if ((string)drp_crop.SelectedItem == "Manual")
+ {
+ text_left.Enabled = true;
+ text_right.Enabled = true;
+ text_top.Enabled = true;
+ text_bottom.Enabled = true;
+ }
+ if ((string)drp_crop.SelectedItem == "Auto Crop")
+ {
+ text_left.Enabled = false;
+ text_right.Enabled = false;
+ text_top.Enabled = false;
+ text_bottom.Enabled = false;
+ text_left.Text = "";
+ text_right.Text = "";
+ text_top.Text = "";
+ text_bottom.Text = "";
+
+ if (lbl_RecomendedCrop.Text != "Select a Title")
+ {
+ string[] temp = new string[4];
+ temp = lbl_RecomendedCrop.Text.Split('/');
+ text_left.Text = temp[2];
+ text_right.Text = temp[3];
+ text_top.Text = temp[0];
+ text_bottom.Text = temp[1];
+ }
+ }
+
+ if ((string)drp_crop.SelectedItem == "No Crop")
+ {
+ text_left.Enabled = false;
+ text_right.Enabled = false;
+ text_top.Enabled = false;
+ text_bottom.Enabled = false;
+ text_left.Text = "0";
+ text_right.Text = "0";
+ text_top.Text = "0";
+ text_bottom.Text = "0";
+ }
+ }
+
+ private void CheckPixelRatio_CheckedChanged(object sender, EventArgs e)
+ {
+ text_width.Text = "";
+ text_height.Text = "";
+ text_width.BackColor = Color.White;
+ text_height.BackColor = Color.White;
+ }
+
+ private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (drp_dvdtitle.Items.Count == 1)
+ {
+ MessageBox.Show("There are no titles to select. Please scan the DVD by clicking the 'browse' button above before trying to select a title.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ }
+ }
+
+ private void drp_audioCodec_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ //CLI Audio mixdown Names: mono stereo dpl1 dpl2 6ch
+
+ drp_audioMixDown.Items.Clear();
+
+ if (drp_audioCodec.Text == "AAC")
+ {
+ drp_audioMixDown.Items.Add("Mono");
+ drp_audioMixDown.Items.Add("Stereo");
+ drp_audioMixDown.Items.Add("Dolby Surround");
+ drp_audioMixDown.Items.Add("Dolby Pro Logic II");
+ drp_audioMixDown.Items.Add("6 Channel Discrete");
+ drp_audioBitrate.Items.Clear();
+ drp_audioBitrate.Items.Add("32");
+ drp_audioBitrate.Items.Add("40");
+ drp_audioBitrate.Items.Add("48");
+ drp_audioBitrate.Items.Add("56");
+ drp_audioBitrate.Items.Add("64");
+ drp_audioBitrate.Items.Add("80");
+ drp_audioBitrate.Items.Add("86");
+ drp_audioBitrate.Items.Add("112");
+ drp_audioBitrate.Items.Add("128");
+ drp_audioBitrate.Items.Add("160");
+
+ }
+ else
+ {
+ drp_audioMixDown.Items.Add("Stereo");
+ drp_audioMixDown.Items.Add("Dolby Surround");
+ drp_audioMixDown.Items.Add("Dolby Pro Logic II");
+
+ drp_audioBitrate.Items.Clear();
+ drp_audioBitrate.Items.Add("32");
+ drp_audioBitrate.Items.Add("40");
+ drp_audioBitrate.Items.Add("48");
+ drp_audioBitrate.Items.Add("56");
+ drp_audioBitrate.Items.Add("64");
+ drp_audioBitrate.Items.Add("80");
+ drp_audioBitrate.Items.Add("86");
+ drp_audioBitrate.Items.Add("112");
+ drp_audioBitrate.Items.Add("128");
+ drp_audioBitrate.Items.Add("160");
+ drp_audioBitrate.Items.Add("192");
+ drp_audioBitrate.Items.Add("224");
+ drp_audioBitrate.Items.Add("256");
+ drp_audioBitrate.Items.Add("320");
+ drp_audioBitrate.Items.Add("384");
+ }
+ }
+
+ private void drp_audioMixDown_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (drp_audioCodec.Text == "AAC")
+ {
+ if (drp_audioMixDown.Text == "6 Channel Discrete")
+ {
+
+ drp_audioBitrate.Items.Clear();
+ drp_audioBitrate.Items.Add("32");
+ drp_audioBitrate.Items.Add("40");
+ drp_audioBitrate.Items.Add("48");
+ drp_audioBitrate.Items.Add("56");
+ drp_audioBitrate.Items.Add("64");
+ drp_audioBitrate.Items.Add("80");
+ drp_audioBitrate.Items.Add("86");
+ drp_audioBitrate.Items.Add("112");
+ drp_audioBitrate.Items.Add("128");
+ drp_audioBitrate.Items.Add("160");
+ drp_audioBitrate.Items.Add("192");
+ drp_audioBitrate.Items.Add("224");
+ drp_audioBitrate.Items.Add("256");
+ drp_audioBitrate.Items.Add("320");
+ drp_audioBitrate.Items.Add("384");
+ }
+ }
+ }
+
+ private void Check_ChapterMarkers_CheckedChanged(object sender, EventArgs e)
+ {
+ if (Check_ChapterMarkers.CheckState.ToString() == "Checked")
+ {
+ string destination = text_destination.Text;
+ destination = destination.Replace(".mp4", ".m4v");
+ text_destination.Text = destination;
+ }
+ }
+
+ private void check_largeFile_CheckedChanged(object sender, EventArgs e)
+ {
+ if (!text_destination.Text.Contains(".mp4"))
+ {
+ MessageBox.Show("This option is only compatible with the mp4 file container.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ check_largeFile.CheckState = CheckState.Unchecked;
+ }
+ }
+
+ private void check_turbo_CheckedChanged(object sender, EventArgs e)
+ {
+ if (!drp_videoEncoder.Text.Contains("H.264"))
+ {
+ MessageBox.Show("This option is only compatible with the H.264 encoder's", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ check_turbo.CheckState = CheckState.Unchecked;
+ }
+ }
+
+ private void drp_videoEncoder_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ //Turn off some options which are H.264 only when the user selects a non h.264 encoder
+ if (!drp_videoEncoder.Text.Contains("H.264"))
+ {
+ check_turbo.CheckState = CheckState.Unchecked;
+ CheckCRF.CheckState = CheckState.Unchecked;
+ }
+ }
+
+ private void CheckCRF_CheckedChanged(object sender, EventArgs e)
+ {
+ if (slider_videoQuality.Value == 0)
+ {
+ MessageBox.Show("This option is can only be used with the 'Video Quality' slider.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ CheckCRF.CheckState = CheckState.Unchecked;
+ }
+ }
//
// The Query Generation Function
@@ -942,11 +1183,8 @@ namespace Handbrake
// ----------------------------------------------------------------------
return querySource+ queryDestination+ queryPictureSettings+ queryVideoSettings+ h264Settings+ queryAudioSettings+ queryAdvancedSettings+ verbose;
- }
+ }
-
-
-
// This is the END of the road ------------------------------------------------------------------------------
}
diff --git a/win/C#/frmReadDVD.cs b/win/C#/frmReadDVD.cs
index 2ecff6fd5..378642d05 100644
--- a/win/C#/frmReadDVD.cs
+++ b/win/C#/frmReadDVD.cs
@@ -198,7 +198,7 @@ namespace Handbrake
private void btn_ok_Click(object sender, EventArgs e)
{
- start(inputFile);
+ scan(inputFile);
}