summaryrefslogtreecommitdiffstats
path: root/win/C#
diff options
context:
space:
mode:
authorsr55 <[email protected]>2007-07-09 18:41:29 +0000
committersr55 <[email protected]>2007-07-09 18:41:29 +0000
commit0c236a598e46f41cf6dd8f5961bdc687c3799dff (patch)
tree3e0d1f410cdbc3f5f654b9c858c02e112fa1c53a /win/C#
parent4a9e63938dd90a1ae640d9087daf24592fafb15f (diff)
WinGui:
- Just a few updated files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@662 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r--win/C#/HandBrakeCS.suobin32256 -> 32256 bytes
-rw-r--r--win/C#/Properties/Settings.Designer.cs12
-rw-r--r--win/C#/Properties/Settings.settings3
-rw-r--r--win/C#/app.config3
-rw-r--r--win/C#/frmMain.Designer.cs1
-rw-r--r--win/C#/frmMain.cs199
-rw-r--r--win/C#/frmReadDVD.cs39
7 files changed, 235 insertions, 22 deletions
diff --git a/win/C#/HandBrakeCS.suo b/win/C#/HandBrakeCS.suo
index 627f73aff..410d6a7aa 100644
--- a/win/C#/HandBrakeCS.suo
+++ b/win/C#/HandBrakeCS.suo
Binary files differ
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs
index 9a1c37c2c..a96ed9de5 100644
--- a/win/C#/Properties/Settings.Designer.cs
+++ b/win/C#/Properties/Settings.Designer.cs
@@ -489,5 +489,17 @@ namespace Handbrake.Properties {
this["VideoQuality"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string FullDVDInfo {
+ get {
+ return ((string)(this["FullDVDInfo"]));
+ }
+ set {
+ this["FullDVDInfo"] = value;
+ }
+ }
}
}
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings
index 312a01062..ed164b9a1 100644
--- a/win/C#/Properties/Settings.settings
+++ b/win/C#/Properties/Settings.settings
@@ -119,5 +119,8 @@
<Setting Name="VideoQuality" Type="System.Int32" Scope="User">
<Value Profile="(Default)" />
</Setting>
+ <Setting Name="FullDVDInfo" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
</Settings>
</SettingsFile> \ No newline at end of file
diff --git a/win/C#/app.config b/win/C#/app.config
index f2ae73783..bf268b661 100644
--- a/win/C#/app.config
+++ b/win/C#/app.config
@@ -121,6 +121,9 @@
<setting name="H264" serializeAs="String">
<value />
</setting>
+ <setting name="FullDVDInfo" serializeAs="String">
+ <value />
+ </setting>
</Handbrake.Properties.Settings>
</userSettings>
</configuration> \ No newline at end of file
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs
index 80c5d4bc9..cf31aecf1 100644
--- a/win/C#/frmMain.Designer.cs
+++ b/win/C#/frmMain.Designer.cs
@@ -242,6 +242,7 @@ namespace Handbrake
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);
+ this.drp_dvdtitle.Click += new System.EventHandler(this.drp_dvdtitle_Click);
//
// RadioISO
//
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 2abc7c7b3..70b8c48e3 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -6,6 +6,7 @@ using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
+using System.IO;
namespace Handbrake
{
@@ -139,12 +140,200 @@ namespace Handbrake
// FILE MENU --------------------------------------------------------------
private void mnu_open_Click(object sender, EventArgs e)
{
+ string filename;
File_Open.ShowDialog();
+ filename = File_Open.FileName;
+ if (filename != "")
+ {
+ try
+ {
+ // Create StreamReader & open file
+ StreamReader line = new StreamReader(filename);
+ string temporyLine; // Used for reading the line into a varible before processing on the checkState items below.
+
+ // Read in the data and set the correct GUI component with the setting.
+ text_source.Text = line.ReadLine();
+ drp_dvdtitle.Text = line.ReadLine();
+ drop_chapterStart.Text = line.ReadLine();
+ drop_chapterFinish.Text = line.ReadLine();
+ text_destination.Text = line.ReadLine();
+ drp_videoEncoder.Text = line.ReadLine();
+ drp_audioCodec.Text = line.ReadLine();
+ text_width.Text = line.ReadLine();
+ text_height.Text = line.ReadLine();
+ text_top.Text = line.ReadLine();
+ text_bottom.Text = line.ReadLine();
+ text_left.Text = line.ReadLine();
+ text_right.Text = line.ReadLine();
+ drp_subtitle.Text = line.ReadLine();
+ text_bitrate.Text = line.ReadLine();
+ text_filesize.Text = line.ReadLine();
+ slider_videoQuality.Value = int.Parse(line.ReadLine());
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ check_2PassEncode.CheckState = CheckState.Checked;
+ }
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ check_DeInterlace.CheckState = CheckState.Checked;
+ }
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ check_grayscale.CheckState = CheckState.Checked;
+ }
+
+ drp_videoFramerate.Text = line.ReadLine();
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ Check_ChapterMarkers.CheckState = CheckState.Checked;
+ }
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ CheckPixelRatio.CheckState = CheckState.Checked;
+ }
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ check_turbo.CheckState = CheckState.Checked;
+ }
+
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ check_largeFile.CheckState = CheckState.Checked;
+ }
+
+ drp_audioBitrate.Text = line.ReadLine();
+ drp_audioSampleRate.Text = line.ReadLine();
+ drp_audioChannels.Text = line.ReadLine();
+ drp_audioMixDown.Text = line.ReadLine();
+
+ // Advanced H264 Options
+ temporyLine = line.ReadLine();
+ if (temporyLine == "Checked")
+ {
+ CheckCRF.CheckState = CheckState.Checked;
+ }
+ rtf_h264advanced.Text = line.ReadLine();
+
+ // Close the stream
+ line.Close();
+
+
+ // Fix for SliderValue not appearing when Opening saved file
+ SliderValue.Text = slider_videoQuality.Value + "%";
+
+ } catch (Exception){
+ MessageBox.Show("Unable to load profile.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
+ }
+ }
}
private void mnu_save_Click(object sender, EventArgs e)
{
+ // Note : All these declarations are not really needed and should be removed at some point.
+ // The values can simply be added directly to the WriteLine statments.
+
+ //Source
+ string source = text_source.Text;
+ string dvdTitle = drp_dvdtitle.Text;
+ string ChapterStart = drop_chapterStart.Text;
+ string ChapterFinish = drop_chapterFinish.Text;
+ //Destination
+ string destination = text_destination.Text;
+ string videoEncoder = drp_videoEncoder.Text;
+ string audioEncoder = drp_audioCodec.Text;
+ string width = text_width.Text;
+ string height = text_height.Text;
+ //Picture Settings Tab
+ string cropTop = text_top.Text;
+ string cropBottom = text_bottom.Text;
+ string cropLeft = text_left.Text;
+ string cropRight = text_right.Text;
+ string subtitles = drp_subtitle.Text;
+ //Video Settings Tab
+ string videoBitrate = text_bitrate.Text;
+ string videoFilesize = text_filesize.Text;
+ string videoQuality = slider_videoQuality.Value.ToString();
+ string twoPassEncoding = check_2PassEncode.CheckState.ToString();
+ string deinterlace = check_DeInterlace.CheckState.ToString();
+ string grayscale = check_grayscale.CheckState.ToString();
+ string videoFramerate = drp_videoFramerate.Text;
+ string pixelRation = CheckPixelRatio.CheckState.ToString();
+ string ChapterMarkers = Check_ChapterMarkers.CheckState.ToString();
+ string turboH264 = check_turbo.CheckState.ToString();
+ string largeFile = check_largeFile.CheckState.ToString();
+ //Audio Settings Tab
+ string audioBitrate = drp_audioBitrate.Text;
+ string audioSampleRate = drp_audioSampleRate.Text;
+ string audioChannels = drp_audioChannels.Text;
+ string AudioMixDown = drp_audioMixDown.Text;
+ //H264 Tab
+ string CRF = CheckCRF.CheckState.ToString();
+ string advH264 = rtf_h264advanced.Text;
+
+ string filename;
File_Save.ShowDialog();
+ filename = File_Save.FileName;
+ if (filename != "")
+ {
+ try
+ {
+ // Create a StreamWriter and open the file
+ StreamWriter line = new StreamWriter(filename);
+
+ line.WriteLine(source);
+ line.WriteLine(dvdTitle);
+ line.WriteLine(ChapterStart);
+ line.WriteLine(ChapterFinish);
+ line.WriteLine(destination);
+ line.WriteLine(videoEncoder);
+ line.WriteLine(audioEncoder);
+ line.WriteLine(width);
+ line.WriteLine(height);
+ line.WriteLine(cropTop);
+ line.WriteLine(cropBottom);
+ line.WriteLine(cropLeft);
+ line.WriteLine(cropRight);
+ line.WriteLine(subtitles);
+ line.WriteLine(videoBitrate);
+ line.WriteLine(videoFilesize);
+ line.WriteLine(videoQuality);
+ line.WriteLine(twoPassEncoding);
+ line.WriteLine(deinterlace);
+ line.WriteLine(grayscale);
+ line.WriteLine(videoFramerate);
+ line.WriteLine(ChapterMarkers);
+ line.WriteLine(pixelRation);
+ line.WriteLine(turboH264);
+ line.WriteLine(largeFile);
+ line.WriteLine(audioBitrate);
+ line.WriteLine(audioSampleRate);
+ line.WriteLine(audioChannels);
+ line.WriteLine(AudioMixDown);
+ line.WriteLine(CRF);
+ line.WriteLine(advH264);
+ // close the stream
+ line.Close();
+ MessageBox.Show("Your profile has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ }
+ catch(Exception)
+ {
+ MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
+ }
+
+ }
}
private void mnu_update_Click(object sender, EventArgs e)
@@ -613,7 +802,7 @@ namespace Handbrake
text_height.BackColor = Color.White;
}
- private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
+ private void drp_dvdtitle_Click(object sender, EventArgs e)
{
if (drp_dvdtitle.Items.Count == 1)
{
@@ -747,6 +936,11 @@ namespace Handbrake
}
}
+ private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ //TODO: Convert the Parsing Code.
+ }
+
//
// The Query Generation Function
//
@@ -1183,8 +1377,7 @@ 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 378642d05..23be024b8 100644
--- a/win/C#/frmReadDVD.cs
+++ b/win/C#/frmReadDVD.cs
@@ -75,13 +75,13 @@ namespace Handbrake
if (line.Contains("exited.")){
subtitlePointer = false;
fullTitleData = titleData.Trim() + " ~ " + duationData.Trim() + " ~ " + sizeData.Trim() + " ~ " + cropdata.Trim() + " ~ " + chatperData.Trim() + " ~ " + audioData.Trim() + " ~ " + subtitleData.Trim();
- add(fullTitleData);
+ add(fullTitleData, titleData, duationData);
counter++;
}else if (line.Contains("+ title")){
if (titleData != "") {
subtitlePointer = true;
fullTitleData = titleData.Trim() + " ~ " + duationData.Trim() + " ~ " + sizeData.Trim() + " ~ " + cropdata.Trim() + " ~ " + chatperData.Trim() + " ~ " + audioData.Trim() + " ~ " + subtitleData.Trim();
- add(fullTitleData);
+ add(fullTitleData, titleData, duationData);
counter = counter + 1;
}
titleData = line;
@@ -172,30 +172,31 @@ namespace Handbrake
}
}
- public void add(string titleData)
+ public void add(string fullTitleData, string titleData, string durationData)
{
- string[] titleInfo = new string[10];
- string[] str = new string[1];
- string title;
- string t ="";
- string d ="";
-
- titleInfo = titleData.Split('~');
try
{
- t = titleInfo[0].Trim().Substring(8).Replace(":", ""); // Title
- d = titleInfo[1].Trim().Substring(12); //Duration
- } catch(Exception){
- MessageBox.Show("Incomplete DVD data found. Please copy the data on the View DVD Information tab and report this error.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
+ string t = titleData.Trim().Substring(8).Replace(":", "");
+ string d = durationData.Trim().Substring(12);
+
+ // Lets store the captured full title data as a string in the programs settings file.
+ // This can then be used by the DVD title dropdown menu to populate other fields.
+
+ Properties.Settings.Default.FullDVDInfo = Properties.Settings.Default.FullDVDInfo + " \n " + fullTitleData;
- //Now lets add the info to the main form dropdowns
- frmMain form = (frmMain)frmMain.ActiveForm;
- title = t + " " + " " + d + " ";
- form.drp_dvdtitle.Items.Add(title);
+ //Now lets add the info to the main form dropdowns
+ frmMain form = (frmMain)frmMain.ActiveForm;
+ string title = t + " " + " " + d + " ";
+ form.drp_dvdtitle.Items.Add(title);
+ }
+ catch (Exception)
+ {
+ // Don't really need to do anything about it.
+ }
}
+
private void btn_ok_Click(object sender, EventArgs e)
{
scan(inputFile);