diff options
-rw-r--r-- | win/C#/Functions/Common.cs | 48 | ||||
-rw-r--r-- | win/C#/Program.cs | 2 | ||||
-rw-r--r-- | win/C#/frmMain.Designer.cs | 28 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 5 | ||||
-rw-r--r-- | win/C#/frmMain.resx | 6 |
5 files changed, 62 insertions, 27 deletions
diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs index 4c3e47dcb..ebeb0c9c6 100644 --- a/win/C#/Functions/Common.cs +++ b/win/C#/Functions/Common.cs @@ -714,20 +714,46 @@ namespace Handbrake.Functions string ChapterMarkers = "";
+ // Attach Source name and dvd title to the start of the chapters.csv filename.
+ // This is for the queue. It allows different chapter name files for each title.
+ string source_name = mainWindow.text_source.Text;
+ string[] sourceName = source.Split('\\');
+ source_name = sourceName[sourceName.Length - 1].Replace(".iso", "").Replace(".mpg", "").Replace(".ts", "").Replace(".ps", "");
+ source_name = source_name.Replace("\"", "");
+
+ string source_title = mainWindow.drp_dvdtitle.Text;
+ string[] titlesplit = source_title.Split(' ');
+ source_title = titlesplit[0];
+
if (mainWindow.Check_ChapterMarkers.Checked)
{
- Boolean saveCSV = chapterCSVSave(mainWindow);
- if (saveCSV == false)
+
+ if (source_name != "Click 'Browse' to continue")
{
- MessageBox.Show("Unable to save Chapter Makrers file! \n Chapter marker names will NOT be saved in your encode \n\n", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- ChapterMarkers = " -m ";
+ if (source_title != "Automatic")
+ {
+ string filename = source_name + "-" + source_title + "-chapters.csv";
+ string path = Path.Combine(Path.GetTempPath(), filename);
+
+ Boolean saveCSV = chapterCSVSave(mainWindow, path);
+ if (saveCSV == false)
+ ChapterMarkers = " -m ";
+ else
+ {
+ ChapterMarkers = " --markers=" + "\"" + path + "\"";
+ }
+ }
+ else
+ {
+ string path = Path.Combine(Path.GetTempPath(), "chapters.csv");
+ ChapterMarkers = " --markers=" + "\"" + path + "\"";
+ }
}
else
{
string path = Path.Combine(Path.GetTempPath(), "chapters.csv");
-
ChapterMarkers = " --markers=" + "\"" + path + "\"";
- }
+ }
}
string chapter_markers = ChapterMarkers;
@@ -807,12 +833,10 @@ namespace Handbrake.Functions * This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv in this applications
* running directory.
*/
- private Boolean chapterCSVSave(frmMain mainWindow)
+ private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)
{
try
- {
- string path = Path.Combine(Path.GetTempPath(), "chapters.csv");
-
+ {
StringBuilder csv = new StringBuilder();
foreach (DataGridViewRow row in mainWindow.data_chpt.Rows)
@@ -822,7 +846,7 @@ namespace Handbrake.Functions csv.Append(row.Cells[1].Value.ToString());
csv.Append(Environment.NewLine);
}
- StreamWriter file = new StreamWriter(path);
+ StreamWriter file = new StreamWriter(file_path_name);
file.Write(csv.ToString());
file.Close();
file.Dispose();
@@ -831,7 +855,7 @@ namespace Handbrake.Functions }
catch (Exception exc)
{
- MessageBox.Show(exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
}
diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 5f3b9464a..fb5507cc2 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -32,7 +32,7 @@ namespace Handbrake {
// Development Code Expiry.
// Remember to comment out on public release!!!
- if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; }
+ //if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; }
// Check the system meets the system requirements.
Boolean launch = true;
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 5c014d518..a08aab3d5 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -37,7 +37,7 @@ namespace Handbrake this.components = new System.ComponentModel.Container();
System.Windows.Forms.Label Label38;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();
this.File_Save = new System.Windows.Forms.SaveFileDialog();
this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
@@ -202,6 +202,7 @@ namespace Handbrake this.btn_ActivityWindow = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+ this.lbl_warn_chapt = new System.Windows.Forms.Label();
Label38 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.slider_drc)).BeginInit();
@@ -323,6 +324,7 @@ namespace Handbrake this.text_destination.Size = new System.Drawing.Size(429, 21);
this.text_destination.TabIndex = 1;
this.ToolTip.SetToolTip(this.text_destination, "Location where the encoded file will be saved.");
+ this.text_destination.TextChanged += new System.EventHandler(this.text_destination_TextChanged);
//
// btn_Browse
//
@@ -1664,8 +1666,7 @@ namespace Handbrake "None",
"Fast",
"Slow",
- "Slower",
- "Slowest"});
+ "Slower"});
this.drp_deInterlace_option.Location = new System.Drawing.Point(413, 190);
this.drp_deInterlace_option.Name = "drp_deInterlace_option";
this.drp_deInterlace_option.Size = new System.Drawing.Size(161, 21);
@@ -1819,6 +1820,7 @@ namespace Handbrake // tab_chapters
//
this.tab_chapters.BackColor = System.Drawing.SystemColors.ControlLight;
+ this.tab_chapters.Controls.Add(this.lbl_warn_chapt);
this.tab_chapters.Controls.Add(this.label31);
this.tab_chapters.Controls.Add(this.data_chpt);
this.tab_chapters.Controls.Add(this.Check_ChapterMarkers);
@@ -1848,16 +1850,16 @@ namespace Handbrake this.data_chpt.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.number,
this.name});
- this.data_chpt.Location = new System.Drawing.Point(16, 55);
+ this.data_chpt.Location = new System.Drawing.Point(16, 72);
this.data_chpt.Name = "data_chpt";
- this.data_chpt.Size = new System.Drawing.Size(607, 199);
+ this.data_chpt.Size = new System.Drawing.Size(607, 182);
this.data_chpt.TabIndex = 2;
//
// number
//
- dataGridViewCellStyle3.Format = "N0";
- dataGridViewCellStyle3.NullValue = null;
- this.number.DefaultCellStyle = dataGridViewCellStyle3;
+ dataGridViewCellStyle1.Format = "N0";
+ dataGridViewCellStyle1.NullValue = null;
+ this.number.DefaultCellStyle = dataGridViewCellStyle1;
this.number.HeaderText = "Chapter Number";
this.number.MaxInputLength = 3;
this.number.Name = "number";
@@ -2159,6 +2161,15 @@ namespace Handbrake this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(6, 39);
//
+ // lbl_warn_chapt
+ //
+ this.lbl_warn_chapt.AutoSize = true;
+ this.lbl_warn_chapt.Location = new System.Drawing.Point(13, 52);
+ this.lbl_warn_chapt.Name = "lbl_warn_chapt";
+ this.lbl_warn_chapt.Size = new System.Drawing.Size(394, 13);
+ this.lbl_warn_chapt.TabIndex = 23;
+ this.lbl_warn_chapt.Text = "Please make sure you have selected a DVD tile in the \"Source\" box";
+ //
// frmMain
//
this.AllowDrop = true;
@@ -2383,6 +2394,7 @@ namespace Handbrake private System.Windows.Forms.ToolStripButton btn_ActivityWindow;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolTip toolTip1;
+ private System.Windows.Forms.Label lbl_warn_chapt;
}
}
\ No newline at end of file diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 034a8a9d5..ce55b615d 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1212,6 +1212,11 @@ namespace Handbrake #endregion
+ private void text_destination_TextChanged(object sender, EventArgs e)
+ {
+
+ }
+
// This is the END of the road ------------------------------------------------------------------------------
diff --git a/win/C#/frmMain.resx b/win/C#/frmMain.resx index e4500ad20..4d4ebc0ac 100644 --- a/win/C#/frmMain.resx +++ b/win/C#/frmMain.resx @@ -189,12 +189,6 @@ Best used in conjunction with forced subtitles.</value> <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
- <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>731, 18</value>
</metadata>
|