From cfd30b68c58d1d15cc06b609406263c6132a9c8a Mon Sep 17 00:00:00 2001 From: stax76 Date: Tue, 26 Apr 2016 23:09:44 +0200 Subject: [PATCH] - --- Controls/AviSynthListView.vb | 26 +++++------- Controls/DemuxingControl.vb | 1 - Controls/x264Control.vb | 4 -- Controls/x265Control.vb | 1 - Encoding/IntelEncoder.vb | 6 +-- Encoding/NVIDIAEncoder.vb | 6 +-- Encoding/VideoEncoder.vb | 4 +- Encoding/x265.vb | 2 +- Forms/EventCommandsEditor.vb | 1 - Forms/JobsForm.vb | 18 ++++----- Forms/MacrosForm.vb | 1 - Forms/MainForm.vb | 24 +++++------ Forms/MediaInfoFolderViewForm.vb | 1 - Forms/MediaInfoForm.vb | 2 +- Forms/ScriptingEditor.vb | 2 +- Forms/StreamDemuxForm.Designer.vb | 11 ++---- Forms/eac3toForm.vb | 66 +++++++++++++++---------------- Forms/x264Form.vb | 7 ++-- General/Audio.vb | 2 +- General/AudioProfile.vb | 4 +- General/Demux.vb | 3 +- General/Extensions.vb | 18 ++++++++- General/General.vb | 10 ++--- General/ImageUtils.vb | 1 - General/MediaInfo.vb | 3 +- General/Misc.vb | 14 ++++--- General/Muxer.vb | 2 +- General/Package.vb | 2 +- General/VideoDrawer.vb | 2 +- General/VideoScript.vb | 2 +- My Project/AssemblyInfo.vb | 2 +- UI/Controls/ListViewEx.vb | 16 ++++++-- md/test-build.md | 1 + 33 files changed, 128 insertions(+), 137 deletions(-) diff --git a/Controls/AviSynthListView.vb b/Controls/AviSynthListView.vb index 64992189..3f4e777a 100644 --- a/Controls/AviSynthListView.vb +++ b/Controls/AviSynthListView.vb @@ -1,5 +1,4 @@ Imports System.ComponentModel - Imports StaxRip.UI Class AviSynthListView @@ -59,16 +58,6 @@ Class AviSynthListView BlockItemCheck = False End Sub - Protected Overrides Sub OnCreateControl() - MyBase.OnCreateControl() - AutoResizeColumns(True) - End Sub - - Protected Overrides Sub OnLayout(e As LayoutEventArgs) - MyBase.OnLayout(e) - AutoResizeColumns(True) - End Sub - Sub UpdateMenu() Dim filterProfiles As List(Of FilterCategory) @@ -186,6 +175,16 @@ Class AviSynthListView OnChanged() End Sub + Protected Overrides Sub OnCreateControl() + MyBase.OnCreateControl() + AutoResizeColumns(True) + End Sub + + Protected Overrides Sub OnLayout(e As LayoutEventArgs) + MyBase.OnLayout(e) + AutoResizeColumns(True) + End Sub + Protected Overrides Sub OnDragDrop(e As DragEventArgs) BlockItemCheck = True MyBase.OnDragDrop(e) @@ -235,11 +234,6 @@ Class AviSynthListView f.Show() End Sub - Protected Overrides Sub OnKeyDown(e As KeyEventArgs) - If e.KeyData = Keys.Delete Then RemoveClick() - MyBase.OnKeyDown(e) - End Sub - Sub CodePreview() Using f As New StringEditorForm f.tb.ReadOnly = True diff --git a/Controls/DemuxingControl.vb b/Controls/DemuxingControl.vb index 38aaa431..e8ab9210 100644 --- a/Controls/DemuxingControl.vb +++ b/Controls/DemuxingControl.vb @@ -95,7 +95,6 @@ Class DemuxingControl Me.lv.Size = New System.Drawing.Size(300, 303) Me.lv.TabIndex = 0 Me.lv.UpButton = Me.bnUp - Me.lv.UseCompatibleStateImageBehavior = False Me.lv.View = System.Windows.Forms.View.Details ' 'DemuxingControl diff --git a/Controls/x264Control.vb b/Controls/x264Control.vb index b0fef20c..4705f866 100644 --- a/Controls/x264Control.vb +++ b/Controls/x264Control.vb @@ -73,14 +73,10 @@ Class x264Control 'lv ' Me.lv.Dock = System.Windows.Forms.DockStyle.Fill - Me.lv.ItemCheckProperty = Nothing Me.lv.Location = New System.Drawing.Point(0, 0) - Me.lv.MultiSelectionButtons = Nothing Me.lv.Name = "lv" - Me.lv.SingleSelectionButtons = Nothing Me.lv.Size = New System.Drawing.Size(367, 213) Me.lv.TabIndex = 0 - Me.lv.UseCompatibleStateImageBehavior = False ' 'x264Control ' diff --git a/Controls/x265Control.vb b/Controls/x265Control.vb index 2990c996..3628d444 100644 --- a/Controls/x265Control.vb +++ b/Controls/x265Control.vb @@ -77,7 +77,6 @@ Class x265Control Me.lv.Name = "lv" Me.lv.Size = New System.Drawing.Size(367, 213) Me.lv.TabIndex = 0 - Me.lv.UseCompatibleStateImageBehavior = False ' 'x265Control ' diff --git a/Encoding/IntelEncoder.vb b/Encoding/IntelEncoder.vb index 16ddd385..4c9660d5 100644 --- a/Encoding/IntelEncoder.vb +++ b/Encoding/IntelEncoder.vb @@ -284,14 +284,10 @@ Public Class IntelEncoder Case "ffqsv" sourcePath = "-" If includePaths Then ret = If(includePaths, Package.ffmpeg.GetPath.Quotes, "ffmpeg") + " -threads 1 -hwaccel qsv -i " + If(includePaths, p.LastOriginalSourceFile.Quotes, "path") + " -f yuv4mpegpipe -pix_fmt yuv420p -loglevel error - | " + If(includePaths, Package.QSVEncC.GetPath.Quotes, "QSVEncC") - End Select Dim q = From i In Items Where i.GetArgs <> "" - - If q.Count > 0 Then - ret += " " + q.Select(Function(item) item.GetArgs).Join(" ") - End If + If q.Count > 0 Then ret += " " + q.Select(Function(item) item.GetArgs).Join(" ") Select Case Mode.ValueText Case "icq", "la-icq" diff --git a/Encoding/NVIDIAEncoder.vb b/Encoding/NVIDIAEncoder.vb index cbc16449..ce239cec 100644 --- a/Encoding/NVIDIAEncoder.vb +++ b/Encoding/NVIDIAEncoder.vb @@ -220,9 +220,9 @@ Public Class NVIDIAEncoder Add("Basic", Decoder, Mode, Codec, QPI, QPP, QPB) Add("Rate Control", New NumParam With {.Switch = "--qp-init", .Text = "Initial QP:", .MinMaxStep = {0, Integer.MaxValue, 1}}, - New NumParam With {.Switch = "--qp-max", .Text = "Maximum QP:", .MinMaxStep = {0, Integer.MaxValue, 1}}, - New NumParam With {.Switch = "--qp-min", .Text = "Minimum QP:", .MinMaxStep = {0, Integer.MaxValue, 1}}, - New NumParam With {.Switch = "--max-bitrate", .Text = "Maximum Bitrate:", .InitValue = 17500, .MinMaxStep = {0, Integer.MaxValue, 1}}, + New NumParam With {.Switch = "--qp-max", .Text = "Max QP:", .MinMaxStep = {0, Integer.MaxValue, 1}}, + New NumParam With {.Switch = "--qp-min", .Text = "Min QP:", .MinMaxStep = {0, Integer.MaxValue, 1}}, + New NumParam With {.Switch = "--max-bitrate", .Text = "Max Bitrate:", .InitValue = 17500, .MinMaxStep = {0, Integer.MaxValue, 1}}, New NumParam With {.Switch = "--vbv-bufsize", .Text = "VBV Bufsize:", .MinMaxStep = {0, Integer.MaxValue, 1}}, New BoolParam With {.Switch = "--aq", .Text = "Adaptive Quantization", .Value = False, .DefaultValue = False}, Lossless) diff --git a/Encoding/VideoEncoder.vb b/Encoding/VideoEncoder.vb index cb87c52c..516971ac 100644 --- a/Encoding/VideoEncoder.vb +++ b/Encoding/VideoEncoder.vb @@ -1146,14 +1146,14 @@ Class AMDEncoder Property MaxBitrate As New NumParam With { .Switch = "--max-bitrate", - .Text = "Maximum Bitrate:", + .Text = "Max Bitrate:", .Value = 20000, .DefaultValue = 20000, .MinMaxStep = {0, 1000000, 1}} Property GOPLength As New NumParam With { .Switch = "--gop-len", - .Text = "GOP Length (0=auto):", + .Text = "GOP Length:", .MinMaxStep = {0, 10000, 1}} Property BFrames As New NumParam With { diff --git a/Encoding/x265.vb b/Encoding/x265.vb index 759f87f9..a0c4c71a 100644 --- a/Encoding/x265.vb +++ b/Encoding/x265.vb @@ -947,7 +947,7 @@ Public Class x265Params End If End If - Return Macro.Solve(sb.ToString.Trim.FixBreak.Replace(CrLf, " ")) + Return Macro.Solve(sb.ToString.Trim.FixBreak.Replace(BR, " ")) End Function Function IsCustom(switch As String) As Boolean diff --git a/Forms/EventCommandsEditor.vb b/Forms/EventCommandsEditor.vb index 4433f5f5..56085c93 100644 --- a/Forms/EventCommandsEditor.vb +++ b/Forms/EventCommandsEditor.vb @@ -105,7 +105,6 @@ Class EventCommandsEditor Me.lv.Name = "lv" Me.lv.Size = New System.Drawing.Size(453, 435) Me.lv.TabIndex = 21 - Me.lv.UseCompatibleStateImageBehavior = False ' 'EventCommandsEditor ' diff --git a/Forms/JobsForm.vb b/Forms/JobsForm.vb index d72b9535..640821b5 100644 --- a/Forms/JobsForm.vb +++ b/Forms/JobsForm.vb @@ -34,14 +34,14 @@ Friend Class JobsForm ' Me.bnDown.Anchor = System.Windows.Forms.AnchorStyles.Bottom Me.bnDown.Enabled = False - Me.bnDown.Location = New System.Drawing.Point(478, 413) + Me.bnDown.Location = New System.Drawing.Point(474, 413) Me.bnDown.Margin = New System.Windows.Forms.Padding(4) Me.bnDown.Size = New System.Drawing.Size(36, 36) ' 'bnRemove ' Me.bnRemove.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.bnRemove.Location = New System.Drawing.Point(711, 413) + Me.bnRemove.Location = New System.Drawing.Point(702, 413) Me.bnRemove.Size = New System.Drawing.Size(100, 36) Me.bnRemove.Text = "Remove" ' @@ -49,7 +49,7 @@ Friend Class JobsForm ' Me.bnUp.Anchor = System.Windows.Forms.AnchorStyles.Bottom Me.bnUp.Enabled = False - Me.bnUp.Location = New System.Drawing.Point(434, 413) + Me.bnUp.Location = New System.Drawing.Point(430, 413) Me.bnUp.Margin = New System.Windows.Forms.Padding(4) Me.bnUp.Size = New System.Drawing.Size(36, 36) ' @@ -57,7 +57,7 @@ Friend Class JobsForm ' Me.bnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.bnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.bnClose.Location = New System.Drawing.Point(817, 413) + Me.bnClose.Location = New System.Drawing.Point(808, 413) Me.bnClose.Size = New System.Drawing.Size(100, 36) Me.bnClose.Text = "Close" ' @@ -78,7 +78,7 @@ Friend Class JobsForm 'bnLoad ' Me.bnLoad.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.bnLoad.Location = New System.Drawing.Point(605, 413) + Me.bnLoad.Location = New System.Drawing.Point(596, 413) Me.bnLoad.Size = New System.Drawing.Size(100, 36) Me.bnLoad.Text = "Load" ' @@ -87,20 +87,16 @@ Friend Class JobsForm Me.lv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.lv.ItemCheckProperty = Nothing Me.lv.Location = New System.Drawing.Point(12, 12) - Me.lv.MultiSelectionButtons = Nothing Me.lv.Name = "lv" - Me.lv.SingleSelectionButtons = Nothing - Me.lv.Size = New System.Drawing.Size(905, 395) + Me.lv.Size = New System.Drawing.Size(896, 395) Me.lv.TabIndex = 7 - Me.lv.UseCompatibleStateImageBehavior = False ' 'JobsForm ' Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None Me.CancelButton = Me.bnClose - Me.ClientSize = New System.Drawing.Size(929, 461) + Me.ClientSize = New System.Drawing.Size(920, 461) Me.Controls.Add(Me.lv) Me.Controls.Add(Me.bnLoad) Me.Controls.Add(Me.bnDown) diff --git a/Forms/MacrosForm.vb b/Forms/MacrosForm.vb index b1dd1723..ee0d7d64 100644 --- a/Forms/MacrosForm.vb +++ b/Forms/MacrosForm.vb @@ -48,7 +48,6 @@ Class MacrosForm Me.lv.Name = "lv" Me.lv.Size = New System.Drawing.Size(310, 613) Me.lv.TabIndex = 2 - Me.lv.UseCompatibleStateImageBehavior = False ' 'stb ' diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index c75742e5..2ae3826f 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -672,16 +672,12 @@ Class MainForm Me.AviSynthListView.FullRowSelect = True Me.AviSynthListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None Me.AviSynthListView.HideSelection = False - Me.AviSynthListView.ItemCheckProperty = Nothing Me.AviSynthListView.Location = New System.Drawing.Point(8, 26) Me.AviSynthListView.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.AviSynthListView.MultiSelect = False - Me.AviSynthListView.MultiSelectionButtons = Nothing Me.AviSynthListView.Name = "AviSynthListView" - Me.AviSynthListView.SingleSelectionButtons = Nothing Me.AviSynthListView.Size = New System.Drawing.Size(304, 180) Me.AviSynthListView.TabIndex = 0 - Me.AviSynthListView.UseCompatibleStateImageBehavior = False Me.AviSynthListView.View = System.Windows.Forms.View.Details ' 'lgbEncoder @@ -1684,7 +1680,7 @@ Class MainForm Log.WriteLine(i) Next - Log.WriteLine(CrLf + MediaInfo.GetSummary(p.SourceFile)) + Log.WriteLine(BR + MediaInfo.GetSummary(p.SourceFile)) For Each i In DriveInfo.GetDrives() If i.DriveType = DriveType.CDRom AndAlso @@ -2069,7 +2065,7 @@ Class MainForm If idxContent.Contains(VB6.ChrW(&HA) + VB6.ChrW(&H0) + VB6.ChrW(&HD) + VB6.ChrW(&HA)) Then idxContent = idxContent.FixBreak - idxContent = idxContent.Replace(CrLf + VB6.ChrW(&H0) + BR, CrLf + "langidx: 0" + BR) + idxContent = idxContent.Replace(BR + VB6.ChrW(&H0) + BR, BR + "langidx: 0" + BR) File.WriteAllText(i, idxContent, Encoding.Default) End If @@ -2113,7 +2109,7 @@ Class MainForm Dim args = ifoPath + BR + p.TempDir + Filepath.GetBase(p.SourceFile) + BR & - (i + 1) & CrLf + + (i + 1) & BR + "1" + BR + "ALL" + BR + "CLOSE" @@ -2161,10 +2157,10 @@ Class MainForm Log.WriteLine(p.Script.GetFullScript) Log.WriteHeader("Script Properties") - Dim props = "source frame count: " & p.SourceScript.GetFrames & CrLf + + Dim props = "source frame count: " & p.SourceScript.GetFrames & BR + "source frame rate: " & p.SourceScript.GetFramerate.ToString("f6", CultureInfo.InvariantCulture) + BR + "source duration: " + TimeSpan.FromSeconds(g.Get0ForInfinityOrNaN(p.SourceScript.GetFrames / p.SourceScript.GetFramerate)).ToString + BR + - "target frame count: " & p.Script.GetFrames & CrLf + + "target frame count: " & p.Script.GetFrames & BR + "target frame rate: " & p.Script.GetFramerate.ToString("f6", CultureInfo.InvariantCulture) + BR + "target duration: " + TimeSpan.FromSeconds(g.Get0ForInfinityOrNaN(p.Script.GetFrames / p.Script.GetFramerate)).ToString @@ -3749,7 +3745,7 @@ Class MainForm tb = ui.AddTextBlock(subPage) tb.Label.Text = "Auto load subtitles:" - tb.Label.Tooltip = "Subtitles loaded automatically using [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes two or three letter language code] separated by space, comma or semicolon. For all subtitles just enter all." + BR2 + String.Join(CrLf, From i In Language.Languages Where i.IsCommon Select i.ToString + ": " + i.TwoLetterCode + ", " + i.ThreeLetterCode) + tb.Label.Tooltip = "Subtitles loaded automatically using [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes two or three letter language code] separated by space, comma or semicolon. For all subtitles just enter all." + BR2 + String.Join(BR, From i In Language.Languages Where i.IsCommon Select i.ToString + ": " + i.TwoLetterCode + ", " + i.ThreeLetterCode) tb.Edit.Text = p.AutoSubtitles tb.Edit.SaveAction = Sub(value) p.AutoSubtitles = value @@ -3993,7 +3989,7 @@ Class MainForm End If Next - If Not ret.EndsWith(CrLf2) Then ret += BR + If Not ret.EndsWith(BR2) Then ret += BR Next Return ret @@ -4116,7 +4112,7 @@ Class MainForm If params.Length = 0 Then If switch Is Nothing Then - advanced.Add(String.Join(CrLf, switches), desc) + advanced.Add(String.Join(BR, switches), desc) Else basic.Add(String.Join(", ", switches), desc) End If @@ -4143,10 +4139,10 @@ Class MainForm switches(iSwitch) += ":" + String.Join(",", paramList.ToArray) Next - Dim switchcell = String.Join(CrLf, switches) + Dim switchcell = String.Join(BR, switches) If enumList.Count > 0 Then - switchcell += BR2 + String.Join(CrLf, enumList.ToArray) + switchcell += BR2 + String.Join(BR, enumList.ToArray) End If If switch Is Nothing Then diff --git a/Forms/MediaInfoFolderViewForm.vb b/Forms/MediaInfoFolderViewForm.vb index f2722538..49f34130 100644 --- a/Forms/MediaInfoFolderViewForm.vb +++ b/Forms/MediaInfoFolderViewForm.vb @@ -31,7 +31,6 @@ Class MediaInfoFolderViewForm Me.lv.Name = "lv" Me.lv.Size = New System.Drawing.Size(914, 601) Me.lv.TabIndex = 0 - Me.lv.UseCompatibleStateImageBehavior = False ' 'MediaInfoFolderViewForm ' diff --git a/Forms/MediaInfoForm.vb b/Forms/MediaInfoForm.vb index da2cacad..36766501 100644 --- a/Forms/MediaInfoForm.vb +++ b/Forms/MediaInfoForm.vb @@ -179,7 +179,7 @@ Class MediaInfoForm If newText.Length = 0 Then newText.Append(i + BR2) Else - newText.Append(CrLf + i + BR2) + newText.Append(BR + i + BR2) End If Dim itemsInGroup = items.Where(Function(v) v.Group = i) diff --git a/Forms/ScriptingEditor.vb b/Forms/ScriptingEditor.vb index 899e4b39..d2bfa8f7 100644 --- a/Forms/ScriptingEditor.vb +++ b/Forms/ScriptingEditor.vb @@ -430,7 +430,7 @@ Class ScriptingEditor Dim flow = DirectCast(Parent, FlowLayoutPanel) Dim firstTable = DirectCast(flow.Controls(0), FilterTable) firstTable.tbName.Text = "merged" - firstTable.rtbScript.Text = flow.Controls.OfType(Of FilterTable).Select(Function(arg) If(arg.cbActive.Checked, arg.rtbScript.Text.Trim, "#" + arg.rtbScript.Text.Trim.FixBreak.Replace(CrLf, "# " + BR))).Join(BR) + BR2 + BR2 + "#" + firstTable.rtbScript.Text = flow.Controls.OfType(Of FilterTable).Select(Function(arg) If(arg.cbActive.Checked, arg.rtbScript.Text.Trim, "#" + arg.rtbScript.Text.Trim.FixBreak.Replace(BR, "# " + BR))).Join(BR) + BR2 + BR2 + "#" For x = flow.Controls.Count - 1 To 1 Step -1 flow.Controls.RemoveAt(x) diff --git a/Forms/StreamDemuxForm.Designer.vb b/Forms/StreamDemuxForm.Designer.vb index ad78f2ee..46f5360a 100644 --- a/Forms/StreamDemuxForm.Designer.vb +++ b/Forms/StreamDemuxForm.Designer.vb @@ -87,14 +87,10 @@ Partial Class StreamDemuxForm Me.lvAudio.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.lvAudio.ItemCheckProperty = Nothing Me.lvAudio.Location = New System.Drawing.Point(3, 3) - Me.lvAudio.MultiSelectionButtons = Nothing Me.lvAudio.Name = "lvAudio" - Me.lvAudio.SingleSelectionButtons = Nothing Me.lvAudio.Size = New System.Drawing.Size(843, 299) Me.lvAudio.TabIndex = 8 - Me.lvAudio.UseCompatibleStateImageBehavior = False ' 'flpAudioButtons ' @@ -185,14 +181,13 @@ Partial Class StreamDemuxForm Me.lvSubtitles.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.lvSubtitles.ItemCheckProperty = Nothing + Me.lvSubtitles.Location = New System.Drawing.Point(3, 3) - Me.lvSubtitles.MultiSelectionButtons = Nothing + Me.lvSubtitles.Name = "lvSubtitles" - Me.lvSubtitles.SingleSelectionButtons = Nothing + Me.lvSubtitles.Size = New System.Drawing.Size(843, 167) Me.lvSubtitles.TabIndex = 9 - Me.lvSubtitles.UseCompatibleStateImageBehavior = False ' 'flpSubtitleButtons ' diff --git a/Forms/eac3toForm.vb b/Forms/eac3toForm.vb index 0b455d28..d92396da 100644 --- a/Forms/eac3toForm.vb +++ b/Forms/eac3toForm.vb @@ -179,7 +179,6 @@ Class eac3toForm Me.lvAudio.Name = "lvAudio" Me.lvAudio.Size = New System.Drawing.Size(1018, 292) Me.lvAudio.TabIndex = 8 - Me.lvAudio.UseCompatibleStateImageBehavior = False ' 'lvSubtitles ' @@ -191,7 +190,6 @@ Class eac3toForm Me.lvSubtitles.Name = "lvSubtitles" Me.lvSubtitles.Size = New System.Drawing.Size(1018, 131) Me.lvSubtitles.TabIndex = 9 - Me.lvSubtitles.UseCompatibleStateImageBehavior = False ' 'flpSubtitleLinks ' @@ -680,16 +678,16 @@ Class eac3toForm ElseIf Output <> "" Then Log.WriteLine(Output) - If Output.Contains(CrLf + " (embedded: ") Then - Output = Output.Replace(CrLf + " (embedded: ", "(embedded: ") + If Output.Contains(BR + " (embedded: ") Then + Output = Output.Replace(BR + " (embedded: ", "(embedded: ") End If While Output.Contains(" (embedded: ") Output = Output.Replace(" (embedded: ", " (embedded: ") End While - If Output.Contains(CrLf + " (core: ") Then - Output = Output.Replace(CrLf + " (core: ", "(core: ") + If Output.Contains(BR + " (core: ") Then + Output = Output.Replace(BR + " (core: ", "(core: ") End If While Output.Contains(" (core: ") @@ -699,14 +697,14 @@ Class eac3toForm Output = Output.Replace(" channels, ", "ch, ").Replace(" bits, ", "bits, ").Replace("dialnorm", "dn") Output = Output.Replace("(core: ", "(").Replace("(embedded: ", "(") - For Each i In Output.SplitLinesNoEmpty - Dim m = Regex.Match(i, "^(\d+): (.+)$") + For Each line In Output.SplitLinesNoEmpty + Dim match = Regex.Match(line, "^(\d+): (.+)$") - If m.Success Then + If match.Success Then Dim ms As New M2TSStream - ms.Text = i.Trim - ms.ID = m.Groups(1).Value.ToInt - ms.Codec = m.Groups(2).Value + ms.Text = line.Trim + ms.ID = match.Groups(1).Value.ToInt + ms.Codec = match.Groups(2).Value If ms.Codec.Contains(",") Then ms.Codec = ms.Codec.Left(",") @@ -755,49 +753,49 @@ Class eac3toForm If Not ms.IsVideo AndAlso Not ms.IsAudio AndAlso Not ms.IsSubtitle AndAlso Not ms.IsChapters Then - Throw New Exception("Failed to detect stream: " + i) + Throw New Exception("Failed to detect stream: " + line) End If Streams.Add(ms) End If Next - For Each i In Streams - If i.IsAudio Then - i.ListViewItem = lvAudio.Items.Add(i.ToString) - i.ListViewItem.Tag = i + For Each stream In Streams + If stream.IsAudio Then + stream.ListViewItem = lvAudio.Items.Add(stream.ToString) + stream.ListViewItem.Tag = stream - If i.Language.TwoLetterCode = CultureInfo.CurrentCulture.TwoLetterISOLanguageName Then + If stream.Language.TwoLetterCode = CultureInfo.CurrentCulture.TwoLetterISOLanguageName Then bnAudioNative.Visible = True - i.ListViewItem.Checked = True - ElseIf i.Language.TwoLetterCode = "en" Then + stream.ListViewItem.Checked = True + ElseIf stream.Language.TwoLetterCode = "en" Then bnAudioEnglish.Visible = True - i.ListViewItem.Checked = True - ElseIf i.Language.TwoLetterCode = "iv" Then - i.ListViewItem.Checked = True + stream.ListViewItem.Checked = True + ElseIf stream.Language.TwoLetterCode = "iv" Then + stream.ListViewItem.Checked = True End If - ElseIf i.IsVideo Then - cbVideoStream.Items.Add(i) - ElseIf i.IsSubtitle Then - If i.Language.CultureInfo.TwoLetterISOLanguageName = CultureInfo.CurrentCulture.TwoLetterISOLanguageName Then + ElseIf stream.IsVideo Then + cbVideoStream.Items.Add(stream) + ElseIf stream.IsSubtitle Then + If stream.Language.CultureInfo.TwoLetterISOLanguageName = CultureInfo.CurrentCulture.TwoLetterISOLanguageName Then bnSubtitleNative.Visible = True - ElseIf i.Language.CultureInfo.TwoLetterISOLanguageName = "en" Then + ElseIf stream.Language.CultureInfo.TwoLetterISOLanguageName = "en" Then bnSubtitleEnglish.Visible = True End If - Dim item = lvSubtitles.Items.Add(i.Language.ToString) - item.Tag = i + Dim item = lvSubtitles.Items.Add(stream.Language.ToString) + item.Tag = stream For Each autoCode In p.AutoSubtitles.SplitNoEmptyAndWhiteSpace(",", ";", " ") If autoCode.ToLower = "all" OrElse - autoCode.ToLower = i.Language.TwoLetterCode OrElse - autoCode.ToLower = i.Language.ThreeLetterCode OrElse - i.Language.TwoLetterCode = "iv" Then + autoCode.ToLower = stream.Language.TwoLetterCode OrElse + autoCode.ToLower = stream.Language.ThreeLetterCode OrElse + stream.Language.TwoLetterCode = "iv" Then item.Checked = True End If Next - ElseIf i.IsChapters Then + ElseIf stream.IsChapters Then cbChapters.Visible = True End If Next diff --git a/Forms/x264Form.vb b/Forms/x264Form.vb index e1438658..c84f86a7 100644 --- a/Forms/x264Form.vb +++ b/Forms/x264Form.vb @@ -2433,7 +2433,7 @@ Class x264Form cbGoTo.Sorted = True cbGoTo.SendMessageCue("Search") - ToolTip.SetToolTip(lAimedQuality, "A well balanced value is 50%. The assistant warns" & CrLf & "if it's more then 10% off.") + ToolTip.SetToolTip(lAimedQuality, "A well balanced value is 50%. The assistant warns" & BR & "if it's more then 10% off.") ToolTip.SetToolTip(rtbCommandLine, "Right-click to show a context menu") rtbCommandLine.ScrollBars = RichTextBoxScrollBars.None @@ -3395,9 +3395,8 @@ Class x264Form If failed.Count = 0 Then m += BR2 + "No errors" Else - m += BR2 + "Count of switches failed to import: " & - failed.Count & CrLf2 & "Failed Switches:" & CrLf2 & - failed.Join(BR) + m += BR2 + "Count of switches failed to import: " & failed.Count & + BR2 & "Failed Switches:" & BR2 & failed.Join(BR) End If Using td As New TaskDialog(Of String) diff --git a/General/Audio.vb b/General/Audio.vb index 4d96b433..e2189a26 100644 --- a/General/Audio.vb +++ b/General/Audio.vb @@ -178,7 +178,7 @@ Class Audio If File.Exists(m4aPath) Then If Not ap Is Nothing Then ap.File = m4aPath FileHelp.Delete(outPath) - Log.WriteLine(CrLf + MediaInfo.GetSummary(m4aPath)) + Log.WriteLine(BR + MediaInfo.GetSummary(m4aPath)) Else Throw New ErrorAbortException("Error mux AAC to M4A", outPath) End If diff --git a/General/AudioProfile.vb b/General/AudioProfile.vb index 40fe46b1..1f37f2a0 100644 --- a/General/AudioProfile.vb +++ b/General/AudioProfile.vb @@ -308,7 +308,7 @@ Public Class BatchAudioProfile p.VideoBitrate = CInt(Calc.GetVideoBitrate) If Not p.VideoEncoder.QualityMode Then - Log.WriteLine("Video Bitrate: " + bitrateBefore.ToString() + " -> " & p.VideoBitrate & CrLf) + Log.WriteLine("Video Bitrate: " + bitrateBefore.ToString() + " -> " & p.VideoBitrate & BR) End If Log.WriteLine(MediaInfo.GetSummary(File)) @@ -648,7 +648,7 @@ Class GUIAudioProfile p.VideoBitrate = CInt(Calc.GetVideoBitrate) If Not p.VideoEncoder.QualityMode Then - Log.WriteLine("Video Bitrate: " + bitrateBefore.ToString() + " -> " & p.VideoBitrate & CrLf) + Log.WriteLine("Video Bitrate: " + bitrateBefore.ToString() + " -> " & p.VideoBitrate & BR) End If Log.WriteLine(MediaInfo.GetSummary(File)) diff --git a/General/Demux.vb b/General/Demux.vb index e2161edd..29b896d8 100644 --- a/General/Demux.vb +++ b/General/Demux.vb @@ -370,6 +370,7 @@ Class mkvDemuxer If output.Contains("Chapters: ") Then Using proc As New Proc proc.Init("Demux chapters using mkvextract " + Package.mkvmerge.Version, "Progress: ") + proc.WriteLine(output + BR) proc.Encoding = Encoding.UTF8 proc.File = Package.mkvextract.GetPath proc.Arguments = "chapters " + p.SourceFile.Quotes + " --redirect-output " + @@ -400,7 +401,7 @@ Class mkvDemuxer Using proc As New Proc proc.Init("Demux attachments using mkvextract " + Package.mkvmerge.Version, "Progress: ") - proc.WriteLine(output) + proc.WriteLine(output + BR) proc.Encoding = Encoding.UTF8 proc.File = Package.mkvextract.GetPath proc.Arguments = "attachments " + p.SourceFile.Quotes + params diff --git a/General/Extensions.vb b/General/Extensions.vb index 7eceec9d..d4264899 100644 --- a/General/Extensions.vb +++ b/General/Extensions.vb @@ -8,6 +8,17 @@ Imports Microsoft.Win32 Imports VB6 = Microsoft.VisualBasic Module StringExtensions + + Public Function Multiply(instance As String, multiplier As Integer) As String + Dim sb As New StringBuilder(multiplier * instance.Length) + + For i = 0 To multiplier - 1 + sb.Append(instance) + Next + + Return sb.ToString() + End Function + Function FileName(instance As String) As String If instance = "" Then Return "" @@ -366,7 +377,10 @@ Module MiscExtensions End Function - Function Join(instance As IEnumerable(Of String), delimiter As String) As String + Function Join(instance As IEnumerable(Of String), + delimiter As String, + Optional removeEmpty As Boolean = False) As String + If instance Is Nothing Then Return Nothing Dim containsEmpty As Boolean @@ -377,7 +391,7 @@ Module MiscExtensions End If Next - If containsEmpty Then instance = instance.Where(Function(arg) arg <> "") + If containsEmpty AndAlso removeEmpty Then instance = instance.Where(Function(arg) arg <> "") Return String.Join(delimiter, instance) End Function diff --git a/General/General.vb b/General/General.vb index a115f2d4..17d04122 100644 --- a/General/General.vb +++ b/General/General.vb @@ -537,8 +537,8 @@ table { Writer.WriteStartElement("html") Writer.WriteStartElement("head") Writer.WriteElementString("title", title) - Writer.WriteRaw(CrLf + style.ToString + BR) - Writer.WriteRaw(CrLf + script.ToString + BR) + Writer.WriteRaw(BR + style.ToString + BR) + Writer.WriteRaw(BR + script.ToString + BR) Writer.WriteEndElement() 'head Writer.WriteStartElement("body") WriteElement("p", "") @@ -584,7 +584,7 @@ table { If value.Contains("<") Then value = value.Replace("<", "<") If value.Contains(">") Then value = value.Replace(">", ">") - If value.Contains(BR) Then value = value.Replace(CrLf, "
") + If value.Contains(BR) Then value = value.Replace(BR, "
") Return value End Function @@ -1182,9 +1182,7 @@ End Class Public Module MainModule Public Const BR As String = VB6.vbCrLf - Public Const BR2 As String = VB6.vbCrLf - Public Const CrLf As String = VB6.vbCrLf - Public Const CrLf2 As String = VB6.vbCrLf + VB6.vbCrLf + Public Const BR2 As String = VB6.vbCrLf + VB6.vbCrLf Function OK(value As String) As Boolean Return value <> "" diff --git a/General/ImageUtils.vb b/General/ImageUtils.vb index bf8229e8..678ac017 100644 --- a/General/ImageUtils.vb +++ b/General/ImageUtils.vb @@ -66,7 +66,6 @@ Class Thumbnails Dim infoWidth = MediaInfo.GetVideo(inputFile, "Width") Dim infoHeight = MediaInfo.GetVideo(inputFile, "Height") Dim infoLength = New FileInfo(inputFile).Length - Dim infoDuration = MediaInfo.GetGeneral(inputFile, "Duration").ToInt If infoLength / 1024 ^ 3 > 1 Then diff --git a/General/MediaInfo.vb b/General/MediaInfo.vb index 36634e58..9a678020 100644 --- a/General/MediaInfo.vb +++ b/General/MediaInfo.vb @@ -251,7 +251,8 @@ Class MediaInfo Shared Function GetSummary(path As String) As String Dim mi = GetMediaInfo(path) MediaInfo_Option(mi.Handle, "Complete", "0") - Return Marshal.PtrToStringUni(MediaInfo_Inform(mi.Handle, 0)).FormatColumn(":") + Dim ret = Marshal.PtrToStringUni(MediaInfo_Inform(mi.Handle, 0)) + Return Regex.Replace(ret, "Unique ID +: .+\n", "").FormatColumn(":").Trim End Function Shared Function GetCompleteSummary(path As String) As String diff --git a/General/Misc.vb b/General/Misc.vb index 6b7b6376..3e4aa4dd 100644 --- a/General/Misc.vb +++ b/General/Misc.vb @@ -1108,6 +1108,7 @@ Class Log StartTime = DateTime.Now SyncLock p.Log + If Not p.Log.ToString.EndsWith(BR2) Then p.Log.AppendLine() p.Log.Append(FormatHeader(header)) End SyncLock @@ -1131,6 +1132,7 @@ Class Log If value <> "" Then SyncLock p.Log + If Not p.Log.ToString.EndsWith(BR2) Then p.Log.AppendLine() p.Log.Append(FormatHeader(value)) End SyncLock @@ -1155,15 +1157,16 @@ Class Log End Sub Shared Function FormatHeader(value As String) As String - Return CrLf + "".PadLeft(60, "-"c) + BR + value.PadLeft(30 + value.Length \ 2) + BR + "".PadLeft(60, "-"c) + BR2 + Return "-=".Multiply(30) + "-" + BR + + value.PadLeft(30 + value.Length \ 2) + + BR + "-=".Multiply(30) + "-" + BR2 End Function Shared Sub WriteEnvironment() If p.Log.ToString.Contains("StaxRip x64: " + Application.ProductVersion) Then Exit Sub - Dim staxrip = -"----------------------------------------------------------- - _________ __ __________.__ + Dim staxrip = "-=".Multiply(30) + "-" + BR + +" _________ __ __________.__ / _____// |______ ___ __\______ \__|_____ \_____ \\ __\__ \ \ \/ /| _/ \____ \ / \| | / __ \_> < | | \ | |_> > @@ -1171,7 +1174,6 @@ Class Log \/ \/ \/ \/ |__| " WriteLine(staxrip) - WriteHeader("Environment") Dim mc As New ManagementClass("Win32_VideoController") @@ -1205,7 +1207,7 @@ Class Log Dim n = DateTime.Now.Subtract(start) SyncLock p.Log - p.Log.AppendLine() + If Not p.Log.ToString.EndsWith(BR2) Then p.Log.AppendLine() p.Log.Append("Start: ".PadRight(10) + start.ToLongTimeString + BR) p.Log.Append("End: ".PadRight(10) + DateTime.Now.ToLongTimeString + BR) p.Log.Append("Duration: " + CInt(Math.Floor(n.TotalHours)).ToString("d2") + ":" + n.Minutes.ToString("d2") + ":" + n.Seconds.ToString("d2") + BR) diff --git a/General/Muxer.vb b/General/Muxer.vb index ad51f1ca..704f0b37 100644 --- a/General/Muxer.vb +++ b/General/Muxer.vb @@ -101,7 +101,7 @@ Public MustInherit Class Muxer If v.Contains(vb6.ChrW(&HA) + vb6.ChrW(&H0) + vb6.ChrW(&HD) + vb6.ChrW(&HA)) Then v = v.FixBreak - v = v.Replace(CrLf + vb6.ChrW(&H0) + BR, CrLf + "langidx: 0" + BR) + v = v.Replace(BR + vb6.ChrW(&H0) + BR, BR + "langidx: 0" + BR) File.WriteAllText(iFile, v, Encoding.Default) End If End If diff --git a/General/Package.vb b/General/Package.vb index 9c50d6d3..9b9581fe 100644 --- a/General/Package.vb +++ b/General/Package.vb @@ -1111,7 +1111,7 @@ Public Class qaacPackage If Not File.Exists(path) AndAlso Not File.Exists(GetDir() + "QTfiles64\CoreAudioToolbox.dll") Then Return "Failed to locate CoreAudioToolbox, read the description below. Expected paths:" + - CrLf2 + path + BR2 + GetDir() + "QTfiles64\CoreAudioToolbox.dll" + BR2 + path + BR2 + GetDir() + "QTfiles64\CoreAudioToolbox.dll" End If End Function End Class diff --git a/General/VideoDrawer.vb b/General/VideoDrawer.vb index 0c32e8d2..3407c39a 100644 --- a/General/VideoDrawer.vb +++ b/General/VideoDrawer.vb @@ -136,7 +136,7 @@ Dim text = "Frame: " & AVI.Position & " (" & AVI.FrameCount & ")" + BR & "Time: " & currentDate.ToString(format) + " (" + lengthtDate.ToString(format) + ")" + BR + - "Size: " & frameSize.Width & " x " & frameSize.Height & CrLf + + "Size: " & frameSize.Width & " x " & frameSize.Height & BR + "Rate: " & AVI.FrameRate.ToString("f6") Dim font = New Font("Segoe UI", 10, FontStyle.Bold) diff --git a/General/VideoScript.vb b/General/VideoScript.vb index 4d18b62e..47620a8c 100644 --- a/General/VideoScript.vb +++ b/General/VideoScript.vb @@ -343,7 +343,7 @@ Public Class VideoScript script.Engine = ScriptingEngine.VapourSynth script.Filters.Add(New VideoFilter("Source", "ffms2", "clip = core.ffms2.Source(r""%source_file%"", cachefile = r""%temp_file%.ffindex"")")) script.Filters.Add(New VideoFilter("Crop", "CropRel", "clip = core.std.CropRel(clip, %crop_left%, %crop_right%, %crop_top%, %crop_bottom%)", False)) - script.Filters.Add(New VideoFilter("Field", "QTGMC Medium", "clip = havsfunc.QTGMC(clip, TFF = True, Preset = 'Medium')", False)) + script.Filters.Add(New VideoFilter("Field", "QTGMC Medium", $"clip = core.std.SetFieldBased(clip, 2) # 1 = BFF, 2 = TFF{BR}clip = havsfunc.QTGMC(clip, TFF = True, Preset = 'Medium')", False)) script.Filters.Add(New VideoFilter("Noise", "SMDegrain", "clip = havsfunc.SMDegrain(clip, contrasharp = True)", False)) script.Filters.Add(New VideoFilter("Resize", "Bicubic", "clip = core.resize.Bicubic(clip, %target_width%, %target_height%)", False)) ret.Add(script) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 82fc7cf5..4d22b1ac 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -8,4 +8,4 @@ Imports System.Runtime.InteropServices - \ No newline at end of file + \ No newline at end of file diff --git a/UI/Controls/ListViewEx.vb b/UI/Controls/ListViewEx.vb index 98435b9f..df409551 100644 --- a/UI/Controls/ListViewEx.vb +++ b/UI/Controls/ListViewEx.vb @@ -10,12 +10,22 @@ Namespace UI Class ListViewEx Inherits ListView - Property UpButton As Button - Property DownButton As Button - Property RemoveButton As Button + + Property UpButton As Button + + Property DownButton As Button + + + Property RemoveButton As Button + + Property SingleSelectionButtons As Button() + + Property MultiSelectionButtons As Button() + + Property ItemCheckProperty As String Event ItemsChanged() diff --git a/md/test-build.md b/md/test-build.md index 3c5f27ac..7ec5d23f 100644 --- a/md/test-build.md +++ b/md/test-build.md @@ -33,6 +33,7 @@ http://1drv.ms/1OqPDOe - removed mkvinfo.exe which is 18 MB large and not really needed. It's large due to QT toolkit being used - mkv audio demuxing happens now all streams together instead of every stream separate, it's much faster now. - changed filter profiles editor to support both tab and 4 spaces for multiline profiles, tabs are converted to 4 spaces which is the standard in Python and Visual Studio +- log file improvements ### Updated Tools