New option using the source file folder for temp files

This commit is contained in:
Frank Skare
2020-12-30 22:28:37 +01:00
parent 02853c1d26
commit 78693a06f8
5 changed files with 53 additions and 26 deletions
+1
View File
@@ -5,6 +5,7 @@
- aomenc bugfixes and UI improvements (Dendraspis, 44vince44, [#375](/../../issues/375))
- x265 by default no longer uses a pipe tool.
- aomenc moved cq-level option to "Rate Control 1" for better usage (Dendraspis, Neltulz, [#411](/../../issues/411))
- New option using the source file folder for temp files. (stax76)
2.1.5.5 Beta (2020-12-30)
+1 -1
View File
@@ -190,7 +190,7 @@ Public Class CommandLineForm
Dim max = oParam.Options.Select(Function(txt) txt.Length).Max
If max > 25 Then
If max > 23 Then
menuBlock.Button.Expand = True
End If
+22 -1
View File
@@ -2990,6 +2990,22 @@ Public Class MainForm
End If
End If
If p.Script.IsAviSynth AndAlso TypeOf p.VideoEncoder Is x264Enc AndAlso
p.Script.Info.ColorSpace <> ColorSpace.YUV420P8 AndAlso
p.Script.Info.ColorSpace <> ColorSpace.YUV422P8 AndAlso
p.Script.Info.ColorSpace <> ColorSpace.YUV444P8 AndAlso
p.Script.Info.ColorSpace <> ColorSpace.BGR32 AndAlso
Not g.ContainsPipeTool(p.VideoEncoder.GetCommandLine(True, True)) Then
If ProcessTip("x264 AviSynth input supports only YUV420P8, YUV422P8, YUV444P8 and BGR32 " +
$"as input colorspace.{BR}Consider to use a pipe tool: " +
"x264 Options > Input/Output > Pipe > avs2pipemod y4m") Then
gbAssistant.Text = "Incompatible colorspace"
CanIgnoreTip = False
Return False
End If
End If
If p.Script.Info.Width Mod p.ForcedOutputMod <> 0 Then
If ProcessTip("Change output width to be divisible by " & p.ForcedOutputMod &
" or customize:" + BR + "Options > Image > Output Mod") Then
@@ -3901,7 +3917,7 @@ Public Class MainForm
Optional position As Integer = -1)
If Not CanIgnoreTip Then
MsgWarn("The current assistant warning cannot be skipped.")
MsgWarn("Assistant warning cannot be skipped.")
Exit Sub
End If
@@ -4403,6 +4419,11 @@ Public Class MainForm
b.Checked = p.ExtractTimestamps
b.SaveAction = Sub(value) p.ExtractTimestamps = value
b = ui.AddBool(miscPage)
b.Text = "Use source file folder for temp files"
b.Checked = p.NoTempDir
b.SaveAction = Sub(value) p.NoTempDir = value
ui.AddLine(miscPage, "Compressibility Check")
b = ui.AddBool(miscPage)
+28 -24
View File
@@ -808,37 +808,41 @@ Public Class GlobalClass
Sub SetTempDir()
If p.SourceFile <> "" Then
p.TempDir = Macro.Expand(p.TempDir)
If p.NoTempDir Then
p.TempDir = p.SourceFile.Dir
Else
p.TempDir = Macro.Expand(p.TempDir)
If p.TempDir = "" Then
If p.SourceFile.Dir.EndsWith("_temp\") Then
p.TempDir = p.SourceFile.Dir
Else
p.TempDir = p.SourceFile.Dir + p.SourceFile.Base + "_temp\"
If p.TempDir = "" Then
If p.SourceFile.Dir.EndsWith("_temp\") Then
p.TempDir = p.SourceFile.Dir
Else
p.TempDir = p.SourceFile.Dir + p.SourceFile.Base + "_temp\"
End If
End If
End If
p.TempDir = p.TempDir.FixDir
p.TempDir = p.TempDir.FixDir
If Not Directory.Exists(p.TempDir) Then
Try
Directory.CreateDirectory(p.TempDir)
Catch
If Not Directory.Exists(p.TempDir) Then
Try
p.TempDir = p.SourceFile.DirAndBase + "_temp\"
If Not Directory.Exists(p.TempDir) Then
Directory.CreateDirectory(p.TempDir)
End If
Directory.CreateDirectory(p.TempDir)
Catch
MsgWarn("Failed to create a temp directory. By default it's created " +
"in the directory of the source file so it's not possible " +
"to open files directly from a optical drive unless a temp directory " +
"is defined in the options. Usually discs are copied to the hard drive " +
"first using a application like MakeMKV, DVDFab or AnyDVD.")
Throw New AbortException
Try
p.TempDir = p.SourceFile.DirAndBase + "_temp\"
If Not Directory.Exists(p.TempDir) Then
Directory.CreateDirectory(p.TempDir)
End If
Catch
MsgWarn("Failed to create a temp directory. By default it's created " +
"in the directory of the source file so it's not possible " +
"to open files directly from a optical drive unless a temp directory " +
"is defined in the options. Usually discs are copied to the hard drive " +
"first using a application like MakeMKV, DVDFab or AnyDVD.")
Throw New AbortException
End Try
End Try
End Try
End If
End If
Folder.Current = p.TempDir
+1
View File
@@ -54,6 +54,7 @@ Public Class Project
Public MKVHDR As Boolean
Public MTN As Boolean
Public NoDialogs As Boolean
Public NoTempDir As Boolean
Public PreferredAudio As String
Public PreferredSubtitles As String
Public Ranges As List(Of Range)