diff --git a/Controls/SubtitleControl.vb b/Controls/SubtitleControl.vb index 8f93b8b7..01a10923 100644 --- a/Controls/SubtitleControl.vb +++ b/Controls/SubtitleControl.vb @@ -324,6 +324,8 @@ Class SubtitleControl Sub AddSubtitles(subtitles As List(Of Subtitle)) For Each i In subtitles + i.Default = False + If File.Exists(i.Path) Then Dim size As String @@ -387,26 +389,6 @@ Class SubtitleControl Property Subtitle As Subtitle End Class - Private Sub bnBDSup2SubPP_Click() Handles bnBDSup2SubPP.Click - Try - Dim st = Items(dgv.CurrentRow.Index).Subtitle - Dim fp = st.Path - - If Filepath.GetExtFull(fp) = ".idx" Then - fp = p.TempDir + p.TargetFile.Base + "_temp.idx" - - Regex.Replace(File.ReadAllText(st.Path), "langidx: \d+", "langidx: " + - st.IndexIDX.ToString).WriteANSIFile(fp) - - FileHelp.Copy(Filepath.GetDirAndBase(st.Path) + ".sub", Filepath.GetDirAndBase(fp) + ".sub") - End If - - g.ShellExecute(Package.BDSup2SubPP.Path, """" + fp + """") - Catch ex As Exception - g.ShowException(ex) - End Try - End Sub - Private Sub bnPlay_Click() Handles bnPlay.Click If Package.MPC.VerifyOK(True) Then Try @@ -510,11 +492,23 @@ Class SubtitleControl UpdateControls() End Sub - Private Sub bnPlay_Click(sender As Object, e As EventArgs) Handles bnPlay.Click - - End Sub - Private Sub bnBDSup2SubPP_Click(sender As Object, e As EventArgs) Handles bnBDSup2SubPP.Click + Try + Dim st = Items(dgv.CurrentRow.Index).Subtitle + Dim fp = st.Path + If Filepath.GetExtFull(fp) = ".idx" Then + fp = p.TempDir + p.TargetFile.Base + "_temp.idx" + + Regex.Replace(File.ReadAllText(st.Path), "langidx: \d+", "langidx: " + + st.IndexIDX.ToString).WriteANSIFile(fp) + + FileHelp.Copy(Filepath.GetDirAndBase(st.Path) + ".sub", Filepath.GetDirAndBase(fp) + ".sub") + End If + + g.ShellExecute(Package.BDSup2SubPP.Path, """" + fp + """") + Catch ex As Exception + g.ShowException(ex) + End Try End Sub End Class \ No newline at end of file diff --git a/Encoding/VideoEncoder.vb b/Encoding/VideoEncoder.vb index c16f89f2..a63070fd 100644 --- a/Encoding/VideoEncoder.vb +++ b/Encoding/VideoEncoder.vb @@ -177,7 +177,7 @@ Public MustInherit Class VideoEncoder End Using End Function - Sub LoadMuxer(profile As Profile) + Public Sub LoadMuxer(profile As Profile) Muxer = DirectCast(ObjectHelp.GetCopy(profile), Muxer) Muxer.Init() @@ -590,7 +590,7 @@ Class BatchEncoder End Class -Class NullEncoder +Public Class NullEncoder Inherits VideoEncoder Sub New() diff --git a/Forms/BatchAudioEncoderForm.vb b/Forms/BatchAudioEncoderForm.vb index 9efe6968..a634b3e7 100644 --- a/Forms/BatchAudioEncoderForm.vb +++ b/Forms/BatchAudioEncoderForm.vb @@ -306,7 +306,7 @@ Class BatchAudioEncoderForm EditControl.SetCommandLineDefaults() EditControl.Value = TempProfile.CommandLines - EditControl.SpecialMacrosFunction = AddressOf TempProfile.SolveMacros + EditControl.SpecialMacrosFunction = AddressOf TempProfile.ExpandMacros AddHandler EditControl.rtbEdit.TextChanged, AddressOf tbEditTextChanged diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index bec1a1f7..c0f42b19 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -1024,9 +1024,9 @@ Public Class MainForm If ObjectHelp.GetCompareString(g.SavedProject) <> ObjectHelp.GetCompareString(p) Then Using td As New TaskDialog(Of DialogResult) td.MainInstruction = "Save changed project?" - td.AddButton(DialogResult.Yes, "Save") - td.AddButton(DialogResult.No, "Don't Save") - td.AddButton(DialogResult.Cancel, "Cancel") + td.AddButton("Save", DialogResult.Yes) + td.AddButton("Don't Save", DialogResult.No) + td.AddButton("Cancel", DialogResult.Cancel) td.Show() Refresh() @@ -3384,7 +3384,7 @@ Public Class MainForm Case DynamicMenuItemID.EncoderProfiles g.PopulateProfileMenu(i.DropDownItems, s.VideoEncoderProfiles, AddressOf ShowEncoderProfilesDialog, AddressOf g.LoadVideoEncoder) Case DynamicMenuItemID.MuxerProfiles - g.PopulateProfileMenu(i.DropDownItems, s.MuxerProfiles, AddressOf ShowMuxerProfilesDialog, AddressOf LoadMuxer) + g.PopulateProfileMenu(i.DropDownItems, s.MuxerProfiles, AddressOf ShowMuxerProfilesDialog, AddressOf p.VideoEncoder.LoadMuxer) Case DynamicMenuItemID.Audio1Profiles g.PopulateProfileMenu(i.DropDownItems, s.AudioProfiles, Sub() ShowAudioProfilesDialog(0), AddressOf LoadAudioProfile0) Case DynamicMenuItemID.Audio2Profiles @@ -3825,11 +3825,24 @@ Public Class MainForm tb.Edit.Text = p.PreferredSubtitles tb.Edit.SaveAction = Sub(value) p.PreferredSubtitles = value + Dim tbm = ui.AddTextMenuBlock(subPage) + tbm.Label.Text = "Stream Name:" + tbm.Label.Tooltip = "Stream name used for muxing, may contain macros." + tbm.Edit.Text = p.SubtitleName + tbm.Edit.SaveAction = Sub(value) p.SubtitleName = value + tbm.AddMenu("Language English", "%language_english%") + tbm.AddMenu("Language Native", "%language_native%") + Dim subDemux = ui.AddMenuButtonBlock(Of DemuxMode)(subPage) subDemux.Label.Text = "Demux Subtitles:" subDemux.MenuButton.Value = p.DemuxSubtitles subDemux.MenuButton.SaveAction = Sub(value) p.DemuxSubtitles = value + Dim mb = ui.AddMenuButtonBlock(Of DefaultSubtitleMode)(subPage) + mb.Label.Text = "Default Subtitle:" + mb.MenuButton.Value = p.DefaultSubtitle + mb.MenuButton.SaveAction = Sub(value) p.DefaultSubtitle = value + cb = ui.AddCheckBox(subPage) cb.Text = "Convert Sup (PGS/Blu-ray) to IDX (Sub/VobSub/DVD)" cb.Tooltip = "Works only with demuxed subtitles." @@ -5073,7 +5086,7 @@ Public Class MainForm End Using End Sub - Private Sub LoadAudioProfile0(profile As Profile) + Public Sub LoadAudioProfile0(profile As Profile) Dim file = p.Audio0.File Dim delay = p.Audio0.Delay Dim language = p.Audio0.Language @@ -5093,7 +5106,7 @@ Public Class MainForm Assistant() End Sub - Private Sub LoadAudioProfile1(profile As Profile) + Public Sub LoadAudioProfile1(profile As Profile) Dim file = p.Audio1.File Dim delay = p.Audio1.Delay Dim language = p.Audio1.Language @@ -5255,10 +5268,6 @@ Public Class MainForm g.PopulateProfileMenu(AudioMenu1.Items, s.AudioProfiles, Sub() ShowAudioProfilesDialog(1), AddressOf LoadAudioProfile1) End Sub - Sub LoadMuxer(profile As Profile) - p.VideoEncoder.LoadMuxer(profile) - End Sub - Private Sub AviSynthListView_ScriptChanged() Handles AviSynthListView.Changed If Not IsLoading AndAlso Not AviSynthListView.IsLoading Then Package.DGDecodeNV.VerifyOK() @@ -5308,7 +5317,7 @@ Public Class MainForm Private Sub llContainer_Click() Handles llMuxer.Click ContainerMenu.Items.Clear() - g.PopulateProfileMenu(ContainerMenu.Items, s.MuxerProfiles, AddressOf ShowMuxerProfilesDialog, AddressOf LoadMuxer) + g.PopulateProfileMenu(ContainerMenu.Items, s.MuxerProfiles, AddressOf ShowMuxerProfilesDialog, AddressOf p.VideoEncoder.LoadMuxer) ContainerMenu.Show(llMuxer, 0, 16) End Sub diff --git a/Forms/eac3toForm.vb b/Forms/eac3toForm.vb index 13d46f3a..3025b4dd 100644 --- a/Forms/eac3toForm.vb +++ b/Forms/eac3toForm.vb @@ -770,6 +770,8 @@ Class eac3toForm Output = Output.Replace("(core: ", "(").Replace("(embedded: ", "(") For Each line In Output.SplitLinesNoEmpty + If line.Contains("Subtitle (DVB)") Then Continue For + Dim match = Regex.Match(line, "^(\d+): (.+)$") If match.Success Then @@ -781,7 +783,7 @@ Class eac3toForm If ms.Codec.Contains(",") Then ms.Codec = ms.Codec.Left(",") ms.IsVideo = ms.Codec.EqualsAny("h264/AVC", "VC-1", "MPEG2") - ms.IsAudio = ms.Codec.EqualsAny("DTS Master Audio", "DTS", "DTS-ES", "DTS Hi-Res", "DTS Express", "AC3", "AC3 EX", "AC3 Surround", "E-AC3", "E-AC3 EX", "E-AC3 Surround", "TrueHD/AC3", "TrueHD/AC3 (Atmos)", "RAW/PCM") + ms.IsAudio = ms.Codec.EqualsAny("DTS Master Audio", "DTS", "DTS-ES", "DTS Hi-Res", "DTS Express", "AC3", "AC3 EX", "AC3 Surround", "E-AC3", "E-AC3 EX", "E-AC3 Surround", "TrueHD/AC3", "TrueHD/AC3 (Atmos)", "RAW/PCM", "MP2") ms.IsSubtitle = ms.Codec.StartsWith("Subtitle") ms.IsChapters = ms.Codec.StartsWith("Chapters") diff --git a/General/ApplicationSettings.vb b/General/ApplicationSettings.vb index 2f0ce075..4854b892 100644 --- a/General/ApplicationSettings.vb +++ b/General/ApplicationSettings.vb @@ -366,7 +366,7 @@ Public Class ApplicationSettings End Function Sub UpdateRecentProjects(path As String) - If path = "" OrElse path.StartsWith(Folder.Template) OrElse path.EndsWith("crash.srip") Then Exit Sub + If path = "" OrElse path.StartsWith(Folder.Template) OrElse path.EndsWith("crash.srip") OrElse path.Ext = "bin" Then Exit Sub Dim list As New List(Of String) If File.Exists(path) Then list.Add(path) diff --git a/General/AudioProfile.vb b/General/AudioProfile.vb index 42b0997d..f947c64b 100644 --- a/General/AudioProfile.vb +++ b/General/AudioProfile.vb @@ -205,11 +205,11 @@ Public MustInherit Class AudioProfile Return targetDir + base + "_out" + track + "." + OutputFileType End Function - Function SolveMacros(value As String) As String - Return SolveMacros(value, True) + Function ExpandMacros(value As String) As String + Return ExpandMacros(value, True) End Function - Function SolveMacros(value As String, silent As Boolean) As String + Function ExpandMacros(value As String, silent As Boolean) As String If value = "" Then Return "" If value.Contains("""%input%""") Then value = value.Replace("""%input%""", File.Quotes) If value.Contains("%input%") Then value = value.Replace("%input%", File.Quotes) @@ -287,7 +287,7 @@ Public Class BatchAudioProfile End Property Function GetCode() As String - Dim cl = SolveMacros(CommandLines).Trim + Dim cl = ExpandMacros(CommandLines).Trim Return { Package.ffmpeg, @@ -403,7 +403,7 @@ Class NullAudioProfile End Class -Class MuxAudioProfile +Public Class MuxAudioProfile Inherits AudioProfile Sub New() @@ -665,7 +665,7 @@ Class GUIAudioProfile Dim bitrateBefore = p.VideoBitrate Dim targetPath = GetOutputFile() - For Each i In SolveMacros(CommandLines, False).SplitLinesNoEmpty + For Each i In ExpandMacros(CommandLines, False).SplitLinesNoEmpty Dim start = DateTime.Now Using proc As New Proc diff --git a/General/Demux.vb b/General/Demux.vb index eccc08d6..78895839 100644 --- a/General/Demux.vb +++ b/General/Demux.vb @@ -32,6 +32,24 @@ Public MustInherit Class Demuxer Next End Function + Public Function ShowConfigDialogInputExtensions() As DialogResult + Using f As New SimpleSettingsForm(Name) + f.Height = CInt(f.Height * 0.5) + Dim ui = f.SimpleUI + Dim page = ui.CreateFlowPage("main page") + + Dim tb = ui.AddTextBlock(page) + tb.Label.Text = "Supported Input File Types:" + tb.Edit.Text = InputExtensions.Join(" ") + tb.Edit.SaveAction = Sub(value) InputExtensions = value.ToLower.SplitNoEmptyAndWhiteSpace(",", ";", " ") + + Dim ret = f.ShowDialog() + If ret = DialogResult.OK Then ui.Save() + + Return ret + End Using + End Function + Shared Function GetDefaults() As List(Of Demuxer) Dim ret As New List(Of Demuxer) @@ -244,7 +262,7 @@ Class MP4BoxDemuxer End Class -Class eac3toDemuxer +Public Class eac3toDemuxer Inherits Demuxer Sub New() @@ -266,7 +284,7 @@ Class eac3toDemuxer proc.RemoveChars = {CChar(VB6.vbBack)} proc.Init("Demux M2TS using eac3to " + Package.eac3to.Version, "analyze: ", "process: ") proc.File = Package.eac3to.Path - proc.Arguments = f.GetArgs("""" + p.SourceFile + """", Filepath.GetBase(p.SourceFile)) + proc.Arguments = f.GetArgs(p.SourceFile.Quotes, p.SourceFile.Base) Try proc.Start() @@ -288,6 +306,16 @@ Class eac3toDemuxer End If End Using End Sub + + Public Overrides ReadOnly Property HasConfigDialog As Boolean + Get + Return True + End Get + End Property + + Public Overrides Function ShowConfigDialog() As DialogResult + Return ShowConfigDialogInputExtensions() + End Function End Class @@ -491,21 +519,7 @@ Public Class ffmpegDemuxer End Sub Public Overrides Function ShowConfigDialog() As DialogResult - Using f As New SimpleSettingsForm(Name) - f.Height = CInt(f.Height * 0.5) - Dim ui = f.SimpleUI - Dim page = ui.CreateFlowPage("main page") - - Dim tb = ui.AddTextBlock(page) - tb.Label.Text = "Supported Input File Types:" - tb.Edit.Text = InputExtensions.Join(" ") - tb.Edit.SaveAction = Sub(value) InputExtensions = value.ToLower.SplitNoEmptyAndWhiteSpace(",", ";", " ") - - Dim ret = f.ShowDialog() - If ret = DialogResult.OK Then ui.Save() - - Return ret - End Using + Return ShowConfigDialogInputExtensions() End Function Public Overrides ReadOnly Property HasConfigDialog As Boolean diff --git a/General/Misc.vb b/General/Misc.vb index dad2a85e..ded96c66 100644 --- a/General/Misc.vb +++ b/General/Misc.vb @@ -295,7 +295,7 @@ Public Class GlobalClass End Try End Sub - Sub LoadVideoEncoder(profile As Profile) + Public Sub LoadVideoEncoder(profile As Profile) Dim currentMuxer = p.VideoEncoder.Muxer p.VideoEncoder = DirectCast(ObjectHelp.GetCopy(profile), VideoEncoder) @@ -2836,6 +2836,35 @@ Public Class Subtitle ret.Add(st) End If + Dim enabledSubs = ret.Where(Function(val) val.Enabled) + + Select Case p.DefaultSubtitle + Case DefaultSubtitleMode.Single + If enabledSubs.Count = 1 Then enabledSubs(0).Default = True + Case DefaultSubtitleMode.First + If enabledSubs.Count > 0 Then enabledSubs(0).Default = True + Case DefaultSubtitleMode.Second + If enabledSubs.Count > 1 Then enabledSubs(1).Default = True + End Select + + For Each i In ret + If p.SubtitleName <> "" Then i.Title = p.SubtitleName + Next + + For Each i In ret + If p.DefaultSubtitle = DefaultSubtitleMode.English Then + If i.Language.TwoLetterCode = "en" Then + i.Default = True + Exit For + End If + ElseIf p.DefaultSubtitle = DefaultSubtitleMode.Native Then + If i.Language.TwoLetterCode = Language.CurrentCulture.TwoLetterCode Then + i.Default = True + Exit For + End If + End If + Next + Return ret End Function End Class @@ -2858,7 +2887,7 @@ Public Enum ContainerStreamType End Enum Class FileTypes - Shared Property Audio As String() = {"aac", "ac3", "dts", "dtsma", "dtshr", "dtshd", "eac3", "flac", "m4a", "mka", "mp2", "mp3", "mpa", "ogg", "opus", "thd", "thd+ac3", "true-hd", "truehd", "wav"} + Shared Property Audio As String() = {"aac", "ac3", "dts", "dtsma", "dtshr", "dtshd", "eac3", "flac", "m4a", "mka", "mp2", "mp3", "mpa", "opus", "thd", "thd+ac3", "true-hd", "truehd", "wav"} Shared Property VideoAudio As String() = {"avi", "mp4", "mkv", "divx", "flv", "mov", "mpeg", "mpg", "ts", "m2ts", "vob", "webm", "wmv", "pva", "ogg", "ogm"} Shared Property BeSweetInput As String() = {"wav", "mp2", "mpa", "mp3", "ac3", "ogg"} Shared Property DGDecNVInput As String() = {"264", "h264", "avc", "mkv", "mp4", "mpg", "vob", "ts", "m2ts", "mts", "m2t", "mpv", "m2v"} @@ -3067,7 +3096,7 @@ End Enum Public Enum DemuxMode Dialog - Preferred + Preferred All None End Enum @@ -5168,4 +5197,13 @@ Public Enum Symbol fa_youtube = &HF167 fa_youtube_play = &HF16A fa_youtube_square = &HF166 +End Enum + +Public Enum DefaultSubtitleMode + None + [Single] + First + Second + English + Native End Enum \ No newline at end of file diff --git a/General/Muxer.vb b/General/Muxer.vb index fe9d1374..f1784123 100644 --- a/General/Muxer.vb +++ b/General/Muxer.vb @@ -15,6 +15,14 @@ Public MustInherit Class Muxer MustOverride ReadOnly Property OutputExt As String + Sub New() + End Sub + + Sub New(name As String) + MyBase.New(name) + CanEditValue = True + End Sub + ReadOnly Property OutputExtFull As String Get Return "." + OutputExt @@ -27,14 +35,6 @@ Public MustInherit Class Muxer End Get End Property - Sub New() - End Sub - - Sub New(name As String) - MyBase.New(name) - CanEditValue = True - End Sub - Private AdditionalSwitchesValue As String Property AdditionalSwitches() As String @@ -54,10 +54,7 @@ Public MustInherit Class Muxer Property Subtitles() As List(Of Subtitle) Get - If SubtitlesValue Is Nothing Then - SubtitlesValue = New List(Of Subtitle) - End If - + If SubtitlesValue Is Nothing Then SubtitlesValue = New List(Of Subtitle) Return SubtitlesValue End Get Set(value As List(Of Subtitle)) @@ -71,6 +68,16 @@ Public MustInherit Class Muxer TimecodesFile = Nothing End Sub + Protected Sub ExpandMacros() + For Each i In Subtitles + If i.Title?.Contains("%") Then + If i.Title.Contains("%language_native%") Then i.Title = i.Title.Replace("%language_native%", i.Language.CultureInfo.NativeName) + If i.Title.Contains("%language_english%") Then i.Title = i.Title.Replace("%language_english%", i.Language.Name) + If i.Title.Contains("%") Then i.Title = Macro.Expand(i.Title) + End If + Next + End Sub + Overridable Function GetError() As String Return Nothing End Function @@ -169,7 +176,7 @@ Public MustInherit Class Muxer Dim ret As New List(Of Muxer) ret.Add(New MkvMuxer()) - ret.Add(New MP4Muxer("MP4")) + ret.Add(New MP4Muxer()) ret.Add(New ffmpegMuxer("AVI")) ret.Add(New WebMMuxer()) ret.Add(New DivXPluxMuxer()) @@ -181,9 +188,13 @@ Public MustInherit Class Muxer End Class -Class MP4Muxer +Public Class MP4Muxer Inherits Muxer + Sub New() + MyBase.New("MP4") + End Sub + Sub New(name As String) MyBase.New(name) End Sub @@ -227,6 +238,8 @@ Class MP4Muxer AddAudio(i, args) Next + ExpandMacros() + For Each i In Subtitles If i.Enabled AndAlso File.Exists(i.Path) Then If i.Path.Ext = "idx" Then @@ -263,7 +276,7 @@ Class MP4Muxer args.Append(":delay=" + ap.Delay.ToString) End If - args.Append(":name=" + ap.SolveMacros(ap.StreamName)) + args.Append(":name=" + ap.ExpandMacros(ap.StreamName)) args.Append("""") End If End Sub @@ -413,7 +426,7 @@ Class BatchMuxer End Class -Class MkvMuxer +Public Class MkvMuxer Inherits Muxer Property VideoTrackName As String = "" @@ -466,7 +479,9 @@ Class MkvMuxer Dim vID = -1 '-1 means all - args.Append(" --noaudio --nosubs --no-chapters --no-attachments --no-track-tags --no-global-tags") + If Not FileTypes.VideoOnly.Contains(p.VideoEncoder.OutputPath.Ext) Then + args.Append(" --noaudio --nosubs --no-chapters --no-attachments --no-track-tags --no-global-tags") + End If If VideoTrackLanguage.ThreeLetterCode <> "und" Then args.Append(" --language " & vID & ":" + VideoTrackLanguage.ThreeLetterCode) @@ -497,22 +512,26 @@ Class MkvMuxer AddAudioArgs(i, args) Next + ExpandMacros() + For Each i In Subtitles If i.Enabled AndAlso File.Exists(i.Path) Then Dim id = i.StreamOrder - If {"mkv", "mp4", "m2ts", "idx"}.Contains(Filepath.GetExt(i.Path)) Then + If FileTypes.VideoAudio.Contains(i.Path.Ext) Then args.Append(" --no-audio --no-video --no-chapters --no-attachments --no-track-tags --no-global-tags") args.Append(" --subtitle-tracks " & id) Else id = 0 End If + Dim isContainer = FileTypes.VideoAudio.Contains(i.Path.Ext) + args.Append(" --forced-track " & id & ":" & If(i.Forced, 1, 0)) args.Append(" --default-track " & id & ":" & If(i.Default, 1, 0)) args.Append(" --language " & id & ":" + i.Language.ThreeLetterCode) - args.Append(" --track-name """ & id & ":" + i.Title?.Trim.Replace("""", "'") + """") - args.Append(" """ + i.Path + """") + If isContainer OrElse i.Title <> "" Then args.Append(" --track-name """ & id & ":" + i.Title?.Trim.Replace("""", "'") + """") + args.Append(" " + i.Path.Quotes) End If Next @@ -564,7 +583,10 @@ Class MkvMuxer isCombo = ap.File.Ext = "thd+ac3" End If - args.Append(" --novideo --nosubs --no-chapters --no-attachments --no-track-tags --no-global-tags --audio-tracks " + If(isCombo, tid & "," & tid + 1, tid.ToString)) + Dim isAudioType = FileTypes.Audio.Contains(ap.File.Ext) + If Not isAudioType Then args.Append(" --novideo --nosubs --no-chapters --no-attachments --no-track-tags --no-global-tags") + + args.Append(" --audio-tracks " + If(isCombo, tid & "," & tid + 1, tid.ToString)) args.Append(" --language " & tid & ":" + ap.Language.ThreeLetterCode) If isCombo Then args.Append(" --language " & tid + 1 & ":" + ap.Language.ThreeLetterCode) @@ -573,8 +595,8 @@ Class MkvMuxer args.Append(" --aac-is-sbr " & tid) End If - args.Append(" --track-name """ & tid & ":" + ap.SolveMacros(ap.StreamName, False) + """") - If isCombo Then args.Append(" --track-name """ & tid + 1 & ":" + ap.SolveMacros(ap.StreamName, False).Replace("""", "'") + """") + If Not (isAudioType AndAlso ap.StreamName = "") Then args.Append(" --track-name """ & tid & ":" + ap.ExpandMacros(ap.StreamName, False) + """") + If isCombo Then args.Append(" --track-name """ & tid + 1 & ":" + ap.ExpandMacros(ap.StreamName, False).Replace("""", "'") + """") If ap.Delay <> 0 AndAlso Not ap.HandlesDelay AndAlso Not (ap.HasStream AndAlso ap.Stream.Delay <> 0) Then args.Append(" --sync " & tid & ":" + ap.Delay.ToString) diff --git a/General/Project.vb b/General/Project.vb index 71b590bd..55aff4a2 100644 --- a/General/Project.vb +++ b/General/Project.vb @@ -40,6 +40,7 @@ Public Class Project Public CutFrameRate As Double Public CuttingMode As CuttingMode Public DecodingMode As DecodingMode + Public DefaultSubtitle As DefaultSubtitleMode Public DefaultTargetFolder As String = "" Public DefaultTargetName As String = "" Public DeleteTempFilesDir As Boolean @@ -81,6 +82,7 @@ Public Class Project Public SourceSeconds As Integer Public SourceSize As Long Public SourceWidth As Integer = 720 + Public SubtitleName As String = "" Public TargetFrameRate As Double Public TargetHeight As Integer = 576 Public TargetSeconds As Integer = 5400 diff --git a/General/Scripting.vb b/General/Scripting.vb index 076e5482..79e43de1 100644 --- a/General/Scripting.vb +++ b/General/Scripting.vb @@ -1,26 +1,12 @@ Imports System.Management.Automation.Runspaces Imports System.Threading.Tasks -Imports Microsoft.CodeAnalysis.CSharp.Scripting -Imports Microsoft.CodeAnalysis.Scripting - Public Class Scripting Shared Sub RunCSharp(code As String) - RunCSharpAsync(code).Wait() + MsgError("C# scripting support was removed because it was very heavy requiring 47 nuget packages." + BR2 + + "You can port existing C# code to PowerShell or load and execute an C# Assembly with PowerShell." + BR2 + + "Visit the support forum.") End Sub - Private Shared Async Function RunCSharpAsync(code As String) As Task(Of Object) - Try - MsgWarn("C# scripting support will be removed, use PowerShell scripting instead.") - Dim options = ScriptOptions.Default.WithImports( - "StaxRip", "System.Linq", "System.IO", "System.Text.RegularExpressions"). - WithReferences(GetType(Scripting).Assembly, - GetType(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo).Assembly) - Await CSharpScript.Create(code, options).RunAsync() - Catch ex As Exception - g.ShowException(ex) - End Try - End Function - Shared Function RunPowershell(code As String) As Object Using runspace = RunspaceFactory.CreateRunspace() runspace.ApartmentState = Threading.ApartmentState.STA diff --git a/General/VideoScript.vb b/General/VideoScript.vb index a27d2d25..9170e3d1 100644 --- a/General/VideoScript.vb +++ b/General/VideoScript.vb @@ -554,7 +554,7 @@ Public Class FilterCategory ret.Add(misc) Dim field As New FilterCategory("Field") - field.Filters.Add(New VideoFilter(field.Name, "IVTC", "Telecide(guide = 1).Decimate()")) + field.Filters.Add(New VideoFilter(field.Name, "IVTC", "Telecide(guide = 1)" + BR + "Decimate()")) field.Filters.Add(New VideoFilter(field.Name, "TDeint", "TDeint()")) field.Filters.Add(New VideoFilter(field.Name, "FieldDeinterlace", "FieldDeinterlace()")) field.Filters.Add(New VideoFilter(field.Name, "SangNom2", "SangNom2()")) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index e56313ba..687ac50f 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/StaxRip.vbproj b/StaxRip.vbproj index 48da26b5..a327c602 100644 --- a/StaxRip.vbproj +++ b/StaxRip.vbproj @@ -36,7 +36,7 @@ StaxRip_TemporaryKey.pfx LocalIntranet 3.5 - v4.6.2 + v4.7 On @@ -107,18 +107,6 @@ MinimumRecommendedRules.ruleset - - packages\Microsoft.CodeAnalysis.Common.2.0.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll - - - packages\Microsoft.CodeAnalysis.CSharp.2.0.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll - - - packages\Microsoft.CodeAnalysis.CSharp.Scripting.2.0.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.Scripting.dll - - - packages\Microsoft.CodeAnalysis.Scripting.Common.2.0.0\lib\netstandard1.3\Microsoft.CodeAnalysis.Scripting.dll - Microsoft.VisualBasic @@ -126,93 +114,29 @@ System - - packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll - - - packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - packages\System.Console.4.3.0\lib\net46\System.Console.dll - 3.5 System.Data - - packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll - - - packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll - System.DirectoryServices System.Drawing - - packages\System.IO.4.3.0\lib\net462\System.IO.dll - - - packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll - - - packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll - - - packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll - packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.0.0\lib\net4\System.Management.Automation.dll True - - packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll - - - packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll - - - packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll - - - packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll - - - packages\System.Runtime.InteropServices.4.3.0\lib\net462\System.Runtime.InteropServices.dll - System.Security - - packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll - - - packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - - - packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - - packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - - - packages\System.Text.Encoding.CodePages.4.3.0\lib\net46\System.Text.Encoding.CodePages.dll - - - packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll - - - packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll - System.Web.Services @@ -226,18 +150,6 @@ 3.5 - - packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll - - - packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll - - - packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll - - - packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll - 3.0 @@ -697,10 +609,6 @@ - - - - diff --git a/UI/TaskDialog.vb b/UI/TaskDialog.vb index 6c90bd93..895a7558 100644 --- a/UI/TaskDialog.vb +++ b/UI/TaskDialog.vb @@ -249,7 +249,8 @@ Public Class TaskDialog(Of T) #End Region #Region "Methods" - Sub AddButton(value As T, text As String) + + Sub AddButton(text As String, value As T) Dim id = 1000 + IdValueDic.Count + 1 IdValueDic(id) = value Buttons.Add(New TASKDIALOG_BUTTON(id, text)) diff --git a/app.config b/app.config index c015467f..14ba62dd 100644 --- a/app.config +++ b/app.config @@ -1,81 +1,9 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/md/test-build.md b/md/test-build.md index e48e8509..3ee35058 100644 --- a/md/test-build.md +++ b/md/test-build.md @@ -6,6 +6,16 @@ https://drive.google.com/open?id=0B-gPKiJYuKuITld4dzhuTC1WWWM https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPmEFNI&ithint=folder%2c7z +#### Removed Features + +- C# scripting support was removed because it was very heavy requiring 47 nuget packages. You can port existing C# code to PowerShell or load and execute an C# Assembly with PowerShell. Visit the support forum. + +#### Requirements + +- .NET 4.7 is required. Win 7 is fully supported! + +https://blogs.msdn.microsoft.com/dotnet/2017/05/02/announcing-the-net-framework-4-7-general-availability/ + #### New Features - MPEG2DecPlus filter added to open d2v files with AviSynth+ @@ -31,6 +41,9 @@ https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPm - added option to encode audio with the channels count of the audio source file - added support for VirtualDub frame server files with vdr extension - ffmpeg demuxing GUI added, only audio is supported so far, input types can be configured in the settings, default is avi, ts, flv +- added new powershell script for re-muxing +- added option to define a default subtitle name +- added option to enable a default subtitle #### Fixed Bugs @@ -72,6 +85,7 @@ https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPm - up/down menu items for the avs/vs filter list in main dialog - x265 --limit-tu defaults for slower and veryslow presets updated - in case the AviSynth script contains AudioDub the avs file can be selected as audio source file in the audio context menu +- simplified mkvmerge command line #### Updated Tools @@ -94,8 +108,8 @@ https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPm - VSFilterMod (avs, vs) 4 - flash3kyuu_deband (avs, vs) 2.0.20140721 - TIVTC (avs) 1.0.6 -- x265 2.4+2 - mvtools2 (avs) 2.7.16.22 - masktools2 2.2.7 - yadifmod (vs) 10 -- mkvtoolnix 11.0.0 \ No newline at end of file +- mkvtoolnix 11.0.0 +- x265 2.4+14 \ No newline at end of file diff --git a/packages.config b/packages.config index f1ab8e77..b4ef22eb 100644 --- a/packages.config +++ b/packages.config @@ -1,51 +1,4 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file