diff --git a/Encoding/VideoEncoder.vb b/Encoding/VideoEncoder.vb index da32e614..22f44b2a 100644 --- a/Encoding/VideoEncoder.vb +++ b/Encoding/VideoEncoder.vb @@ -542,7 +542,7 @@ Class BatchEncoder Exit Sub End If - If Not Paths.VerifyRequirements Then Exit Sub + If Not g.VerifyRequirements Then Exit Sub If Not g.IsValidSource Then Exit Sub ProcessForm.ShowForm() diff --git a/Encoding/x264.vb b/Encoding/x264.vb index 4118b824..2cafb268 100644 --- a/Encoding/x264.vb +++ b/Encoding/x264.vb @@ -76,7 +76,7 @@ Public Class x264Encoder End Sub Overrides Sub RunCompCheck() - If Not Paths.VerifyRequirements Then Exit Sub + If Not g.VerifyRequirements Then Exit Sub If Not g.IsValidSource Then Exit Sub Dim enc As New x264Encoder diff --git a/Encoding/x265.vb b/Encoding/x265.vb index 0a946060..21f93263 100644 --- a/Encoding/x265.vb +++ b/Encoding/x265.vb @@ -76,7 +76,7 @@ Public Class x265Encoder End Sub Overrides Sub RunCompCheck() - If Not Paths.VerifyRequirements Then Exit Sub + If Not g.VerifyRequirements Then Exit Sub If Not g.IsValidSource Then Exit Sub Dim newParams As New x265Params diff --git a/Forms/AppsForm.vb b/Forms/AppsForm.vb index 353b3329..4275bf56 100644 --- a/Forms/AppsForm.vb +++ b/Forms/AppsForm.vb @@ -165,7 +165,7 @@ Class AppsForm #End Region - Private ActivePackage As Package + Private CurrentPackage As Package Private Directories As New Hashtable Private Nodes As New List(Of TreeNode) Private ControlDic As New Dictionary(Of String, Control) @@ -198,7 +198,7 @@ Class AppsForm SetupButton.TextImageRelation = TextImageRelation.ImageBeforeText SetupButton.Image = StockIcon.GetSmallImage(StockIconIdentifier.Shield) - AddHandler DownloadButton.Click, Sub() g.ShellExecute(ActivePackage.DownloadURL) + AddHandler DownloadButton.Click, Sub() g.ShellExecute(CurrentPackage.DownloadURL) DownloadButton.AutoSize = True DownloadButton.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink @@ -219,35 +219,35 @@ Class AppsForm End Sub Sub ShowActivePackage() - Dim path = ActivePackage.Path + Dim path = CurrentPackage.Path - Headers("Title").Text = ActivePackage.Name + Headers("Title").Text = CurrentPackage.Name - SetupButton.Text = "Install " + ActivePackage.Name - SetupButton.Visible = Not ActivePackage.SetupAction Is Nothing AndAlso (ActivePackage.IsStatusCritical OrElse (Not ActivePackage.IsCorrectVersion AndAlso ActivePackage.Version <> "")) + SetupButton.Text = "Install " + CurrentPackage.Name + SetupButton.Visible = CurrentPackage.SetupFilename <> "" AndAlso (CurrentPackage.IsStatusCritical OrElse (Not CurrentPackage.IsCorrectVersion AndAlso CurrentPackage.Version <> "")) - DownloadButton.Text = "Download " + ActivePackage.Name - DownloadButton.Visible = ActivePackage.DownloadURL <> "" AndAlso (ActivePackage.IsStatusCritical OrElse (Not ActivePackage.IsCorrectVersion AndAlso ActivePackage.Version <> "")) + DownloadButton.Text = "Download " + CurrentPackage.Name + DownloadButton.Visible = CurrentPackage.DownloadURL <> "" AndAlso (CurrentPackage.IsStatusCritical OrElse (Not CurrentPackage.IsCorrectVersion AndAlso CurrentPackage.Version <> "")) tsbOpenDir.Enabled = path <> "" - tsbLaunch.Enabled = Not ActivePackage.StartAction Is Nothing AndAlso Not ActivePackage.IsStatusCritical - tsbWebsite.Enabled = ActivePackage.WebURL <> "" - tsbHelp.Enabled = ActivePackage.GetHelpPath <> "" + tsbLaunch.Enabled = Not CurrentPackage.StartAction Is Nothing AndAlso Not CurrentPackage.IsStatusCritical + tsbWebsite.Enabled = CurrentPackage.WebURL <> "" + tsbHelp.Enabled = CurrentPackage.GetHelpPath <> "" - s.StringDictionary("RecentExternalApplicationControl") = ActivePackage.Name + s.StringDictionary("RecentExternalApplicationControl") = CurrentPackage.Name flp.SuspendLayout() - Contents("Status").Text = ActivePackage.GetStatusDisplay() + Contents("Status").Text = CurrentPackage.GetStatusDisplay() Contents("Location").Text = path - Contents("Version").Text = ActivePackage.Version - Contents("Description").Text = ActivePackage.Description + Contents("Version").Text = CurrentPackage.Version + Contents("Description").Text = CurrentPackage.Description Contents("Location").Visible = path <> "" Headers("Location").Visible = path <> "" - Contents("Version").Visible = ActivePackage.Version <> "" - Headers("Version").Visible = ActivePackage.Version <> "" + Contents("Version").Visible = CurrentPackage.Version <> "" + Headers("Version").Visible = CurrentPackage.Version <> "" Headers("AviSynth Filters").Visible = False Contents("AviSynth Filters").Visible = False @@ -258,8 +258,8 @@ Class AppsForm Headers("Filters").Visible = False Contents("Filters").Visible = False - If TypeOf ActivePackage Is PluginPackage Then - Dim plugin = DirectCast(ActivePackage, PluginPackage) + If TypeOf CurrentPackage Is PluginPackage Then + Dim plugin = DirectCast(CurrentPackage, PluginPackage) If Not plugin.AviSynthFilterNames Is Nothing AndAlso Not plugin.VapourSynthFilterNames Is Nothing Then @@ -302,7 +302,7 @@ Class AppsForm End Sub Sub RunSetup() - ActivePackage.SetupAction.Invoke() + g.ShellExecute(Folder.Apps + CurrentPackage.SetupFilename) ShowActivePackage() End Sub @@ -320,8 +320,8 @@ Class AppsForm If Not tn Is Nothing AndAlso Not tn.Tag Is Nothing Then Dim newPackage = DirectCast(tn.Tag, Package) - If Not newPackage Is ActivePackage Then - ActivePackage = newPackage + If Not newPackage Is CurrentPackage Then + CurrentPackage = newPackage ShowActivePackage() End If End If @@ -347,27 +347,27 @@ Class AppsForm Select Case e.KeyData Case Keys.F11 Using d As New OpenFileDialog - d.SetInitDir(s.Storage.GetString(ActivePackage.Name + "custom path")) + d.SetInitDir(s.Storage.GetString(CurrentPackage.Name + "custom path")) - If Not ActivePackage.Filenames.NothingOrEmpty Then - d.Filter = "|" + ActivePackage.Filenames.Join(";") + "|All Files|*.*" + If Not CurrentPackage.Filenames.NothingOrEmpty Then + d.Filter = "|" + CurrentPackage.Filenames.Join(";") + "|All Files|*.*" Else - d.Filter = "|" + ActivePackage.Filename + "|All Files|*.*" + d.Filter = "|" + CurrentPackage.Filename + "|All Files|*.*" End If If d.ShowDialog = DialogResult.OK Then - s.Storage.SetString(ActivePackage.Name + "custom path", d.FileName) + s.Storage.SetString(CurrentPackage.Name + "custom path", d.FileName) End If End Using Case Keys.F12 - If Not File.Exists(ActivePackage.Path) Then Exit Sub + If Not File.Exists(CurrentPackage.Path) Then Exit Sub - Dim input = InputBox.Show("What's the name of this version?", "StaxRip", ActivePackage.Version) + Dim input = InputBox.Show("What's the name of this version?", "StaxRip", CurrentPackage.Version) If input <> "" Then input = input.Replace(";", "_") - ActivePackage.Version = input - ActivePackage.VersionDate = File.GetLastWriteTimeUtc(ActivePackage.Path) + CurrentPackage.Version = input + CurrentPackage.VersionDate = File.GetLastWriteTimeUtc(CurrentPackage.Path) Dim txt = Application.ProductVersion + BR2 @@ -379,12 +379,12 @@ Class AppsForm Next Try - txt.FormatColumn("=").WriteUTF8File(CommonDirs.Startup + "Apps\Versions.txt") + txt.FormatColumn("=").WriteUTF8File(Folder.Startup + "Apps\Versions.txt") Catch End Try Try - txt.FormatColumn("=").WriteUTF8File(Paths.SettingsDir + "Versions.txt") + txt.FormatColumn("=").WriteUTF8File(Folder.Settings + "Versions.txt") Catch ex As Exception g.ShowException(ex) End Try @@ -442,19 +442,19 @@ Class AppsForm End Sub Private Sub tsbLaunch_Click(sender As Object, e As EventArgs) Handles tsbLaunch.Click - ActivePackage.StartAction.Invoke() + CurrentPackage.StartAction.Invoke() End Sub Private Sub tsbOpenDir_Click(sender As Object, e As EventArgs) Handles tsbOpenDir.Click - g.OpenDirAndSelectFile(ActivePackage.Path, Handle) + g.OpenDirAndSelectFile(CurrentPackage.Path, Handle) End Sub Private Sub tsbHelp_Click(sender As Object, e As EventArgs) Handles tsbHelp.Click - g.ShellExecute(ActivePackage.GetHelpPath) + g.ShellExecute(CurrentPackage.GetHelpPath) End Sub Private Sub tsbWebsite_Click(sender As Object, e As EventArgs) Handles tsbWebsite.Click - g.ShellExecute(ActivePackage.WebURL) + g.ShellExecute(CurrentPackage.WebURL) End Sub End Class \ No newline at end of file diff --git a/Forms/HelpForm.vb b/Forms/HelpForm.vb index ae6343a1..dd4acf3a 100644 --- a/Forms/HelpForm.vb +++ b/Forms/HelpForm.vb @@ -64,7 +64,7 @@ Class HelpForm Property Doc() As HelpDocument Get If DocumentValue Is Nothing Then - Dim path = CommonDirs.Temp + Guid.NewGuid.ToString + ".htm" + Dim path = Folder.Temp + Guid.NewGuid.ToString + ".htm" AddHandler g.MainForm.Disposed, Sub() FileHelp.Delete(path) DocumentValue = New HelpDocument(path) End If @@ -126,7 +126,7 @@ Class HelpForm Shared ReadOnly Property MainImagePath() As String Get - Dim filepath = CommonDirs.Temp + Guid.NewGuid.ToString + ".gif" + Dim filepath = Folder.Temp + Guid.NewGuid.ToString + ".gif" If Not File.Exists(filepath) Then AddHandler g.MainForm.Disposed, Sub() FileHelp.Delete(filepath) @@ -139,7 +139,7 @@ Class HelpForm Shared ReadOnly Property BackgroundImagePath() As String Get - Dim filepath = CommonDirs.Temp + Guid.NewGuid.ToString + ".gif" + Dim filepath = Folder.Temp + Guid.NewGuid.ToString + ".gif" If Not File.Exists(filepath) Then AddHandler g.MainForm.Disposed, Sub() FileHelp.Delete(filepath) diff --git a/Forms/JobsForm.vb b/Forms/JobsForm.vb index 640821b5..97982fcc 100644 --- a/Forms/JobsForm.vb +++ b/Forms/JobsForm.vb @@ -147,7 +147,7 @@ Friend Class JobsForm lv.SelectFirst() UpdateControls() - FileWatcher.Path = Paths.SettingsDir + FileWatcher.Path = Folder.Settings FileWatcher.NotifyFilter = NotifyFilters.LastWrite Or NotifyFilters.CreationTime FileWatcher.Filter = "Jobs.dat" AddHandler FileWatcher.Changed, AddressOf Reload @@ -211,7 +211,7 @@ Friend Class JobsForm While True Try - Using stream As New FileStream(Paths.SettingsDir + "Jobs.dat", + Using stream As New FileStream(Folder.Settings + "Jobs.dat", FileMode.Create, FileAccess.ReadWrite, FileShare.None) @@ -230,7 +230,7 @@ Friend Class JobsForm Shared Function GetJobs() As List(Of StringBooleanPair) Dim formatter As New BinaryFormatter - Dim jobsPath = Paths.SettingsDir + "Jobs.dat" + Dim jobsPath = Folder.Settings + "Jobs.dat" Dim counter As Integer If File.Exists(jobsPath) Then diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index 0bcd9546..b8e9f394 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -796,7 +796,7 @@ Public Class MainForm Try s = DirectCast(SafeSerialization.Deserialize(New ApplicationSettings, - Paths.SettingsFile, + g.SettingsFile, New LegacySerializationBinder), ApplicationSettings) Catch ex As Exception g.ShowException(ex) @@ -856,7 +856,7 @@ Public Class MainForm UpdateDynamicMenu() UpdateAudioMenu() MenuStrip.ResumeLayout() - OpenProject(Paths.StartupTemplatePath) + OpenProject(g.StartupTemplatePath) SizeContextMenuStrip.SuspendLayout() CustomSizeMenu = New CustomMenu(AddressOf GetDefaultMenuSize, @@ -1061,7 +1061,7 @@ Public Class MainForm Await Task.Run(Sub() Dim list As New List(Of String) - If path <> "" AndAlso Not path.Contains(Paths.TemplateDir) AndAlso + If path <> "" AndAlso Not path.Contains(Folder.Template) AndAlso Not path.Contains("crash.srip") Then list.Add(path) @@ -1147,12 +1147,12 @@ Public Class MainForm For Each menuItem In CustomMainMenu.MenuItems If menuItem.CustomMenuItem.MethodName = "DynamicMenuItem" Then If menuItem.CustomMenuItem.Parameters(0).Equals(DynamicMenuItemID.Scripts) Then - If Directory.Exists(CommonDirs.Startup + "Apps\Scripts") Then - For Each script In Directory.GetFiles(CommonDirs.Startup + "Apps\Scripts") + If Directory.Exists(Folder.Startup + "Apps\Scripts") Then + For Each script In Directory.GetFiles(Folder.Startup + "Apps\Scripts") If Not s.Storage.GetBool(script.FileName) AndAlso - Not File.Exists(Paths.ScriptDir + script.FileName) Then + Not File.Exists(Folder.Script + script.FileName) Then - FileHelp.Copy(script, Paths.ScriptDir + script.FileName) + FileHelp.Copy(script, Folder.Script + script.FileName) s.Storage.SetBool(script.FileName, True) UpdateScriptsMenu() End If @@ -1161,14 +1161,14 @@ Public Class MainForm menuItem.DropDownItems.Clear() - For Each path In Directory.GetFiles(Paths.ScriptDir) + For Each path In Directory.GetFiles(Folder.Script) ActionMenuItem.Add(menuItem.DropDownItems, path.FileName, Sub() g.DefaultCommands.ExecuteScriptFile(path)) Next menuItem.DropDownItems.Add(New ToolStripSeparator) - ActionMenuItem.Add(menuItem.DropDownItems, "Open Scripts Folder", Sub() g.ShellExecute(Paths.ScriptDir)) + ActionMenuItem.Add(menuItem.DropDownItems, "Open Scripts Folder", Sub() g.ShellExecute(Folder.Script)) End If End If Next @@ -1181,19 +1181,19 @@ Public Class MainForm i.DropDownItems.Clear() - For Each i2 In Directory.GetFiles(Paths.TemplateDir, "*.srip.backup") + For Each i2 In Directory.GetFiles(Folder.Template, "*.srip.backup") FileHelp.Move(i2, Filepath.GetDir(i2) + "Backup\" + Filepath.GetBase(i2)) Next - For Each i2 In Directory.GetFiles(Paths.TemplateDir, "*.srip", SearchOption.AllDirectories) + For Each i2 In Directory.GetFiles(Folder.Template, "*.srip", SearchOption.AllDirectories) Dim base = Filepath.GetBase(i2) - If i2 = Paths.StartupTemplatePath Then base += " (Startup)" + If i2 = g.StartupTemplatePath Then base += " (Startup)" If i2.Contains("Backup\") Then base = "Backup | " + base ActionMenuItem.Add(i.DropDownItems, base, AddressOf LoadProject, i2, Nothing) Next i.DropDownItems.Add("-") - ActionMenuItem.Add(i.DropDownItems, "Explore", Sub() g.ShellExecute(Paths.TemplateDir), "Opens the directory containing the templates.") + ActionMenuItem.Add(i.DropDownItems, "Explore", Sub() g.ShellExecute(Folder.Template), "Opens the directory containing the templates.") ActionMenuItem.Add(i.DropDownItems, "Restore", AddressOf ResetTemplates, "Restores the default templates.") Exit For @@ -1204,8 +1204,8 @@ Public Class MainForm Sub ResetTemplates() If MsgQuestion("Restore the default templates?") = DialogResult.OK Then Try - DirectoryHelp.Delete(Paths.TemplateDir) - Paths.TemplateDir.ToString() + DirectoryHelp.Delete(Folder.Template) + Folder.Template.ToString() UpdateTemplatesMenu() Catch ex As Exception g.ShowException(ex) @@ -1215,7 +1215,7 @@ Public Class MainForm Sub LoadTemplate(name As String) - LoadProject(Paths.TemplateDir + name + ".srip") + LoadProject(Folder.Template + name + ".srip") End Sub Sub LoadProject(path As String) @@ -1285,7 +1285,7 @@ Public Class MainForm SetBindings(p, False) - If Not File.Exists(path) Then path = Paths.StartupTemplatePath + If Not File.Exists(path) Then path = g.StartupTemplatePath Dim safeInstance = New Project safeInstance.Init() @@ -1303,7 +1303,7 @@ Public Class MainForm Text = Application.ProductName + " x64 - " + Filepath.GetBase(path) SkipAssistant = True - If path.StartsWith(Paths.TemplateDir) Then + If path.StartsWith(Folder.Template) Then g.ProjectPath = Nothing p.TemplateName = Filepath.GetBase(path) Else @@ -1511,7 +1511,7 @@ Public Class MainForm Sub OpenVideoSourceFiles(files As IEnumerable(Of String), isNotEncoding As Boolean) Dim recoverPath = g.ProjectPath - Dim recoverProjectPath = CommonDirs.Temp + Guid.NewGuid.ToString + ".bin" + Dim recoverProjectPath = Folder.Temp + Guid.NewGuid.ToString + ".bin" Dim recoverText = Text SafeSerialization.Serialize(p, recoverProjectPath) @@ -1547,7 +1547,7 @@ Public Class MainForm Next If p.SourceFile <> "" AndAlso isNotEncoding Then - Dim templates = Directory.GetFiles(Paths.TemplateDir, "*.srip") + Dim templates = Directory.GetFiles(Folder.Template, "*.srip") If templates.Length = 1 Then If Not OpenProject(templates(0), True) Then Throw New AbortException @@ -1555,7 +1555,7 @@ Public Class MainForm If s.ShowTemplateSelection Then If Not LoadTemplateWithSelectionDialog() Then Throw New AbortException Else - If Not OpenProject(Paths.StartupTemplatePath, True) Then Throw New AbortException + If Not OpenProject(g.StartupTemplatePath, True) Then Throw New AbortException End If End If End If @@ -1602,7 +1602,7 @@ Public Class MainForm preferredSourceFilter.Script) End If - If Not Paths.VerifyRequirements() Then Throw New AbortException + If Not g.VerifyRequirements() Then Throw New AbortException g.SetTempDir() p.LastOriginalSourceFile = p.SourceFile @@ -2025,6 +2025,8 @@ Public Class MainForm ExtractForcedVobSubSubtitles() p.VideoEncoder.Muxer.Init() + If p.HarcodedSubtitle Then g.AddHardcodedSubtitle() + Dim crop = p.Script.IsFilterActive("Crop") If crop Then @@ -2707,7 +2709,7 @@ Public Class MainForm End If If Not (MouseButtons = MouseButtons.Left AndAlso ActiveControl Is tbResize) Then - If Not p.Script.GetErrorMessage Is Nothing AndAlso Not Paths.VerifyRequirements Then + If Not p.Script.GetErrorMessage Is Nothing AndAlso Not g.VerifyRequirements Then If ProcessTip(p.Script.GetErrorMessage) Then CanIgnoreTip = False gbAssistant.Text = "Script Error" @@ -2794,7 +2796,7 @@ Public Class MainForm p.SkippedAssistantTips.Add(CurrentAssistantTipKey) End If - If Not Paths.VerifyRequirements() Then + If Not g.VerifyRequirements() Then Exit Sub End If @@ -2989,7 +2991,7 @@ Public Class MainForm Dim td As New TaskDialog(Of String) td.MainInstruction = "Please select a template" - For Each i In Directory.GetFiles(Paths.TemplateDir, "*.srip") + For Each i In Directory.GetFiles(Folder.Template, "*.srip") td.AddCommandLink(Filepath.GetBase(i), i) Next @@ -3035,7 +3037,7 @@ Public Class MainForm mb.Label.Tooltip = "Template loaded when StaxRip starts." mb.MenuButton.Value = s.StartupTemplate mb.MenuButton.SaveAction = Sub(value) s.StartupTemplate = value - mb.MenuButton.Add(From i In Directory.GetFiles(Paths.TemplateDir) Select Filepath.GetBase(i)) + mb.MenuButton.Add(From i In Directory.GetFiles(Folder.Template) Select Filepath.GetBase(i)) Dim num = ui.AddNumericBlock(generalPage) num.Label.Text = "UI Scale Factor:" @@ -3205,7 +3207,7 @@ Public Class MainForm path = Macro.Solve(path) - If path.StartsWith(Paths.TemplateDir) Then + If path.StartsWith(Folder.Template) Then If p.SourceFile <> "" Then MsgWarn("A template cannot be created after a source file was opened.") Exit Sub @@ -3240,7 +3242,7 @@ Public Class MainForm If b.Show = DialogResult.OK Then p.TemplateName = b.Value.RemoveChars(Path.GetInvalidFileNameChars) - SaveProjectPath(Paths.TemplateDir + p.TemplateName + ".srip") + SaveProjectPath(Folder.Template + p.TemplateName + ".srip") UpdateTemplatesMenu() If b.Checked Then @@ -3356,7 +3358,7 @@ Public Class MainForm If p.SourceFile = "" Then ShowOpenSourceDialog() Else - If Not Paths.VerifyRequirements Then Exit Sub + If Not g.VerifyRequirements Then Exit Sub If Not g.IsValidSource Then Exit Sub If Not g.EnableFilter("Crop") Then @@ -3381,7 +3383,7 @@ Public Class MainForm If p.SourceFile = "" Then ShowOpenSourceDialog() Else - If Not Paths.VerifyRequirements OrElse Not g.IsValidSource Then + If Not g.VerifyRequirements OrElse Not g.IsValidSource Then Exit Sub End If @@ -3436,12 +3438,12 @@ Public Class MainForm Sub ClearJobs() - FileHelp.Delete(Paths.SettingsDir + "Jobs.dat") + FileHelp.Delete(Folder.Settings + "Jobs.dat") End Sub Sub StartJobs() - If Not Paths.VerifyRequirements() Then Exit Sub + If Not g.VerifyRequirements() Then Exit Sub g.SaveSettings() RunJobRecursive() OpenProject(g.ProjectPath, False) @@ -3472,7 +3474,7 @@ Public Class MainForm If moreJobsToProcessInTempDir.Count = 0 Then Dim tempDir = p.TempDir - OpenProject(Paths.StartupTemplatePath, False) + OpenProject(g.StartupTemplatePath, False) MediaInfo.ClearCache() If s.DeleteTempFilesToRecycleBin Then @@ -3552,7 +3554,7 @@ Public Class MainForm End Sub Sub AddJob(showConfirmation As Boolean, templateName As String, showAssistant As Boolean) - If Not Paths.VerifyRequirements() Then Exit Sub + If Not g.VerifyRequirements() Then Exit Sub If showAssistant AndAlso Not IsLoading AndAlso Not g.MainForm.AssistantPassed Then MsgWarn("Please follow the assistant.") @@ -3564,7 +3566,7 @@ Public Class MainForm JobsForm.AddJob(path) If showConfirmation Then MsgInfo("Job added") - If templateName <> "" Then LoadProject(Paths.TemplateDir + templateName + ".srip") + If templateName <> "" Then LoadProject(Folder.Template + templateName + ".srip") End Sub @@ -3790,6 +3792,12 @@ Public Class MainForm cb.Checked = p.ConvertSup2Sub cb.SaveAction = Sub(value) p.ConvertSup2Sub = value + cb = ui.AddCheckBox(subPage) + cb.Text = "Add hard coded subtitle" + cb.Tooltip = "Automatically hardcodes a subtitle." + BR2 + "Supported formats are SRT, ASS and VobSub." + cb.Checked = p.HarcodedSubtitle + cb.SaveAction = Sub(value) p.HarcodedSubtitle = value + subPage.ResumeLayout() Dim pathPage = ui.CreateFlowPage("Paths") @@ -3802,7 +3810,7 @@ Public Class MainForm tm.Expand(tm.Edit) tm.Edit.Text = p.DefaultTargetFolder tm.Edit.SaveAction = Sub(value) p.DefaultTargetFolder = value - tm.AddMenu("Edit...", Function() Paths.BrowseFolder(p.DefaultTargetFolder)) + tm.AddMenu("Edit...", Function() g.BrowseFolder(p.DefaultTargetFolder)) tm.AddMenu("Directory of source file", "%source_dir%") tm.AddMenu("Parent directory of source file directory", "%source_dir_parent%") @@ -3823,7 +3831,7 @@ Public Class MainForm l.MarginTop = Font.Height Dim tempDirFunc = Function() - Dim tempDir = Paths.BrowseFolder(p.TempDir) + Dim tempDir = g.BrowseFolder(p.TempDir) If tempDir <> "" Then Return DirPath.AppendSeparator(tempDir) + "%source_name%_temp" End Function @@ -4259,7 +4267,7 @@ Public Class MainForm ret.Add("Tools|Advanced|Video Comparison...", NameOf(ShowVideoComparison)) ret.Add("Tools|Advanced|Command Prompt...", NameOf(ShowCommandPrompt)) ret.Add("Tools|Advanced|Event Commands...", NameOf(ShowEventCommandsDialog)) - ret.Add("Tools|Advanced|Hardcoded Subtitle...", NameOf(ShowHardcodedSubtitleDialog), Keys.Control Or Keys.H) + ret.Add("Tools|Advanced|Hard Coded Subtitle...", NameOf(ShowHardcodedSubtitleDialog), Keys.Control Or Keys.H) ret.Add("Tools|Advanced|LAV Filters video decoder configuration...", NameOf(ShowLAVFiltersConfigDialog)) ret.Add("Tools|Advanced|MediaInfo Folder View...", NameOf(ShowMediaInfoFolderViewDialog)) ret.Add("Tools|Advanced|Reset Setting...", NameOf(ResetSettings)) @@ -4346,20 +4354,7 @@ Public Class MainForm sb.SelectedItem.IndexIDX.ToString).WriteANSIFile(d.FileName) End If - Dim filter As New VideoFilter - - filter.Category = "Subtitle" - filter.Path = Filepath.GetName(d.FileName) - filter.Active = True - - If Filepath.GetExtFull(d.FileName) = ".idx" Then - filter.Script = "VobSub(""" + d.FileName + """)" - Else - filter.Script = "TextSubMod(""" + d.FileName + """)" - End If - - Dim insertCat = If(p.Script.IsFilterActive("Crop"), "Crop", "Source") - p.Script.InsertAfter(insertCat, filter) + p.AddHardcodedSubtitleFilter(d.FileName) End If End Using End Sub @@ -4823,7 +4818,7 @@ Public Class MainForm Exit Sub End If - Dim tempPath = Paths.TemplateDir + "temp.srip" + Dim tempPath = Folder.Template + "temp.srip" p.BatchMode = Not f.cbDemuxAndIndex.Checked p.NoDialogs = f.cbDemuxAndIndex.Checked SaveProjectPath(tempPath) @@ -4853,7 +4848,7 @@ Public Class MainForm Exit Sub End If - Dim tempPath = Paths.TemplateDir + "temp.srip" + Dim tempPath = Folder.Template + "temp.srip" If f.cbDemuxAndIndex.Checked Then p.BatchMode = True @@ -5611,7 +5606,7 @@ Public Class MainForm End If Next - Dim batchPath = CommonDirs.Temp + Guid.NewGuid.ToString + ".bat" + Dim batchPath = Folder.Temp + Guid.NewGuid.ToString + ".bat" File.WriteAllText(batchPath, batchCode, Encoding.GetEncoding(850)) AddHandler g.MainForm.Disposed, Sub() FileHelp.Delete(batchPath) diff --git a/Forms/VideoComparisonForm.vb b/Forms/VideoComparisonForm.vb index 5cfbb4ac..4e5bcc6a 100644 --- a/Forms/VideoComparisonForm.vb +++ b/Forms/VideoComparisonForm.vb @@ -240,7 +240,7 @@ Class VideoComparisonForm Dim avs As New VideoScript avs.Engine = ScriptEngine.AviSynth - avs.Path = CommonDirs.Temp + Guid.NewGuid.ToString + ".avs" + avs.Path = Folder.Temp + Guid.NewGuid.ToString + ".avs" AddHandler Disposed, Sub() FileHelp.Delete(avs.Path) avs.Filters.Add(New VideoFilter("SetMemoryMax(512)")) @@ -248,7 +248,7 @@ Class VideoComparisonForm If Filepath.GetExtFull(sourePath) = ".png" Then avs.Filters.Add(New VideoFilter("ImageSource(""" + sourePath + """, end = 0)")) Else - Dim cachePath = CommonDirs.Temp + Guid.NewGuid.ToString + ".ffindex" + Dim cachePath = Folder.Temp + Guid.NewGuid.ToString + ".ffindex" AddHandler Disposed, Sub() FileHelp.Delete(cachePath) avs.Filters.Add(New VideoFilter("FFVideoSource(""" + sourePath + """, cachefile = """ + cachePath + """)")) diff --git a/General/AVIFile.vb b/General/AVIFile.vb index d7a8bb66..4cb171fb 100644 --- a/General/AVIFile.vb +++ b/General/AVIFile.vb @@ -13,8 +13,8 @@ Class AVIFile Sub New(path As String) Try - AVIFileInit() Sourcefile = path + AVIFileInit() Const OF_SHARE_DENY_WRITE = 32 @@ -53,7 +53,13 @@ Class AVIFile End Sub Sub ThrowException(message As String) - Throw New Exception(message + BR2 + "The AviSynth+ x64 or VapourSynth x64 setup might be damaged. You can verify this by opening the avs or vpy file with VirtualDub x64. avs is a AviSynth script, vpy is a VapourSynth script, StaxRip generates these scripts in the folder for temp files and VirtualDub should be able to open it.") + If Sourcefile.Ext = "avs" Then + Throw New Exception(message + BR2 + "Failed to open AviSynth script:" + BR2 + Sourcefile + BR2 + "You can try to open the script with VirtualDub x64, if it don't open it could be a problem with the script or the AviSynth+ x64 setup, if StaxRip don't report a script error and the script looks valid then reinstalling AviSynth+ x64 might fix the problem, the setup is located at:" + BR2 + Folder.Apps + Package.AviSynth.SetupFilename) + ElseIf Sourcefile.Ext = "vpy" Then + Throw New Exception(message + BR2 + "Failed to open VapourSynth script:" + BR2 + Sourcefile + BR2 + "You can try to open the script with VirtualDub x64, if it don't open it could be a problem with the script or the VapourSynth x64 setup, if StaxRip don't report a script error and the script looks valid then reinstalling VapourSynth x64 might fix the problem.") + Else + Throw New Exception(message + BR2 + "Failed to open script:" + BR2 + Sourcefile) + End If End Sub Private FrameCountValue As Integer @@ -111,8 +117,8 @@ Class AVIFile Throw New ErrorAbortException("Failed to read script file", ex.Message) End Try - If Directory.Exists(Paths.PluginsDir) Then - Log.WriteLine("AviSynth Plugins: " + Directory.GetFiles(Paths.PluginsDir, "*.dll").Join(", ").Replace(Paths.PluginsDir, "").Replace(".dll", "")) + If Directory.Exists(Folder.Plugins) Then + Log.WriteLine("AviSynth Plugins: " + Directory.GetFiles(Folder.Plugins, "*.dll").Join(", ").Replace(Folder.Plugins, "").Replace(".dll", "")) Else Log.WriteLine("AviSynth plugin directory is missing!") End If diff --git a/General/Audio.vb b/General/Audio.vb index 4848f472..0c2564b6 100644 --- a/General/Audio.vb +++ b/General/Audio.vb @@ -586,9 +586,7 @@ Class Audio fail = True End If - If fail AndAlso TypeOf ap Is GUIAudioProfile AndAlso - Not Filepath.GetExtFull(ap.File) = ".wav" Then - + If fail AndAlso TypeOf ap Is GUIAudioProfile AndAlso Not ap.File.ext = "wav" Then Log.Write("Error", "no output found") Decode(ap) diff --git a/General/General.vb b/General/General.vb index 1e8f88d1..9e68eb85 100644 --- a/General/General.vb +++ b/General/General.vb @@ -13,15 +13,19 @@ Imports System.Security.Principal Imports StaxRip.UI Imports VB6 = Microsoft.VisualBasic +Imports Microsoft.Win32 + +Class Folder + +#Region "System" -Class CommonDirs Shared ReadOnly Property Startup() As String Get Return DirPath.AppendSeparator(Application.StartupPath) End Get End Property - Shared ReadOnly Property CurrentDirectory() As String + Shared ReadOnly Property Current() As String Get Return DirPath.AppendSeparator(Environment.CurrentDirectory) End Get @@ -51,19 +55,19 @@ Class CommonDirs End Get End Property - Shared ReadOnly Property CommonAppData() As String + Shared ReadOnly Property AppDataCommon() As String Get Return GetFolderPath(Environment.SpecialFolder.CommonApplicationData).AppendSeparator End Get End Property - Shared ReadOnly Property UserAppDataLocal() As String + Shared ReadOnly Property AppDataLocal() As String Get Return GetFolderPath(Environment.SpecialFolder.LocalApplicationData).AppendSeparator End Get End Property - Shared ReadOnly Property UserAppDataRoaming() As String + Shared ReadOnly Property AppDataRoaming() As String Get Return GetFolderPath(Environment.SpecialFolder.ApplicationData).AppendSeparator End Get @@ -75,11 +79,202 @@ Class CommonDirs End Get End Property +#End Region + +#Region "StaxRip" + + Shared ReadOnly Property Apps As String + Get + Return Folder.Startup + "Apps\" + End Get + End Property + + Shared ReadOnly Property Plugins As String + Get + If p.Script.Engine = ScriptEngine.AviSynth Then + Return Filepath.AppendSeparator(Registry.LocalMachine.GetString("SOFTWARE\AviSynth", "plugindir+")) + Else + Return Filepath.AppendSeparator(Registry.LocalMachine.GetString("SOFTWARE\Wow6432Node\VapourSynth", "Plugins64")) + End If + End Get + End Property + + Shared ReadOnly Property Script As String + Get + Dim ret = Settings + "Scripts\" + If Not Directory.Exists(ret) Then Directory.CreateDirectory(ret) + Return ret + End Get + End Property + + Private Shared SettingsValue As String + + Shared ReadOnly Property Settings As String + Get + If SettingsValue Is Nothing Then + For Each location In Registry.CurrentUser.GetValueNames("Software\StaxRip\SettingsLocation") + If Not Directory.Exists(location) Then + Registry.CurrentUser.DeleteValue("Software\StaxRip\SettingsLocation", location) + End If + Next + + SettingsValue = Registry.CurrentUser.GetString("Software\StaxRip\SettingsLocation", Folder.Startup) + + If Not Directory.Exists(SettingsValue) Then + Dim td As New TaskDialog(Of String) + + td.MainInstruction = "Settings Directory" + td.Content = "Choose the location of the settings directory." + + Dim folders As New HashSet(Of String) + + If Directory.Exists(Folder.Home + "Google Drive") Then + folders.Add(Folder.Home + "Google Drive\Apps\Settings\StaxRip\") + End If + + If Directory.Exists(Folder.Home + "OneDrive") Then + folders.Add(Folder.Home + "OneDrive\Apps\Settings\StaxRip") + End If + + folders.Add(Folder.AppDataCommon + "StaxRip x64") + folders.Add(Folder.AppDataLocal + "StaxRip x64") + folders.Add(Folder.AppDataRoaming + "StaxRip x64") + folders.Add(Folder.Startup + "Settings") + + For Each location In Registry.CurrentUser.GetValueNames("Software\StaxRip\SettingsLocation") + If Directory.Exists(location) Then folders.Add(location) + Next + + For Each folder In folders.Sort + td.AddCommandLink(folder, folder) + Next + + td.AddCommandLink("Browse for custom directory", "custom") + + Dim dir = td.Show + + If dir = "custom" Then + Using d As New FolderBrowserDialog + d.Description = "Please select a directory." + d.SelectedPath = Folder.Startup + + If d.ShowDialog = DialogResult.OK Then + dir = d.SelectedPath + Else + dir = Folder.AppDataCommon + "StaxRip x64" + End If + End Using + ElseIf dir = "" Then + dir = Folder.AppDataCommon + "StaxRip x64" + End If + + If Not Directory.Exists(dir) Then + Try + Directory.CreateDirectory(dir) + Catch + dir = Folder.AppDataCommon + "StaxRip x64" + If Not Directory.Exists(dir) Then Directory.CreateDirectory(dir) + End Try + End If + + SettingsValue = dir.AppendSeparator + Registry.CurrentUser.Write("Software\StaxRip\SettingsLocation", Folder.Startup, SettingsValue) + End If + End If + + Return SettingsValue + End Get + End Property + + Shared ReadOnly Property Template As String + Get + Dim ret = Settings + "TemplatesV2\" + Dim fresh As Boolean + + If Not Directory.Exists(ret) Then + Directory.CreateDirectory(ret) + fresh = True + End If + + Dim version = 44 + + If fresh OrElse Not s.Storage.GetInt("template update") = version Then + s.Storage.SetInt("template update", version) + + Dim files = Directory.GetFiles(ret, "*.srip") + + If files.Length > 0 Then + DirectoryHelp.Delete(ret + "Backup") + Directory.CreateDirectory(ret + "Backup") + + For Each i In files + FileHelp.Move(i, Filepath.GetDir(i) + "Backup\" + Filepath.GetName(i)) + Next + End If + + Dim x264 As New Project + x264.Init() + SafeSerialization.Serialize(x264, ret + "x264.srip") + + 'Dim x265 As New Project + 'x265.Init() + 'Dim x265enc = New x265.x265Encoder + 'x265enc.Params.ApplyPresetDefaultValues() + 'x265enc.Params.ApplyPresetValues() + 'x265.VideoEncoder = x265enc + + 'SafeSerialization.Serialize(x265, ret + "x265.srip") + + Dim aaclc = New GUIAudioProfile(AudioCodec.AAC, 0.4) + + Dim apple = Function(name As String, device As x264DeviceMode) As Project + Dim proj As New Project + proj.Init() + + proj.MaxAspectRatioError = 4 + proj.AutoResizeImage = 0 + proj.AutoSmartOvercrop = 2 + proj.Script.GetFilter("Resize").Active = True + proj.VideoEncoder = VideoEncoder.Getx264Encoder("x264 | " + name, device) + proj.VideoEncoder.Muxer = New MP4Muxer("MP4") + proj.Audio0 = aaclc + + Return proj + End Function + + Dim iPad = apple("iPad", x264DeviceMode.iPad) + iPad.TargetWidth = 1280 + iPad.TargetHeight = 720 + SafeSerialization.Serialize(iPad, ret + "iPad.srip") + + Dim iPhone = apple("iPhone", x264DeviceMode.iPhone) + iPhone.TargetWidth = 960 + iPhone.TargetHeight = 540 + SafeSerialization.Serialize(iPhone, ret + "iPhone.srip") + + Dim console = Sub(name As String, device As x264DeviceMode) + Dim proj As New Project + proj.Init() + proj.VideoEncoder = VideoEncoder.Getx264Encoder("x264 | " + name, device) + proj.Audio0 = aaclc + SafeSerialization.Serialize(proj, ret + name + ".srip") + End Sub + + console("PlayStation", x264DeviceMode.PlayStation) + console("Xbox", x264DeviceMode.Xbox) + End If + + Return ret + End Get + End Property + +#End Region + Private Shared Function SHGetFolderPath(hwndOwner As IntPtr, nFolder As Integer, hToken As IntPtr, dwFlags As Integer, lpszPath As StringBuilder) As Integer End Function - Shared Function GetFolderPath(folder As Environment.SpecialFolder) As String + Private Shared Function GetFolderPath(folder As Environment.SpecialFolder) As String Dim sb As New StringBuilder(260) SHGetFolderPath(IntPtr.Zero, CInt(folder), IntPtr.Zero, 0, sb) Dim ret = DirPath.AppendSeparator(sb.ToString) '.NET fails on 'D:' @@ -187,7 +382,7 @@ Class DirPath Shared Function IsInSysDir(path As String) As Boolean If path = "" Then Return False If Not path.EndsWith("\") Then path += "\" - Return path.ToUpper.Contains(CommonDirs.Programs.ToUpper) + Return path.ToUpper.Contains(Folder.Programs.ToUpper) End Function Shared Function IsFixedDrive(path As String) As Boolean diff --git a/General/GlobalCommands.vb b/General/GlobalCommands.vb index 74084f05..790d9af1 100644 --- a/General/GlobalCommands.vb +++ b/General/GlobalCommands.vb @@ -57,7 +57,7 @@ Public Class GlobalCommands End If If asBatch Then - Dim batchPath = CommonDirs.Temp + Guid.NewGuid.ToString + ".bat" + Dim batchPath = Folder.Temp + Guid.NewGuid.ToString + ".bat" Dim batchCode = Macro.Solve(commandLines) File.WriteAllText(batchPath, batchCode, Encoding.GetEncoding(850)) @@ -125,7 +125,7 @@ Public Class GlobalCommands If Not ProcessForm.IsActive Then closeNeeded = True - Dim batchPath = CommonDirs.Temp + Guid.NewGuid.ToString + ".bat" + Dim batchPath = Folder.Temp + Guid.NewGuid.ToString + ".bat" Dim batchCode = Macro.Solve(batchScript) File.WriteAllText(batchPath, batchCode, Encoding.GetEncoding(850)) @@ -311,23 +311,32 @@ Public Class GlobalCommands End If Next - 'does help file exist? For Each pack In Package.Items.Values + 'does help file exist? If pack.Path <> "" AndAlso pack.HelpFile <> "" Then If Not File.Exists(pack.GetDir + pack.HelpFile) Then - MsgError($"Help file of {pack.Name} is missing!") - - Using form As New AppsForm - form.ShowPackage(pack) - form.ShowDialog() - End Using - + ShowPackageError(pack, $"Help file of {pack.Name} don't exist!") Exit For End If End If + + 'does setup file exist? + If pack.SetupFilename <> "" AndAlso Not File.Exists(Folder.Apps + pack.SetupFilename) Then + ShowPackageError(pack, $"Setup file of {pack.Name} don't exist!") + Exit For + End If Next End Sub + Sub ShowPackageError(pack As Package, msg As String) + MsgError(msg) + + Using form As New AppsForm + form.ShowPackage(pack) + form.ShowDialog() + End Using + End Sub + Sub PlaySound( Filepath As String, diff --git a/General/ImageUtils.vb b/General/ImageUtils.vb index 678ac017..7ad0276c 100644 --- a/General/ImageUtils.vb +++ b/General/ImageUtils.vb @@ -23,7 +23,7 @@ Class Thumbnails height = height - height Mod 4 Dim avsdoc As New VideoScript - avsdoc.Path = Paths.SettingsDir + "Thumbnails.avs" + avsdoc.Path = Folder.Settings + "Thumbnails.avs" avsdoc.Filters.Add(New VideoFilter("DirectShowSource(""" + inputFile + """, audio=false, convertfps=true).LanczosResize(" & width & "," & height & ")")) avsdoc.Filters.Add(New VideoFilter("ConvertToRGB()")) diff --git a/General/MediaInfo.vb b/General/MediaInfo.vb index bf29d154..eb62ecbf 100644 --- a/General/MediaInfo.vb +++ b/General/MediaInfo.vb @@ -5,52 +5,6 @@ Class MediaInfo Implements IDisposable Private Handle As IntPtr - - - Private Shared Function MediaInfo_New() As IntPtr - End Function - - - Private Shared Sub MediaInfo_Delete(Handle As IntPtr) - End Sub - - - Private Shared Function MediaInfo_Open(Handle As IntPtr, FileName As String) As Integer - End Function - - - Private Shared Function MediaInfo_Close(Handle As IntPtr) As Integer - End Function - - - Private Shared Function MediaInfo_Inform(Handle As IntPtr, - Reserved As Integer) As IntPtr - End Function - - - Private Shared Function MediaInfo_Get(Handle As IntPtr, - StreamKind As MediaInfoStreamKind, - StreamNumber As Integer, Parameter As String, - KindOfInfo As MediaInfoInfoKind, - KindOfSearch As MediaInfoInfoKind) As IntPtr - End Function - - - Private Shared Function MediaInfo_Option(Handle As IntPtr, - OptionString As String, - Value As String) As IntPtr - End Function - - - Private Shared Function MediaInfo_State_Get(Handle As IntPtr) As Integer - End Function - - - Private Shared Function MediaInfo_Count_Get(Handle As IntPtr, - StreamKind As MediaInfoStreamKind, - StreamNumber As Integer) As Integer - End Function - Private Shared Loaded As Boolean Sub New(path As String) @@ -63,20 +17,6 @@ Class MediaInfo MediaInfo_Open(Handle, path) End Sub - Private Disposed As Boolean - - Sub Dispose() Implements IDisposable.Dispose - If Not Disposed Then - Disposed = True - MediaInfo_Close(Handle) - MediaInfo_Delete(Handle) - End If - End Sub - - Protected Overrides Sub Finalize() - Dispose() - End Sub - Private VideoStreamsValue As List(Of VideoStream) ReadOnly Property VideoStreams() As List(Of VideoStream) @@ -183,8 +123,6 @@ Class MediaInfo If match.Success Then at.Channels = match.Groups(1).Value.ToInt at.ChannelsCore = match.Groups(2).Value.ToInt - Else - at.Channels = 2 End If End If @@ -410,6 +348,74 @@ Class MediaInfo Cache.Clear() End Sub + +#Region "IDisposable" + + Private Disposed As Boolean + + Sub Dispose() Implements IDisposable.Dispose + If Not Disposed Then + Disposed = True + MediaInfo_Close(Handle) + MediaInfo_Delete(Handle) + End If + End Sub + + Protected Overrides Sub Finalize() + Dispose() + End Sub + +#End Region + +#Region "native" + + + Private Shared Function MediaInfo_New() As IntPtr + End Function + + + Private Shared Sub MediaInfo_Delete(Handle As IntPtr) + End Sub + + + Private Shared Function MediaInfo_Open(Handle As IntPtr, FileName As String) As Integer + End Function + + + Private Shared Function MediaInfo_Close(Handle As IntPtr) As Integer + End Function + + + Private Shared Function MediaInfo_Inform(Handle As IntPtr, + Reserved As Integer) As IntPtr + End Function + + + Private Shared Function MediaInfo_Get(Handle As IntPtr, + StreamKind As MediaInfoStreamKind, + StreamNumber As Integer, Parameter As String, + KindOfInfo As MediaInfoInfoKind, + KindOfSearch As MediaInfoInfoKind) As IntPtr + End Function + + + Private Shared Function MediaInfo_Option(Handle As IntPtr, + OptionString As String, + Value As String) As IntPtr + End Function + + + Private Shared Function MediaInfo_State_Get(Handle As IntPtr) As Integer + End Function + + + Private Shared Function MediaInfo_Count_Get(Handle As IntPtr, + StreamKind As MediaInfoStreamKind, + StreamNumber As Integer) As Integer + End Function + +#End Region + End Class Public Enum MediaInfoStreamKind diff --git a/General/Misc.vb b/General/Misc.vb index d9790f9c..839b09e4 100644 --- a/General/Misc.vb +++ b/General/Misc.vb @@ -22,228 +22,6 @@ Public Module ShortcutModule Public s As New ApplicationSettings End Module -Class Paths - Shared Function VerifyRequirements() As Boolean - For Each i In Package.Items.Values - If Not i.VerifyOK Then Return False - Next - - If Not p.Script.IsFilterActive("Source") Then - MsgWarn("No active filter of category 'Source' found.") - Return False - End If - - Return True - End Function - - - Shared ReadOnly Property PluginsDir() As String - Get - If p.Script.Engine = ScriptEngine.AviSynth Then - Return Filepath.AppendSeparator(Registry.LocalMachine.GetString("SOFTWARE\AviSynth", "plugindir+")) - Else - Return Filepath.AppendSeparator(Registry.LocalMachine.GetString("SOFTWARE\Wow6432Node\VapourSynth", "Plugins64")) - End If - End Get - End Property - - Shared Function BrowseFolder(defaultFolder As String) As String - Using d As New FolderBrowserDialog - d.Description = "Please select a directory." - d.SetSelectedPath(defaultFolder) - If d.ShowDialog = DialogResult.OK Then Return d.SelectedPath - End Using - End Function - - Shared ReadOnly Property ScriptDir As String - Get - Dim ret = SettingsDir + "Scripts\" - If Not Directory.Exists(ret) Then Directory.CreateDirectory(ret) - Return ret - End Get - End Property - - Private Shared SettingsDirValue As String - - Shared ReadOnly Property SettingsDir() As String - Get - If SettingsDirValue Is Nothing Then - For Each location In Registry.CurrentUser.GetValueNames("Software\StaxRip\SettingsLocation") - If Not Directory.Exists(location) Then - Registry.CurrentUser.DeleteValue("Software\StaxRip\SettingsLocation", location) - End If - Next - - SettingsDirValue = Registry.CurrentUser.GetString("Software\StaxRip\SettingsLocation", CommonDirs.Startup) - - If Not Directory.Exists(SettingsDirValue) Then - Dim td As New TaskDialog(Of String) - - td.MainInstruction = "Settings Directory" - td.Content = "Choose the location of the settings directory." - - Dim folders As New HashSet(Of String) - - If Directory.Exists(CommonDirs.Home + "Google Drive") Then - folders.Add(CommonDirs.Home + "Google Drive\Apps\Settings\StaxRip\") - End If - - If Directory.Exists(CommonDirs.Home + "OneDrive") Then - folders.Add(CommonDirs.Home + "OneDrive\Apps\Settings\StaxRip") - End If - - folders.Add(CommonDirs.CommonAppData + "StaxRip x64") - folders.Add(CommonDirs.UserAppDataLocal + "StaxRip x64") - folders.Add(CommonDirs.UserAppDataRoaming + "StaxRip x64") - folders.Add(CommonDirs.Startup + "Settings") - - For Each location In Registry.CurrentUser.GetValueNames("Software\StaxRip\SettingsLocation") - If Directory.Exists(location) Then folders.Add(location) - Next - - For Each folder In folders.Sort - td.AddCommandLink(folder, folder) - Next - - td.AddCommandLink("Browse for custom directory", "custom") - - Dim dir = td.Show - - If dir = "custom" Then - Using d As New FolderBrowserDialog - d.Description = "Please select a directory." - d.SelectedPath = CommonDirs.Startup - - If d.ShowDialog = DialogResult.OK Then - dir = d.SelectedPath - Else - dir = CommonDirs.CommonAppData + "StaxRip x64" - End If - End Using - ElseIf dir = "" Then - dir = CommonDirs.CommonAppData + "StaxRip x64" - End If - - If Not Directory.Exists(dir) Then - Try - Directory.CreateDirectory(dir) - Catch - dir = CommonDirs.CommonAppData + "StaxRip x64" - If Not Directory.Exists(dir) Then Directory.CreateDirectory(dir) - End Try - End If - - SettingsDirValue = dir.AppendSeparator - Registry.CurrentUser.Write("Software\StaxRip\SettingsLocation", CommonDirs.Startup, SettingsDirValue) - End If - End If - - Return SettingsDirValue - End Get - End Property - - Shared ReadOnly Property TemplateDir() As String - Get - Dim ret = SettingsDir + "TemplatesV2\" - Dim fresh As Boolean - - If Not Directory.Exists(ret) Then - Directory.CreateDirectory(ret) - fresh = True - End If - - Dim version = 44 - - If fresh OrElse Not s.Storage.GetInt("template update") = version Then - s.Storage.SetInt("template update", version) - - Dim files = Directory.GetFiles(ret, "*.srip") - - If files.Length > 0 Then - DirectoryHelp.Delete(ret + "Backup") - Directory.CreateDirectory(ret + "Backup") - - For Each i In files - FileHelp.Move(i, Filepath.GetDir(i) + "Backup\" + Filepath.GetName(i)) - Next - End If - - Dim x264 As New Project - x264.Init() - SafeSerialization.Serialize(x264, ret + "x264.srip") - - 'Dim x265 As New Project - 'x265.Init() - 'Dim x265enc = New x265.x265Encoder - 'x265enc.Params.ApplyPresetDefaultValues() - 'x265enc.Params.ApplyPresetValues() - 'x265.VideoEncoder = x265enc - - 'SafeSerialization.Serialize(x265, ret + "x265.srip") - - Dim aaclc = New GUIAudioProfile(AudioCodec.AAC, 0.4) - - Dim apple = Function(name As String, device As x264DeviceMode) As Project - Dim proj As New Project - proj.Init() - - proj.MaxAspectRatioError = 4 - proj.AutoResizeImage = 0 - proj.AutoSmartOvercrop = 2 - proj.Script.GetFilter("Resize").Active = True - proj.VideoEncoder = VideoEncoder.Getx264Encoder("x264 | " + name, device) - proj.VideoEncoder.Muxer = New MP4Muxer("MP4") - proj.Audio0 = aaclc - - Return proj - End Function - - Dim iPad = apple("iPad", x264DeviceMode.iPad) - iPad.TargetWidth = 1280 - iPad.TargetHeight = 720 - SafeSerialization.Serialize(iPad, ret + "iPad.srip") - - Dim iPhone = apple("iPhone", x264DeviceMode.iPhone) - iPhone.TargetWidth = 960 - iPhone.TargetHeight = 540 - SafeSerialization.Serialize(iPhone, ret + "iPhone.srip") - - Dim console = Sub(name As String, device As x264DeviceMode) - Dim proj As New Project - proj.Init() - proj.VideoEncoder = VideoEncoder.Getx264Encoder("x264 | " + name, device) - proj.Audio0 = aaclc - SafeSerialization.Serialize(proj, ret + name + ".srip") - End Sub - - console("PlayStation", x264DeviceMode.PlayStation) - console("Xbox", x264DeviceMode.Xbox) - End If - - Return ret - End Get - End Property - - Shared ReadOnly Property SettingsFile() As String - Get - Return SettingsDir + "SettingsV2.dat" - End Get - End Property - - Shared ReadOnly Property StartupTemplatePath() As String - Get - Dim r = Paths.TemplateDir + s.StartupTemplate + ".srip" - - If Not File.Exists(r) Then - r = Paths.TemplateDir + "x264.srip" - s.StartupTemplate = "x264" - End If - - Return r - End Get - End Property -End Class - Public Enum MediaInformation VideoFormat DAR @@ -257,6 +35,46 @@ Public Class GlobalClass Property DefaultCommands As New GlobalCommands Property IsProcessing As Boolean + ReadOnly Property StartupTemplatePath() As String + Get + Dim ret = Folder.Template + s.StartupTemplate + ".srip" + + If Not File.Exists(ret) Then + ret = Folder.Template + "x264.srip" + s.StartupTemplate = "x264" + End If + + Return ret + End Get + End Property + + ReadOnly Property SettingsFile() As String + Get + Return Folder.Settings + "SettingsV2.dat" + End Get + End Property + + Function BrowseFolder(defaultFolder As String) As String + Using d As New FolderBrowserDialog + d.Description = "Please select a directory." + d.SetSelectedPath(defaultFolder) + If d.ShowDialog = DialogResult.OK Then Return d.SelectedPath + End Using + End Function + + Function VerifyRequirements() As Boolean + For Each pack In Package.Items.Values + If Not pack.VerifyOK Then Return False + Next + + If Not p.Script.IsFilterActive("Source") Then + MsgWarn("No active filter of category 'Source' found.") + Return False + End If + + Return True + End Function + Function ShowVideoSourceWarnings(files As IEnumerable(Of String)) As Boolean For Each i In files If i.ContainsUnicode AndAlso p.Script.Engine = ScriptEngine.AviSynth Then @@ -491,7 +309,7 @@ Public Class GlobalClass Sub SaveSettings() Try - SafeSerialization.Serialize(s, Paths.SettingsFile) + SafeSerialization.Serialize(s, g.SettingsFile) Catch ex As Exception g.ShowException(ex) End Try @@ -826,7 +644,7 @@ Public Class GlobalClass End If Dim fp = If(File.Exists(p.SourceFile) AndAlso Directory.Exists(p.TempDir), - p.TempDir + p.Name + "_StaxRip.log", Paths.SettingsDir + "Log.txt") + p.TempDir + p.Name + "_StaxRip.log", Folder.Settings + "Log.txt") SyncLock p.Log p.Log.ToString.WriteANSIFile(fp) @@ -913,6 +731,15 @@ Public Class GlobalClass End If End Sub + Sub AddHardcodedSubtitle() + For Each subtitle In p.VideoEncoder.Muxer.Subtitles + If subtitle.Path.Ext.EqualsAny("srt", "ass", "idx") Then + subtitle.Enabled = False + p.AddHardcodedSubtitleFilter(subtitle.Path) + End If + Next + End Sub + Sub RunAutoCrop() p.SourceScript.Synchronize(True) @@ -2310,19 +2137,19 @@ Class Macro If value.Contains("%delay2%") Then value = value.Replace("%delay2%", p.Audio1.Delay.ToString) If Not value.Contains("%") Then Return value - If value.Contains("%startup_dir%") Then value = value.Replace("%startup_dir%", CommonDirs.Startup) + If value.Contains("%startup_dir%") Then value = value.Replace("%startup_dir%", Folder.Startup) If Not value.Contains("%") Then Return value - If value.Contains("%system_dir%") Then value = value.Replace("%system_dir%", CommonDirs.System) + If value.Contains("%system_dir%") Then value = value.Replace("%system_dir%", Folder.System) If Not value.Contains("%") Then Return value - If value.Contains("%script_dir%") Then value = value.Replace("%script_dir%", Paths.ScriptDir) + If value.Contains("%script_dir%") Then value = value.Replace("%script_dir%", Folder.Script) If Not value.Contains("%") Then Return value - If value.Contains("%programs_dir%") Then value = value.Replace("%programs_dir%", CommonDirs.Programs) + If value.Contains("%programs_dir%") Then value = value.Replace("%programs_dir%", Folder.Programs) If Not value.Contains("%") Then Return value - If value.Contains("%plugin_dir%") Then value = value.Replace("%plugin_dir%", Paths.PluginsDir) + If value.Contains("%plugin_dir%") Then value = value.Replace("%plugin_dir%", Folder.Plugins) If Not value.Contains("%") Then Return value If value.Contains("%source_files_comma%") Then value = value.Replace("%source_files_comma%", """" + String.Join(""",""", p.SourceFiles.ToArray) + """") @@ -2355,7 +2182,7 @@ Class Macro If value.Contains("%template_name%") Then value = value.Replace("%template_name%", p.TemplateName) If Not value.Contains("%") Then Return value - If value.Contains("%settings_dir%") Then value = value.Replace("%settings_dir%", Paths.SettingsDir) + If value.Contains("%settings_dir%") Then value = value.Replace("%settings_dir%", Folder.Settings) If Not value.Contains("%") Then Return value If value.Contains("%player%") Then value = value.Replace("%player%", Package.MPC.Path) @@ -2710,7 +2537,6 @@ Public Class AudioStream ReadOnly Property Name As String Get Dim sb As New StringBuilder() - sb.Append("ID" & (StreamOrder + 1)) If CodecString <> "" Then @@ -2724,31 +2550,32 @@ Public Class AudioStream Case "AC3+" sb.Append(" E-AC3") Case Else - If Codec = "TrueHD / AC3" Then - sb.Append(" THD+AC3") - ElseIf FormatProfile = "MA / Core" Then - sb.Append(" DTS MA/Core") - ElseIf FormatProfile = "HRA / Core" Then - sb.Append(" DTS HRA/Core") - Else - sb.Append(" " + CodecString) - End If + Select Case Codec + Case "Atmos / TrueHD" + sb.Append(" THD Atmos") + Case "TrueHD / AC3" + sb.Append(" THD+AC3") + Case Else + Select Case FormatProfile + Case "MA / Core" + sb.Append(" DTS MA/Core") + Case "HRA / Core" + sb.Append(" DTS HRA/Core") + Case Else + sb.Append(" " + CodecString) + End Select + End Select End Select End If If ChannelsCore > 0 Then sb.Append(" " & Channels & "/" & ChannelsCore & "ch") - Else + ElseIf Channels > 0 Then sb.Append(" " & Channels & "ch") End If - If BitDepth > 0 Then - sb.Append(" " & BitDepth & "Bit") - End If - - If SamplingRate > 0 Then - sb.Append(" " & SamplingRate & "Hz") - End If + If BitDepth > 0 Then sb.Append(" " & BitDepth & "Bit") + If SamplingRate > 0 Then sb.Append(" " & SamplingRate & "Hz") If BitrateCore > 0 Then sb.Append(" " & If(Bitrate = 0, "?", Bitrate.ToString) & "/" & BitrateCore & "Kbps") @@ -2757,14 +2584,8 @@ Public Class AudioStream End If If Delay <> 0 Then sb.Append(" " & Delay & "ms") - - If Language.TwoLetterCode <> "iv" Then - sb.Append(" " + Language.Name) - End If - - If Title <> "" AndAlso Title <> " " Then - sb.Append(" " + Title) - End If + If Language.TwoLetterCode <> "iv" Then sb.Append(" " + Language.Name) + If Title <> "" AndAlso Title <> " " Then sb.Append(" " + Title) Return sb.ToString End Get @@ -2801,7 +2622,7 @@ Public Class AudioStream Return ".ogg" Case "Opus" Return ".opus" - Case "TrueHD" + Case "TrueHD", "Atmos / TrueHD" Return ".thd" Case "AC3+" Return ".eac3" diff --git a/General/Package.vb b/General/Package.vb index 43fc3933..08d080da 100644 --- a/General/Package.vb +++ b/General/Package.vb @@ -4,20 +4,20 @@ Imports StaxRip Public Class Package Implements IComparable(Of Package) - Property Name As String - Property FileNotFoundMessage As String - Property SetupAction As Action - Property Version As String Property Description As String - Property VersionDate As DateTime - Property HelpFile As String - Property Filenames As String() - Property WebURL As String Property DownloadURL As String + Property Filenames As String() + Property FileNotFoundMessage As String + Property HelpFile As String Property HelpURL As String Property IsRequiredFunc As Func(Of Boolean) - Property StatusFunc As Func(Of String) Property LaunchName As String + Property Name As String + Property SetupFilename As String + Property StatusFunc As Func(Of String) + Property Version As String + Property VersionDate As DateTime + Property WebURL As String Shared Property Items As New SortedDictionary(Of String, Package) @@ -93,7 +93,7 @@ Public Class Package Shared Property mkvmerge As New Package With { .Name = "mkvmerge", .Filename = "mkvmerge.exe", - .FixedDir = CommonDirs.Startup + "Apps\MKVToolNix\", + .FixedDir = Folder.Startup + "Apps\MKVToolNix\", .WebURL = "http://www.bunkus.org/videotools/mkvtoolnix", .HelpURL = "http://www.bunkus.org/videotools/mkvtoolnix/docs.html", .Description = "MKV muxing tool."} @@ -101,7 +101,7 @@ Public Class Package Shared Property mkvextract As New Package With { .Name = "mkvextract", .Filename = "mkvextract.exe", - .FixedDir = CommonDirs.Startup + "Apps\MKVToolNix\", + .FixedDir = Folder.Startup + "Apps\MKVToolNix\", .WebURL = "http://www.bunkus.org/videotools/mkvtoolnix", .HelpURL = "http://www.bunkus.org/videotools/mkvtoolnix/docs.html", .Description = "MKV demuxing tool."} @@ -125,14 +125,14 @@ Public Class Package .Filename = "msvcp120.dll", .Description = "Visual C++ 2013 Redistributable Packages which is required by some tools used by StaxRip.", .DownloadURL = "https://www.microsoft.com/en-US/download/details.aspx?id=40784", - .FixedDir = CommonDirs.System} + .FixedDir = Folder.System} Shared Property vscpp2015 As New Package With { .Name = "Visual C++ 2015", .Filename = "msvcp140.dll", .Description = "Visual C++ 2015 Redistributable Packages which is required by some tools used by StaxRip.", .DownloadURL = "http://download.microsoft.com/download/8/c/b/8cb4af84-165e-4b36-978d-e867e07fc707/vc_redist.x64.exe", - .FixedDir = CommonDirs.System} + .FixedDir = Folder.System} Public Shared DGDecodeNV As New PluginPackage With { .Name = "DGDecodeNV", @@ -226,7 +226,7 @@ Public Class Package .Name = "Demux", .Filename = "Demux.exe", .Description = "Demuxing standalone tool.", - .FixedDir = CommonDirs.Startup + "Apps\Toolbox\", + .FixedDir = Folder.Startup + "Apps\Toolbox\", .LaunchName = "Demux.exe", .HelpURL = "http://forum.doom9.org/showthread.php?t=173427", .WebURL = "http://forum.doom9.org/showthread.php?t=173427"}) @@ -506,12 +506,12 @@ Public Class Package #End Region - Dim fp = Paths.SettingsDir + "Versions.txt" + Dim fp = Folder.Settings + "Versions.txt" Try If Not File.Exists(fp) OrElse Not File.ReadAllText(fp).Contains(Application.ProductVersion + BR2) Then FileHelp.Delete(fp) - fp = CommonDirs.Startup + "Apps\Versions.txt" + fp = Folder.Startup + "Apps\Versions.txt" End If For Each line In File.ReadAllLines(fp) @@ -652,7 +652,7 @@ Public Class Package If Not IsCorrectVersion() Then Dim text = "Unknown version, press F12 to edit the version." - If SetupAction Is Nothing Then + If SetupFilename = "" Then Return text Else Return text + " In case of problems download and install the required version." @@ -666,7 +666,7 @@ Public Class Package If pathVar = "" Then If FileNotFoundMessage <> "" Then Return "App Not found, press F11 to locate the App. " + FileNotFoundMessage - ElseIf Not SetupAction Is Nothing Then + ElseIf SetupFilename <> "" Then Return "Please install " + Name + "." End If @@ -725,20 +725,20 @@ Public Class Package If Not plugin Is Nothing Then If Not plugin.VapourSynthFilterNames Is Nothing AndAlso Not plugin.AviSynthFilterNames Is Nothing Then - ret = CommonDirs.Startup + "Apps\Plugins\both\" + Name + "\" + Filename + ret = Folder.Startup + "Apps\Plugins\both\" + Name + "\" + Filename If File.Exists(ret) Then Return ret Else If plugin.VapourSynthFilterNames Is Nothing Then - ret = CommonDirs.Startup + "Apps\Plugins\avs\" + Name + "\" + Filename + ret = Folder.Startup + "Apps\Plugins\avs\" + Name + "\" + Filename If File.Exists(ret) Then Return ret Else - ret = CommonDirs.Startup + "Apps\Plugins\vs\" + Name + "\" + Filename + ret = Folder.Startup + "Apps\Plugins\vs\" + Name + "\" + Filename If File.Exists(ret) Then Return ret End If End If End If - ret = CommonDirs.Startup + "Apps\" + Name + "\" + Filename + ret = Folder.Apps + Name + "\" + Filename If File.Exists(ret) Then Return ret End Get End Property @@ -784,8 +784,8 @@ Public Class AviSynthPlusPackage Filename = "avisynth.dll" WebURL = "http://avisynth.nl/index.php/AviSynth%2B" Description = "StaxRip support both AviSynth+ x64 and VapourSynth x64 as scripting based video processing tool." - FixedDir = CommonDirs.System - SetupAction = Sub() g.ShellExecute(CommonDirs.Startup + "Apps\AviSynth+_r1847.exe") + FixedDir = Folder.System + SetupFilename = "AviSynth+r1858.exe" End Sub Public Overrides ReadOnly Property IsRequired As Boolean @@ -795,7 +795,7 @@ Public Class AviSynthPlusPackage End Property Public Overrides Function GetStatus() As String - If Not Directory.Exists(Paths.PluginsDir) Then + If Not Directory.Exists(Folder.Plugins) Then Return "The AviSynth+ plugins directory is missing, run the AviSynth+ setup." End If @@ -943,7 +943,7 @@ Public Class PluginPackage If Not script.Contains(line) AndAlso Not code.Contains(line) Then code += line ElseIf Not plugin.VapourSynthFilterNames Is Nothing Then - If Not File.Exists(Paths.PluginsDir + plugin.Filename) Then + If Not File.Exists(Folder.Plugins + plugin.Filename) Then Dim line = "core.std.LoadPlugin(r""" + plugin.Path + """)" + BR If Not script.Contains(line) AndAlso Not code.Contains(line) Then @@ -1085,7 +1085,7 @@ Public Class qaacPackage End Property Overrides Function GetStatus() As String - Dim pathVar = CommonDirs.Programs + "Common Files\Apple\Apple Application Support\CoreAudioToolbox.dll" + Dim pathVar = Folder.Programs + "Common Files\Apple\Apple Application Support\CoreAudioToolbox.dll" If Not File.Exists(pathVar) AndAlso Not File.Exists(GetDir() + "QTfiles64\CoreAudioToolbox.dll") Then Return "Failed to locate CoreAudioToolbox, read the description below. Expected paths:" + @@ -1256,7 +1256,7 @@ Public Class dsmuxPackage Filename = "dsmux.x64.exe" Description = Strings.dsmux WebURL = "http://haali.su/mkv" - SetupAction = Sub() g.ShellExecute(CommonDirs.Startup + "Apps\MatroskaSplitter.exe") + SetupFilename = "MatroskaSplitter.exe" End Sub Public Overrides ReadOnly Property Path As String @@ -1281,7 +1281,7 @@ Public Class HaaliSplitter Name = "Haali Splitter" Filename = "splitter.ax" WebURL = "http://haali.su/mkv" - SetupAction = Sub() g.ShellExecute(CommonDirs.Startup + "Apps\MatroskaSplitter.exe") + SetupFilename = "MatroskaSplitter.exe" Description = "Haali Splitter is used by eac3to and dsmux to write MKV files. Haali Splitter and LAV Filters overrite each other, most people prefer LAV Filters, therefore it's recommended to install Haali first and LAV Filters last." IsRequiredValue = False End Sub diff --git a/General/Project.vb b/General/Project.vb index ccedfeb2..052bdc72 100644 --- a/General/Project.vb +++ b/General/Project.vb @@ -91,6 +91,7 @@ Public Class Project Public Versions As Dictionary(Of String, Integer) Public VideoBitrate As Integer = 1000 Public VideoEncoder As VideoEncoder + Public HarcodedSubtitle As Boolean Property WasUpdated As Boolean Implements ISafeSerialization.WasUpdated @@ -243,4 +244,14 @@ Public Class Project Return TargetFile.Base End Get End Property + + Sub AddHardcodedSubtitleFilter(path As String) + Dim filter As New VideoFilter + filter.Category = "Subtitle" + filter.Path = Filepath.GetName(path) + filter.Active = True + filter.Script = If(path.Ext = "idx", "VobSub", "TextSubMod") + "(""" + path + """)" + Dim insertCat = If(p.Script.IsFilterActive("Crop"), "Crop", "Source") + Script.InsertAfter(insertCat, filter) + End Sub End Class \ No newline at end of file diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 8b9f6ce0..8d37b136 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/TaskDialog.vb b/UI/TaskDialog.vb index d6984237..cd50ddf9 100644 --- a/UI/TaskDialog.vb +++ b/UI/TaskDialog.vb @@ -178,9 +178,7 @@ Class TaskDialog(Of T) End Get Set(value As Integer) For Each i In IdValueDic - If i.Key = value Then - SelectedIDValue = value - End If + If i.Key = value Then SelectedIDValue = value Next End Set End Property @@ -189,10 +187,7 @@ Class TaskDialog(Of T) Property SelectedValue() As T Get - If IdValueDic.ContainsKey(SelectedID) Then - Return IdValueDic(SelectedID) - End If - + If IdValueDic.ContainsKey(SelectedID) Then Return IdValueDic(SelectedID) Return SelectedValueValue End Get Set(value As T) @@ -295,8 +290,7 @@ Class TaskDialog(Of T) If hr < 0 Then Marshal.ThrowExceptionForHR(hr) If TypeOf SelectedValue Is DialogResult Then - Dim o As Object = SelectedID - SelectedValue = DirectCast(o, T) + SelectedValue = DirectCast(CObj(SelectedID), T) End If Return SelectedValue diff --git a/md/test-build.md b/md/test-build.md index f8841390..9a8f01e5 100644 --- a/md/test-build.md +++ b/md/test-build.md @@ -12,7 +12,7 @@ http://1drv.ms/1OqPDOe - added all missing x265 switches - added hardware decoding methods to x265 'Other' tab, this will bypass AviSynth though - added new standalone mkvextract GUI (Apps > Demux) -- added new QSVEncC switches for hardcoded subtitles +- added new QSVEncC switches for hard coded subtitles - added MP4 support to standalone demux app - added -avsinfo starting AVSMeter without a source opened - added support for unicode filenames using VapourSynth, AviSynth don't support it @@ -24,6 +24,7 @@ http://1drv.ms/1OqPDOe - added option to define preferred audio languages - added audio and subtitle demuxing modes 'Show Dialog', 'Preferred', 'All', 'None' - added x265 changes for v1.9 183 +- added new option to automatically add hard coded subtitle ### Fixed Bugs @@ -43,10 +44,10 @@ http://1drv.ms/1OqPDOe - enabled posibility to remux mov to mp4 - the apps dialog writes the customized versions now to the settings folder so it don't matter if the startup folder has no write access - demuxed subtitles are now detected by ID with proper numeric order +- improved Dolby Atmos handling ### Updated Tools -- AviSynth 1847 - ffmpeg 2016-04-25 - L-SMASH-Works 877 - mkvtoolnix 9.2.0 @@ -58,4 +59,5 @@ http://1drv.ms/1OqPDOe - QSVEncC 2.47 - StaxRip Toolbox Demux 1.1 - x265 1.9 183 -- yadifmod2 0.0.4 \ No newline at end of file +- yadifmod2 0.0.4 +- AviSynth 1858 \ No newline at end of file