summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2007-07-03 11:41:41 +0000
committersr55 <[email protected]>2007-07-03 11:41:41 +0000
commit5ceeadd648a9952506bd3e166d9fdba1ae2b4da4 (patch)
tree84d1c74262fd8b1082dc0a34ad4d123913836194 /win
parentaca5e29f6beb1731a651fcfa763c889305ee98e5 (diff)
WinGui:
- Re-wrote bits of frmReadDVD to fix a bug where DVD's with only 1 title would not be listed in the DVD title dropdown. Also cleaned the code up a bit. Hopefully this re-write doesn't have too many bugs. Initial testing shows it appears to work fine.WinGui: - Changed shell() to System.Diagnostics.Process.Start() Appears to work a bit better than shell() - Removed Advanced Settings Tab. Processor selection is now in Tools > Options. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@647 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/Handbrake/My Project/Settings.Designer.vb2
-rw-r--r--win/Handbrake/My Project/Settings.settings2
-rw-r--r--win/Handbrake/app.config2
-rw-r--r--win/Handbrake/frmMain.Designer.vb70
-rw-r--r--win/Handbrake/frmMain.resx9
-rw-r--r--win/Handbrake/frmMain.vb16
-rw-r--r--win/Handbrake/frmOptions.Designer.vb49
-rw-r--r--win/Handbrake/frmOptions.vb9
-rw-r--r--win/Handbrake/frmReadDVD.vb260
9 files changed, 194 insertions, 225 deletions
diff --git a/win/Handbrake/My Project/Settings.Designer.vb b/win/Handbrake/My Project/Settings.Designer.vb
index 7c1a128a5..7cb65f961 100644
--- a/win/Handbrake/My Project/Settings.Designer.vb
+++ b/win/Handbrake/My Project/Settings.Designer.vb
@@ -368,7 +368,7 @@ Namespace My
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
- Global.System.Configuration.DefaultSettingValueAttribute("")> _
+ Global.System.Configuration.DefaultSettingValueAttribute("Automatic")> _
Public Property Processors() As String
Get
Return CType(Me("Processors"),String)
diff --git a/win/Handbrake/My Project/Settings.settings b/win/Handbrake/My Project/Settings.settings
index c8afbbd0f..1195a26f8 100644
--- a/win/Handbrake/My Project/Settings.settings
+++ b/win/Handbrake/My Project/Settings.settings
@@ -81,7 +81,7 @@
<Value Profile="(Default)" />
</Setting>
<Setting Name="Processors" Type="System.String" Scope="User">
- <Value Profile="(Default)" />
+ <Value Profile="(Default)">Automatic</Value>
</Setting>
<Setting Name="Subtitles" Type="System.String" Scope="User">
<Value Profile="(Default)" />
diff --git a/win/Handbrake/app.config b/win/Handbrake/app.config
index 294349892..6f69f12a6 100644
--- a/win/Handbrake/app.config
+++ b/win/Handbrake/app.config
@@ -108,7 +108,7 @@
<value />
</setting>
<setting name="Processors" serializeAs="String">
- <value />
+ <value>Automatic</value>
</setting>
<setting name="Subtitles" serializeAs="String">
<value />
diff --git a/win/Handbrake/frmMain.Designer.vb b/win/Handbrake/frmMain.Designer.vb
index 2fb8178cd..43cdc2510 100644
--- a/win/Handbrake/frmMain.Designer.vb
+++ b/win/Handbrake/frmMain.Designer.vb
@@ -90,10 +90,6 @@ Partial Class frmMain
Me.Label90 = New System.Windows.Forms.Label
Me.rtf_h264advanced = New System.Windows.Forms.RichTextBox
Me.Label92 = New System.Windows.Forms.Label
- Me.TabPage4 = New System.Windows.Forms.TabPage
- Me.drp_processors = New System.Windows.Forms.ComboBox
- Me.Label6 = New System.Windows.Forms.Label
- Me.Label11 = New System.Windows.Forms.Label
Me.TabPage2 = New System.Windows.Forms.TabPage
Me.Label29 = New System.Windows.Forms.Label
Me.drp_audioMixDown = New System.Windows.Forms.ComboBox
@@ -237,7 +233,6 @@ Partial Class frmMain
Me.GroupBox4.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.h264Tab.SuspendLayout()
- Me.TabPage4.SuspendLayout()
Me.TabPage2.SuspendLayout()
Me.TabPage3.SuspendLayout()
CType(Me.slider_videoQuality, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -898,51 +893,6 @@ Partial Class frmMain
Me.Label92.Text = "Specify advanced x264 options in the same style as mencoder:" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "option1=value1:opti" & _
"on2=value2"
'
- 'TabPage4
- '
- Me.TabPage4.BackColor = System.Drawing.SystemColors.Control
- Me.TabPage4.Controls.Add(Me.drp_processors)
- Me.TabPage4.Controls.Add(Me.Label6)
- Me.TabPage4.Controls.Add(Me.Label11)
- Me.TabPage4.Location = New System.Drawing.Point(4, 22)
- Me.TabPage4.Name = "TabPage4"
- Me.TabPage4.Padding = New System.Windows.Forms.Padding(3)
- Me.TabPage4.Size = New System.Drawing.Size(639, 268)
- Me.TabPage4.TabIndex = 4
- Me.TabPage4.Text = "Advanced Settings"
- '
- 'drp_processors
- '
- Me.drp_processors.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.drp_processors.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.drp_processors.FormattingEnabled = True
- Me.drp_processors.Items.AddRange(New Object() {"Automatic", "1", "2", "3", "4", "5", "6", "7", "8"})
- Me.drp_processors.Location = New System.Drawing.Point(117, 38)
- Me.drp_processors.Name = "drp_processors"
- Me.drp_processors.Size = New System.Drawing.Size(111, 21)
- Me.drp_processors.TabIndex = 39
- Me.drp_processors.Text = "Automatic"
- '
- 'Label6
- '
- Me.Label6.AutoSize = True
- Me.Label6.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Label6.Location = New System.Drawing.Point(13, 13)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(138, 13)
- Me.Label6.TabIndex = 37
- Me.Label6.Text = "Processor Detection"
- '
- 'Label11
- '
- Me.Label11.AutoSize = True
- Me.Label11.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Label11.Location = New System.Drawing.Point(13, 41)
- Me.Label11.Name = "Label11"
- Me.Label11.Size = New System.Drawing.Size(97, 13)
- Me.Label11.TabIndex = 14
- Me.Label11.Text = "No. Processors:"
- '
'TabPage2
'
Me.TabPage2.BackColor = System.Drawing.SystemColors.Control
@@ -1575,7 +1525,6 @@ Partial Class frmMain
Me.advancedOptions.Controls.Add(Me.TabPage1)
Me.advancedOptions.Controls.Add(Me.TabPage3)
Me.advancedOptions.Controls.Add(Me.TabPage2)
- Me.advancedOptions.Controls.Add(Me.TabPage4)
Me.advancedOptions.Controls.Add(Me.h264Tab)
Me.advancedOptions.Controls.Add(Me.TabPage6)
Me.advancedOptions.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
@@ -1616,10 +1565,11 @@ Partial Class frmMain
Me.Label39.AutoSize = True
Me.Label39.Location = New System.Drawing.Point(13, 34)
Me.Label39.Name = "Label39"
- Me.Label39.Size = New System.Drawing.Size(331, 26)
+ Me.Label39.Size = New System.Drawing.Size(403, 39)
Me.Label39.TabIndex = 40
Me.Label39.Text = "Here you can alter the query generated by the program." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Click the ""Generate Query" & _
- " Now"" button to continue."
+ " Now"" button to continue." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Remember to re-generate the query each time you chang" & _
+ "e a setting!"
'
'btn_ClearQuery
'
@@ -1627,7 +1577,7 @@ Partial Class frmMain
Me.btn_ClearQuery.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_ClearQuery.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btn_ClearQuery.ForeColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(0, Byte), Integer))
- Me.btn_ClearQuery.Location = New System.Drawing.Point(542, 73)
+ Me.btn_ClearQuery.Location = New System.Drawing.Point(542, 84)
Me.btn_ClearQuery.Name = "btn_ClearQuery"
Me.btn_ClearQuery.Size = New System.Drawing.Size(79, 23)
Me.btn_ClearQuery.TabIndex = 39
@@ -1640,7 +1590,7 @@ Partial Class frmMain
Me.GenerateQuery.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.GenerateQuery.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GenerateQuery.ForeColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(0, Byte), Integer))
- Me.GenerateQuery.Location = New System.Drawing.Point(16, 73)
+ Me.GenerateQuery.Location = New System.Drawing.Point(16, 84)
Me.GenerateQuery.Name = "GenerateQuery"
Me.GenerateQuery.Size = New System.Drawing.Size(176, 23)
Me.GenerateQuery.TabIndex = 38
@@ -1650,9 +1600,9 @@ Partial Class frmMain
'QueryEditorText
'
Me.QueryEditorText.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.QueryEditorText.Location = New System.Drawing.Point(16, 102)
+ Me.QueryEditorText.Location = New System.Drawing.Point(16, 114)
Me.QueryEditorText.Name = "QueryEditorText"
- Me.QueryEditorText.Size = New System.Drawing.Size(605, 139)
+ Me.QueryEditorText.Size = New System.Drawing.Size(605, 127)
Me.QueryEditorText.TabIndex = 41
Me.QueryEditorText.Text = ""
'
@@ -2383,8 +2333,6 @@ Partial Class frmMain
Me.GroupBox1.PerformLayout()
Me.h264Tab.ResumeLayout(False)
Me.h264Tab.PerformLayout()
- Me.TabPage4.ResumeLayout(False)
- Me.TabPage4.PerformLayout()
Me.TabPage2.ResumeLayout(False)
Me.TabPage2.PerformLayout()
Me.TabPage3.ResumeLayout(False)
@@ -2429,8 +2377,6 @@ Partial Class frmMain
Friend WithEvents btn_encode As System.Windows.Forms.Button
Friend WithEvents btn_queue As System.Windows.Forms.Button
Friend WithEvents h264Tab As System.Windows.Forms.TabPage
- Friend WithEvents TabPage4 As System.Windows.Forms.TabPage
- Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
Friend WithEvents Label35 As System.Windows.Forms.Label
Friend WithEvents Label32 As System.Windows.Forms.Label
@@ -2465,7 +2411,6 @@ Partial Class frmMain
Friend WithEvents advancedOptions As System.Windows.Forms.TabControl
Friend WithEvents RadioDVD As System.Windows.Forms.RadioButton
Friend WithEvents RadioISO As System.Windows.Forms.RadioButton
- Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
@@ -2574,7 +2519,6 @@ Partial Class frmMain
Friend WithEvents mnu_options As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator4 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents mnu_ProgramDefaultOptions As System.Windows.Forms.ToolStripMenuItem
- Friend WithEvents drp_processors As System.Windows.Forms.ComboBox
Friend WithEvents drp_audioBitrate As System.Windows.Forms.ComboBox
Friend WithEvents drp_dvdtitle As System.Windows.Forms.ComboBox
Friend WithEvents ToolStripSeparator5 As System.Windows.Forms.ToolStripSeparator
diff --git a/win/Handbrake/frmMain.resx b/win/Handbrake/frmMain.resx
index 725344506..752b751bb 100644
--- a/win/Handbrake/frmMain.resx
+++ b/win/Handbrake/frmMain.resx
@@ -160,12 +160,6 @@
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>639, 17</value>
</metadata>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>639, 17</value>
- </metadata>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>639, 17</value>
- </metadata>
<metadata name="File_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
@@ -181,6 +175,9 @@
<metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>234, 18</value>
</metadata>
+ <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>639, 17</value>
+ </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
diff --git a/win/Handbrake/frmMain.vb b/win/Handbrake/frmMain.vb
index aca684044..546d1ee64 100644
--- a/win/Handbrake/frmMain.vb
+++ b/win/Handbrake/frmMain.vb
@@ -80,8 +80,6 @@ Public Class frmMain
drp_audioBitrate.Text = My.Settings.AudioBitrate
drp_audioSampleRate.Text = My.Settings.AudioSampleRate
drp_audioChannels.Text = My.Settings.AudioChannels
- 'Advanced Settings Tab
- drp_processors.Text = My.Settings.Processors
'H264 Tab
CheckCRF.CheckState = My.Settings.CRF
rtf_h264advanced.Text = My.Settings.H264
@@ -145,8 +143,6 @@ Public Class frmMain
Dim audioSampleRate As String = drp_audioSampleRate.Text
Dim audioChannels As String = drp_audioChannels.Text
Dim AudioMixDown As String = drp_audioMixDown.Text
- 'Advanced Settings Tab
- Dim processors As String = drp_processors.Text
'H264 Tab
Dim CRF As String = CheckCRF.CheckState
Dim advH264 As String = rtf_h264advanced.Text
@@ -187,7 +183,6 @@ Public Class frmMain
StreamWriter.WriteLine(audioSampleRate)
StreamWriter.WriteLine(audioChannels)
StreamWriter.WriteLine(AudioMixDown)
- StreamWriter.WriteLine(processors)
StreamWriter.WriteLine(CRF)
StreamWriter.WriteLine(advH264)
StreamWriter.Close()
@@ -235,7 +230,6 @@ Public Class frmMain
drp_audioSampleRate.Text = inputStream.ReadLine()
drp_audioChannels.Text = inputStream.ReadLine()
drp_audioMixDown.Text = inputStream.ReadLine()
- drp_processors.Text = inputStream.ReadLine()
'Advanced H264 Options
CheckCRF.CheckState = inputStream.ReadLine()
@@ -298,8 +292,6 @@ Public Class frmMain
My.Settings.AudioBitrate = drp_audioBitrate.Text
My.Settings.AudioSampleRate = drp_audioSampleRate.Text
My.Settings.AudioChannels = drp_audioChannels.Text
- 'Advanced Settings Tab
- My.Settings.Processors = drp_processors.Text
'H264 Tab
My.Settings.CRF = CheckCRF.CheckState
My.Settings.H264 = rtf_h264advanced.Text
@@ -565,8 +557,6 @@ Public Class frmMain
QueryEditorText.Text = "" ' Just clearing the quert editor box. Users may forget
Dim chapterFinish As Integer = drop_chapterFinish.Text
Dim chapterStart As Integer = drop_chapterStart.Text
-
-
Try
If (chapterStart > chapterFinish) Then
MessageBox.Show("Invalid Chapter Range! - Start chapter can not be larger than the Final chapter.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
@@ -1209,8 +1199,8 @@ Public Class frmMain
Dim h264Settings As String = CRF + h264Advanced
'----------------------------------------------------------------------
- 'Advanced Settings Tab
- Dim processors As String = drp_processors.Text
+ 'Processors (Program Settings)
+ Dim processors As String = My.Settings.Processors
' Number of Processors Handler
If (processors = "Automatic") Then
@@ -1222,7 +1212,7 @@ Public Class frmMain
Dim queryAdvancedSettings As String = processors
'----------------------------------------------------------------------
- ' Verbose option
+ ' Verbose option (Program Settings)
Dim verbose As String = ""
If My.Settings.verbose = 1 Then
verbose = " -v "
diff --git a/win/Handbrake/frmOptions.Designer.vb b/win/Handbrake/frmOptions.Designer.vb
index 05278026b..7af20530f 100644
--- a/win/Handbrake/frmOptions.Designer.vb
+++ b/win/Handbrake/frmOptions.Designer.vb
@@ -31,8 +31,12 @@ Partial Class frmOptions
Me.check_verbose = New System.Windows.Forms.CheckBox
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.File_Save = New System.Windows.Forms.SaveFileDialog
+ Me.GroupBox3 = New System.Windows.Forms.GroupBox
+ Me.drp_processors = New System.Windows.Forms.ComboBox
+ Me.Label11 = New System.Windows.Forms.Label
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
+ Me.GroupBox3.SuspendLayout()
Me.SuspendLayout()
'
'Label1
@@ -62,7 +66,7 @@ Partial Class frmOptions
Me.btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_close.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btn_close.ForeColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(0, Byte), Integer))
- Me.btn_close.Location = New System.Drawing.Point(292, 287)
+ Me.btn_close.Location = New System.Drawing.Point(292, 387)
Me.btn_close.Name = "btn_close"
Me.btn_close.Size = New System.Drawing.Size(107, 22)
Me.btn_close.TabIndex = 45
@@ -115,7 +119,7 @@ Partial Class frmOptions
'
Me.GroupBox1.Controls.Add(Me.check_verbose)
Me.GroupBox1.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.GroupBox1.Location = New System.Drawing.Point(12, 211)
+ Me.GroupBox1.Location = New System.Drawing.Point(12, 306)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(386, 70)
Me.GroupBox1.TabIndex = 50
@@ -154,11 +158,45 @@ Partial Class frmOptions
Me.File_Save.DefaultExt = "hb"
Me.File_Save.Filter = "txt|*.txt"
'
+ 'GroupBox3
+ '
+ Me.GroupBox3.Controls.Add(Me.drp_processors)
+ Me.GroupBox3.Controls.Add(Me.Label11)
+ Me.GroupBox3.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.GroupBox3.Location = New System.Drawing.Point(13, 211)
+ Me.GroupBox3.Name = "GroupBox3"
+ Me.GroupBox3.Size = New System.Drawing.Size(386, 89)
+ Me.GroupBox3.TabIndex = 52
+ Me.GroupBox3.TabStop = False
+ Me.GroupBox3.Text = "Processor Detection"
+ '
+ 'drp_processors
+ '
+ Me.drp_processors.FlatStyle = System.Windows.Forms.FlatStyle.Flat
+ Me.drp_processors.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.drp_processors.FormattingEnabled = True
+ Me.drp_processors.Items.AddRange(New Object() {"Automatic", "1", "2", "3", "4", "5", "6", "7", "8"})
+ Me.drp_processors.Location = New System.Drawing.Point(19, 50)
+ Me.drp_processors.Name = "drp_processors"
+ Me.drp_processors.Size = New System.Drawing.Size(111, 21)
+ Me.drp_processors.TabIndex = 41
+ '
+ 'Label11
+ '
+ Me.Label11.AutoSize = True
+ Me.Label11.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.Label11.Location = New System.Drawing.Point(16, 27)
+ Me.Label11.Name = "Label11"
+ Me.Label11.Size = New System.Drawing.Size(142, 13)
+ Me.Label11.TabIndex = 40
+ Me.Label11.Text = "Number of processors: "
+ '
'frmOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.ClientSize = New System.Drawing.Size(411, 320)
+ Me.ClientSize = New System.Drawing.Size(411, 421)
+ Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.btn_close)
@@ -170,6 +208,8 @@ Partial Class frmOptions
Me.GroupBox1.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
+ Me.GroupBox3.ResumeLayout(False)
+ Me.GroupBox3.PerformLayout()
Me.ResumeLayout(False)
End Sub
@@ -184,4 +224,7 @@ Partial Class frmOptions
Friend WithEvents check_verbose As System.Windows.Forms.CheckBox
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents File_Save As System.Windows.Forms.SaveFileDialog
+ Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
+ Friend WithEvents drp_processors As System.Windows.Forms.ComboBox
+ Friend WithEvents Label11 As System.Windows.Forms.Label
End Class
diff --git a/win/Handbrake/frmOptions.vb b/win/Handbrake/frmOptions.vb
index 297945eb4..a3158e8b6 100644
--- a/win/Handbrake/frmOptions.vb
+++ b/win/Handbrake/frmOptions.vb
@@ -10,8 +10,6 @@ Public Class frmOptions
' Set the check boxes to the correct state. Checked or unchecked
Private Sub frmOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim file_path As String = Application.StartupPath
-
Try
If My.Settings.StartupUpdate = 1 Then
check_updateCheck.CheckState = CheckState.Checked
@@ -37,6 +35,8 @@ Public Class frmOptions
check_verbose.CheckState = CheckState.Unchecked
End If
+ drp_processors.Text = My.Settings.Processors
+
Catch ex As Exception
MessageBox.Show("ERROR: " & ex.ToString)
End Try
@@ -79,7 +79,6 @@ Public Class frmOptions
End If
End Sub
-
Private Sub check_readDVDWindow_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check_readDVDWindow.CheckedChanged
If check_readDVDWindow.CheckState = 1 Then
Try
@@ -96,7 +95,6 @@ Public Class frmOptions
End If
End Sub
-
Private Sub check_verbose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles check_verbose.CheckedChanged
If check_verbose.CheckState = 1 Then
Try
@@ -114,4 +112,7 @@ Public Class frmOptions
End Sub
+ Private Sub drp_processors_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drp_processors.SelectedIndexChanged
+ My.Settings.Processors = drp_processors.Text
+ End Sub
End Class \ No newline at end of file
diff --git a/win/Handbrake/frmReadDVD.vb b/win/Handbrake/frmReadDVD.vb
index f6b350cbf..b03ae79ef 100644
--- a/win/Handbrake/frmReadDVD.vb
+++ b/win/Handbrake/frmReadDVD.vb
@@ -10,11 +10,10 @@ Public Class frmReadDVD
'# Write the output to dvdinfo.dat
'#
Private Sub frmStatus_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Me.Show()
- Dim ApplicationPath As String = Application.StartupPath
+ Dim applicationPath As String = Application.StartupPath
Try
- Shell("cmd /c """"" + ApplicationPath + "\hbcli.exe"" -i """ + frmMain.text_source.Text + """" & " -t0 >" + """" + ApplicationPath + "\dvdinfo.dat""" + " 2>&1""")
+ Shell("cmd /c """"" + applicationPath + "\hbcli.exe"" -i """ + frmMain.text_source.Text + """" & " -t0 >" + """" + applicationPath + "\dvdinfo.dat""" + " 2>&1""")
Catch ex As Exception
MessageBox.Show("Unable to launch the CLI encoder.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand)
MessageBox.Show(ex.ToString)
@@ -22,17 +21,9 @@ Public Class frmReadDVD
End Sub
- '#
- '#
- '# Ok Button Handler
- '# Stage 1 - Wait til hbcli.exe has finished writing data out to file dvdinfo.dat
- '# Stage 2 - Parse the dvdinfo.dat file
- '# Stage 3 - output the parsed version to dvd.dat or handle errors if any
- '#
- '# This all needs re-written. It's a real mess. Should really dump all the info into an array so external files are not required.
Private Sub btn_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_ok.Click
- '# Stage 1 - Wait til the hbcli exe has finished
+ 'Wait til the hbcli process finishes but do this on another thread so the readDVD window doesn't lock up.
Dim isRunning As Integer
Dim process2 As Process = New Process
Dim running As Boolean = True
@@ -54,155 +45,157 @@ Public Class frmReadDVD
End While
isRunning = 0
+ ' Once hbcli.exe has finished. appened --end-- to the end of the file. This will be our EOF marker.
+ Dim applicationPath As String = Application.StartupPath
+ Dim fileWriter As System.IO.StreamWriter
+ fileWriter = File.AppendText(applicationPath & "\dvdinfo.dat")
+ fileWriter.WriteLine("--end--")
+ fileWriter.Flush()
+ fileWriter.Close()
- '# Stage 2 - Parse the dvdinfo.dat file
- '# This involves creating a string for each title and putting it into an array.
- '# This array is called dvdData()
-
-
- ' Lets clean any previous contents out of the DVD Title dropdown.
+ ' Clean the dvd title dropdown menu so it does not contain any of the previos items
frmMain.drp_dvdtitle.Items.Clear()
- Dim file_path As String = Application.StartupPath
- Dim errStatus As Integer = 0
- Dim dvdData(150) As String
- Dim break As Boolean = False
- Dim titleError As Boolean = False
+
+ ' Open dvdinfo.dat for reading and parse its contents. Place parsed contents in dvd.dat
+ ' Firstly we need to declare the storage array outside the try/catch statments so it can be used elsewhere.
+ Dim dvdInfoArray(150) As String
Try
- ' Parse the Data into a Single String with ~ Sepeartor
- Dim RlineFile As StreamReader = File.OpenText(file_path & "\dvdinfo.dat")
- Dim RLine As String
+ ' File and Line contents varibles
+ Dim ReadLine As StreamReader = File.OpenText(applicationPath & "\dvdinfo.dat")
+ Dim LineContents As String = ""
+
+ ' DVD info stroage varibles
Dim titleData As String = ""
- Dim ChaptStatus As Integer = 0
- Dim AudioTrackStatus As Integer = 0
- Dim SubtitleStatus As Integer = 0
+ Dim duationData As String = ""
+ Dim sizeData As String = ""
+ Dim cropdata As String = ""
+ Dim chatperData As String = ""
+ Dim audioData As String = ""
+ Dim subtitleData As String = ""
+
+ Dim fullTitleData As String = ""
+
+ ' Position Pointers
+ Dim chapterPointer As Boolean = False
+ Dim audioPointer As Boolean = False
+ Dim subtitlePointer As Boolean = False
Dim counter As Integer = 0
- Dim counter2 As String = 0
- Dim ErrorCounter As Integer = 0
- RLine = "---"
- dvdData(counter2) = "---Start---"
-
- While RLine <> Nothing
- If (RLine.Contains("+ title")) Then
- If (titleData <> "") Then
- dvdData(counter2) = titleData
- add(titleData)
- counter2 = counter2 + 1
- End If
- ChaptStatus = 0
- AudioTrackStatus = 0
- SubtitleStatus = 0
- titleData = RLine.Trim
- ElseIf (RLine.Contains("exited.")) Then
- add(titleData)
- dvdData(counter2) = titleData
- counter2 = counter2 + 1
- ChaptStatus = 0
- AudioTrackStatus = 0
- SubtitleStatus = 0
- break = True
- ElseIf (RLine.Contains("***")) Then
- errStatus = 1
- ElseIf (RLine.Contains("No title")) Then
- titleError = True
- break = True
- ElseIf (RLine.Contains("+ duration")) Then
- titleData = titleData & " ~ " & RLine.Trim
- ElseIf (RLine.Contains("+ size")) Then
- titleData = titleData & " ~ " & RLine.Trim
- ElseIf (RLine.Contains("+ autocrop")) Then
- titleData = titleData & " ~ " & RLine.Trim
- ElseIf (RLine.Contains("+ chapters")) Then
- titleData = titleData & " ~ " & RLine.Trim
- ChaptStatus = 1
- AudioTrackStatus = 0
- SubtitleStatus = 0
- ElseIf (RLine.Contains("+ audio")) Then
- titleData = titleData & " ~ " & RLine.Trim
- ChaptStatus = 0
- AudioTrackStatus = 1
- SubtitleStatus = 0
- ElseIf (RLine.Contains("+ subtitle tracks")) Then
- titleData = titleData & " ~ " & RLine.Trim
- ChaptStatus = 0
- AudioTrackStatus = 0
- SubtitleStatus = 1
-
- ElseIf (ChaptStatus = 1) Then
- ' This IF statment is here incase no chapters appear.
- If (RLine.Contains("+ audio")) Then
- ChaptStatus = 0
- AudioTrackStatus = 1
- SubtitleStatus = 0
- End If
- titleData = titleData & " & " & RLine.Trim
-
- ElseIf (AudioTrackStatus = 1) Then
- 'This if statment is here incase there was no audio tracks
- If (RLine.Contains("+ subtitle tracks")) Then
- ChaptStatus = 0
- AudioTrackStatus = 1
- SubtitleStatus = 0
+
+ ' Error handling varibles
+ Dim titleError As Boolean = False
+ Dim readError As Boolean = False
+
+ ' Read every line of the file and place the contents in the approiate varible.
+ While Not LineContents.Equals("--end--")
+ ' Get all the 1 liner data and set chaper potiner to true when done
+ If (LineContents.Contains("exited.")) Then
+ subtitlePointer = False
+ fullTitleData = titleData.Trim + " ~ " + duationData.Trim + " ~ " + sizeData.Trim + " ~ " + cropdata.Trim + " ~ " + chatperData.Trim + " ~ " + audioData.Trim + " ~ " + subtitleData.Trim
+ dvdInfoArray(counter) = fullTitleData
+ add(fullTitleData)
+ counter = counter + 1
+ ElseIf (LineContents.Contains("+ title")) Then
+ If (titleData <> Nothing) Then
+ subtitlePointer = False
+ fullTitleData = titleData.Trim + " ~ " + duationData.Trim + " ~ " + sizeData.Trim + " ~ " + cropdata.Trim + " ~ " + chatperData.Trim + " ~ " + audioData.Trim + " ~ " + subtitleData.Trim
+ dvdInfoArray(counter) = fullTitleData
+ add(fullTitleData)
+ counter = counter + 1
End If
- titleData = titleData & " & " & RLine.Trim
+ titleData = LineContents
+ ElseIf (LineContents.Contains("+ duration")) Then
+ duationData = LineContents
+ ElseIf (LineContents.Contains("+ size")) Then
+ sizeData = LineContents
+ ElseIf (LineContents.Contains("+ autocrop")) Then
+ cropdata = LineContents
+ ElseIf (LineContents.Contains("+ chapters")) Then
+ chatperData = LineContents
+ chapterPointer = True
+ End If
- ElseIf (SubtitleStatus = 1) Then
- If (RLine.Contains("+ title")) Then
- If (titleData <> "") Then
- dvdData(counter2) = titleData
- counter2 = counter2 + 1
+ ' Get all the chapter information in 1 varible
+ If chapterPointer = True Then
+ If LineContents.Contains("+ audio") Then
+ chapterPointer = False
+ audioPointer = True
+ audioData = LineContents
+ Else
+ If Not chatperData.Equals(LineContents) Then
+ chatperData = chatperData & " & " & LineContents.Trim
End If
- ChaptStatus = 0
- AudioTrackStatus = 0
- SubtitleStatus = 0
- titleData = RLine.Trim
+ End If
+ End If
+
+ ' Get all the audio channel information in 1 varible
+ If audioPointer = True Then
+ If LineContents.Contains("+ subtitle") Then
+ audioPointer = False
+ subtitlePointer = True
+ subtitleData = LineContents
Else
- titleData = titleData & " & " & RLine.Trim
+ If Not audioData.Equals(LineContents) Then
+ audioData = audioData & " & " & LineContents.Trim
+ End If
End If
End If
- RLine = RlineFile.ReadLine()
-
- If break = True Then
- RLine = Nothing
- ElseIf RLine = "" Then
- RLine = " "
- ErrorCounter = ErrorCounter + 1
- If ErrorCounter = 50 Then
- RLine = Nothing
+
+ ' Get all the subtitle data into 1 varible
+ If subtitlePointer = True Then
+ If LineContents.Contains("+ subtitle") Then
+ subtitleData = LineContents
+ Else
+ If Not subtitleData.Equals(LineContents) Then
+ subtitleData = subtitleData & " & " & LineContents.Trim
+ End If
End If
End If
- counter = counter + 1
+ ' Handle some of Handbrakes Error outputs if they occur.
+ If (LineContents.Contains("No title")) Then
+ titleError = True
+ End If
+
+ If (LineContents.Contains("***")) Then
+ readError = True
+ End If
+
+ ' Read the next line of the file
+ LineContents = ReadLine.ReadLine
End While
- '# Close the file. Its no longer needed here.
- RlineFile.Close()
+
+ ' Close the file as it is no longer required
+ ReadLine.Close()
+
+
+ ' Display error messages for errors detected above.
+ If readError = True Then
+ MessageBox.Show("Some DVD Title information may be missing however you may still be able to select your required title for encoding!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
+ End If
+
+ If titleError = True Then
+ MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand)
+ End If
Catch ex As Exception
- MessageBox.Show(ex.ToString) ' Debug
+ MessageBox.Show("DEBUG: " & ex.ToString)
End Try
- '# Stage 4 - Write the parsed data out into a file.
- '# But, if theres a problem, display an error message instead
- If errStatus = 1 Then
- MessageBox.Show("Some DVD Title information may be missing however you may still be able to select your required title for encoding!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
- End If
- If titleError = True Then
- MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand)
-
- End If
+ ' Take the information from dvdInfoArray and output each item in the array to a seperate line in the file.
Try
- Dim DataWriter As StreamWriter = New StreamWriter(file_path & "\dvd.dat")
- Dim dvdCount As Integer = dvdData.Length
+ Dim outputWriter As StreamWriter = New StreamWriter(applicationPath & "\dvd.dat")
+ Dim dvdCount As Integer = dvdInfoArray.Length
Dim counter As String = 0
While counter <> dvdCount
- DataWriter.WriteLine(dvdData(counter))
+ outputWriter.WriteLine(dvdInfoArray(counter))
counter = counter + 1
End While
- DataWriter.Close()
+ outputWriter.Close()
Catch ex As Exception
MessageBox.Show("Unable to write Data file. Please make sure the application has admin privileges.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand)
@@ -211,6 +204,8 @@ Public Class frmReadDVD
Me.Close()
End Sub
+
+
'# A function to Add data to frmSelects Select Title Tab and also populate frmMains dvdTitle Tab
Function add(ByVal titleData)
Dim titleInfo() As String
@@ -222,7 +217,6 @@ Public Class frmReadDVD
str(0) = titleInfo(0).Trim.Substring(8).Replace(":", "") 'Title
str(1) = titleInfo(1).Trim.Substring(12) ' Duration
Catch ex As Exception
- MessageBox.Show(ex.ToString)
MessageBox.Show("ERROR: Incomplete DVD data found. Please copy the data on the View DVD Information tab and report this error.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand)
End Try