this.tabPage1 = new System.Windows.Forms.TabPage();\r
this.tabPage2 = new System.Windows.Forms.TabPage();\r
this.SRTGroup = new System.Windows.Forms.GroupBox();\r
+ this.check_default_srt = new System.Windows.Forms.CheckBox();\r
this.srt_offset = new System.Windows.Forms.NumericUpDown();\r
this.label5 = new System.Windows.Forms.Label();\r
this.srt_browse = new System.Windows.Forms.Button();\r
this.srt_lang = new System.Windows.Forms.ComboBox();\r
this.btn_srtAdd = new System.Windows.Forms.Button();\r
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();\r
- this.check_default_srt = new System.Windows.Forms.CheckBox();\r
+ this.label6 = new System.Windows.Forms.Label();\r
this.SubTitlesGroup.SuspendLayout();\r
this.subMenu.SuspendLayout();\r
this.tabControl1.SuspendLayout();\r
this.lv_subList.Name = "lv_subList";\r
this.lv_subList.Size = new System.Drawing.Size(688, 131);\r
this.lv_subList.TabIndex = 70;\r
- //this.lv_subList.UseCompatibleStateImageBehavior = false;\r
+ this.lv_subList.UseCompatibleStateImageBehavior = false;\r
this.lv_subList.View = System.Windows.Forms.View.Details;\r
this.lv_subList.SelectedIndexChanged += new System.EventHandler(this.lb_subList_SelectedIndexChanged);\r
// \r
// SRTGroup\r
// \r
this.SRTGroup.BackColor = System.Drawing.Color.Transparent;\r
+ this.SRTGroup.Controls.Add(this.label6);\r
this.SRTGroup.Controls.Add(this.check_default_srt);\r
this.SRTGroup.Controls.Add(this.srt_offset);\r
this.SRTGroup.Controls.Add(this.label5);\r
this.SRTGroup.TabStop = false;\r
this.SRTGroup.Text = "Selected Track: New Track";\r
// \r
+ // check_default_srt\r
+ // \r
+ this.check_default_srt.AutoSize = true;\r
+ this.check_default_srt.Location = new System.Drawing.Point(491, 22);\r
+ this.check_default_srt.Name = "check_default_srt";\r
+ this.check_default_srt.Size = new System.Drawing.Size(61, 17);\r
+ this.check_default_srt.TabIndex = 80;\r
+ this.check_default_srt.Text = "Default";\r
+ this.check_default_srt.UseVisualStyleBackColor = true;\r
+ this.check_default_srt.CheckedChanged += new System.EventHandler(this.check_default_srt_CheckedChanged);\r
+ // \r
// srt_offset\r
// \r
+ this.srt_offset.Increment = new decimal(new int[] {\r
+ 10,\r
+ 0,\r
+ 0,\r
+ 0});\r
this.srt_offset.Location = new System.Drawing.Point(402, 20);\r
+ this.srt_offset.Maximum = new decimal(new int[] {\r
+ 1000000000,\r
+ 0,\r
+ 0,\r
+ 0});\r
this.srt_offset.Name = "srt_offset";\r
this.srt_offset.Size = new System.Drawing.Size(58, 21);\r
this.srt_offset.TabIndex = 79;\r
this.openFileDialog.DefaultExt = "srt";\r
this.openFileDialog.Filter = "SRT Files |*.srt";\r
// \r
- // check_default_srt\r
+ // label6\r
// \r
- this.check_default_srt.AutoSize = true;\r
- this.check_default_srt.Location = new System.Drawing.Point(470, 22);\r
- this.check_default_srt.Name = "check_default_srt";\r
- this.check_default_srt.Size = new System.Drawing.Size(61, 17);\r
- this.check_default_srt.TabIndex = 80;\r
- this.check_default_srt.Text = "Default";\r
- this.check_default_srt.UseVisualStyleBackColor = true;\r
- this.check_default_srt.CheckedChanged += new System.EventHandler(this.check_default_srt_CheckedChanged);\r
+ this.label6.AutoSize = true;\r
+ this.label6.Location = new System.Drawing.Point(466, 23);\r
+ this.label6.Name = "label6";\r
+ this.label6.Size = new System.Drawing.Size(20, 13);\r
+ this.label6.TabIndex = 81;\r
+ this.label6.Text = "ms";\r
// \r
// Subtitles\r
// \r
private System.Windows.Forms.NumericUpDown srt_offset;\r
private System.Windows.Forms.OpenFileDialog openFileDialog;\r
private System.Windows.Forms.CheckBox check_default_srt;\r
+ private System.Windows.Forms.Label label6;\r
}\r
}\r
return dataChpt;\r
}\r
\r
+ public static DataGridView importChapterNames(DataGridView dataChpt, string filename)\r
+ {\r
+ IDictionary<int, string> chapterMap = new Dictionary<int, string>();\r
+ try\r
+ {\r
+ StreamReader sr = new StreamReader(filename);\r
+ string csv = sr.ReadLine();\r
+ while (csv != null)\r
+ {\r
+ if (csv.Trim() != "")\r
+ {\r
+ string[] contents = csv.Split(',');\r
+ int chapter;\r
+ int.TryParse(contents[0], out chapter);\r
+ chapterMap.Add(chapter, contents[1]);\r
+ }\r
+ csv = sr.ReadLine();\r
+ }\r
+ }\r
+ catch (Exception)\r
+ {\r
+ return null;\r
+ }\r
+\r
+ foreach (DataGridViewRow item in dataChpt.Rows)\r
+ {\r
+ string name;\r
+ chapterMap.TryGetValue((int)item.Cells[0].Value, out name);\r
+ item.Cells[1].Value = name ?? "Chapter " + item.Cells[0].Value;\r
+ }\r
+\r
+ return dataChpt;\r
+ }\r
+\r
/// <summary>\r
/// Function which generates the filename and path automatically based on \r
/// the Source Name, DVD title and DVD Chapters\r
this.components = new System.ComponentModel.Container();\r
System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
this.ToolTip = new System.Windows.Forms.ToolTip(this.components);\r
this.mnu_delete_preset = new System.Windows.Forms.ToolStripMenuItem();\r
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();\r
this.btn_new_preset = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_importMacPreset = new System.Windows.Forms.ToolStripMenuItem();\r
this.mnu_SelectDefault = new System.Windows.Forms.ToolStripMenuItem();\r
this.HelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
this.mnu_user_guide = new System.Windows.Forms.ToolStripMenuItem();\r
this.labelSource = new System.Windows.Forms.Label();\r
this.labelStaticSource = new System.Windows.Forms.Label();\r
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\r
- this.mnu_importMacPreset = new System.Windows.Forms.ToolStripMenuItem();\r
this.openPreset = new System.Windows.Forms.OpenFileDialog();\r
+ this.btn_importChapters = new System.Windows.Forms.Button();\r
this.PictureSettings = new Handbrake.Controls.PictureSettings();\r
this.Filters = new Handbrake.Controls.Filters();\r
this.AudioSettings = new Handbrake.Controls.AudioPanel();\r
this.Subtitles = new Handbrake.Controls.Subtitles();\r
this.x264Panel = new Handbrake.Controls.x264Panel();\r
+ this.File_ChapterImport = new System.Windows.Forms.OpenFileDialog();\r
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
notifyIconMenu.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
// \r
// number\r
// \r
- dataGridViewCellStyle3.Format = "N0";\r
- dataGridViewCellStyle3.NullValue = null;\r
- this.number.DefaultCellStyle = dataGridViewCellStyle3;\r
+ dataGridViewCellStyle1.Format = "N0";\r
+ dataGridViewCellStyle1.NullValue = null;\r
+ this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
this.number.Frozen = true;\r
this.number.HeaderText = "Chapter Number";\r
this.number.MaxInputLength = 3;\r
this.btn_new_preset.Text = "New Preset";\r
this.btn_new_preset.Click += new System.EventHandler(this.btn_new_preset_Click);\r
// \r
+ // mnu_importMacPreset\r
+ // \r
+ this.mnu_importMacPreset.Name = "mnu_importMacPreset";\r
+ this.mnu_importMacPreset.Size = new System.Drawing.Size(194, 22);\r
+ this.mnu_importMacPreset.Text = "Import";\r
+ this.mnu_importMacPreset.Click += new System.EventHandler(this.mnu_importMacPreset_Click);\r
+ // \r
// mnu_SelectDefault\r
// \r
this.mnu_SelectDefault.Name = "mnu_SelectDefault";\r
// tab_chapters\r
// \r
this.tab_chapters.BackColor = System.Drawing.Color.Transparent;\r
+ this.tab_chapters.Controls.Add(this.btn_importChapters);\r
this.tab_chapters.Controls.Add(this.label31);\r
this.tab_chapters.Controls.Add(this.data_chpt);\r
this.tab_chapters.Controls.Add(this.Check_ChapterMarkers);\r
this.tableLayoutPanel2.Name = "tableLayoutPanel2";\r
this.tableLayoutPanel2.RowCount = 1;\r
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F));\r
this.tableLayoutPanel2.Size = new System.Drawing.Size(723, 29);\r
this.tableLayoutPanel2.TabIndex = 50;\r
// \r
this.flowLayoutPanel1.Size = new System.Drawing.Size(195, 13);\r
this.flowLayoutPanel1.TabIndex = 55;\r
// \r
- // mnu_importMacPreset\r
- // \r
- this.mnu_importMacPreset.Name = "mnu_importMacPreset";\r
- this.mnu_importMacPreset.Size = new System.Drawing.Size(194, 22);\r
- this.mnu_importMacPreset.Text = "Import";\r
- this.mnu_importMacPreset.Click += new System.EventHandler(this.mnu_importMacPreset_Click);\r
- // \r
// openPreset\r
// \r
this.openPreset.DefaultExt = "plist";\r
this.openPreset.Filter = "Plist Files|*.plist";\r
// \r
+ // btn_importChapters\r
+ // \r
+ this.btn_importChapters.AutoSize = true;\r
+ this.btn_importChapters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.btn_importChapters.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+ this.btn_importChapters.Location = new System.Drawing.Point(625, 26);\r
+ this.btn_importChapters.Name = "btn_importChapters";\r
+ this.btn_importChapters.Size = new System.Drawing.Size(75, 23);\r
+ this.btn_importChapters.TabIndex = 14;\r
+ this.btn_importChapters.Text = "Import";\r
+ this.btn_importChapters.UseVisualStyleBackColor = true;\r
+ this.btn_importChapters.Click += new System.EventHandler(this.btn_importChapters_Click);\r
+ // \r
// PictureSettings\r
// \r
this.PictureSettings.BackColor = System.Drawing.Color.Transparent;\r
this.x264Panel.TabIndex = 0;\r
this.x264Panel.x264Query = "";\r
// \r
+ // File_ChapterImport\r
+ // \r
+ this.File_ChapterImport.Filter = "CSV Files|*.csv";\r
+ // \r
// frmMain\r
// \r
this.AllowDrop = true;\r
private FlowLayoutPanel flowLayoutPanel1;\r
private ToolStripMenuItem mnu_importMacPreset;\r
private OpenFileDialog openPreset;\r
+ private Button btn_importChapters;\r
+ private OpenFileDialog File_ChapterImport;\r
}\r
}
\ No newline at end of file
setExtension(".m4v");\r
data_chpt.Rows.Clear();\r
data_chpt.Enabled = true;\r
+ btn_importChapters.Enabled = true;\r
DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
if (chapterGridView != null)\r
data_chpt = chapterGridView;\r
setExtension(".mp4");\r
data_chpt.Rows.Clear();\r
data_chpt.Enabled = false;\r
+ btn_importChapters.Enabled = false;\r
+ }\r
+ }\r
+ private void btn_importChapters_Click(object sender, EventArgs e)\r
+ {\r
+ if (File_ChapterImport.ShowDialog() == DialogResult.OK)\r
+ {\r
+ String filename = File_ChapterImport.FileName;\r
+ DataGridView imported = Main.importChapterNames(data_chpt, filename);\r
+ if (imported != null)\r
+ data_chpt = imported;\r
}\r
}\r
\r
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
<value>98</value>\r
</metadata>\r
- <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>664, 15</value>\r
- </metadata>\r
- <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>680, 54</value>\r
- </metadata>\r
- <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
- <value>98</value>\r
- </metadata>\r
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
<value>\r
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r
AAD6AQAA4AEAAMABAACAAQAAgAEAAMBBAADAYQAAjGEAAIRhAADc+wAA3/8AAA==\r
</value>\r
</data>\r
+ <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+ <value>664, 15</value>\r
+ </metadata>\r
+ <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+ <value>680, 54</value>\r
+ </metadata>\r
+ <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+ <value>787, 54</value>\r
+ </metadata>\r
</root>
\ No newline at end of file