Weight property added to encoder framework

This commit is contained in:
Frank Skare
2021-02-12 14:17:28 +01:00
parent 4d16b37e6b
commit a4e2c04234
2 changed files with 13 additions and 6 deletions
+6 -6
View File
@@ -917,10 +917,10 @@ Public Class x265Params
.Init = 1}
Property ProgressReadframes As New BoolParam() With {
.HelpSwitch = "--progress-readframes",
.Switch = "--progress-readframes",
.Text = "Progress Readframes",
.Help = "Print how much frames retrieved from reader",
.Init = False,
.Weight = 9,
.VisibleFunc = Function() Package.x265Type = x265Type.DJATOM}
Overrides ReadOnly Property Items As List(Of CommandLineParam)
@@ -1118,6 +1118,10 @@ Public Class x265Params
item.HelpSwitch = switches(0)
Next
If HasWeight Then
ItemsValue = ItemsValue.OrderBy(Function(i) i.Weight).ToList
End If
End If
Return ItemsValue
@@ -1423,10 +1427,6 @@ Public Class x265Params
End If
End If
If ProgressReadframes.Value AndAlso Not IsCustom(pass, ProgressReadframes.HelpSwitch) Then
sb.Append(" " + ProgressReadframes.HelpSwitch)
End If
Return Macro.Expand(sb.ToString.Trim.FixBreak.Replace(BR, " "))
End Function
+7
View File
@@ -6,6 +6,7 @@ Namespace CommandLine
Public MustInherit Class CommandLineParams
Property Title As String
Property Separator As String = " "
Property HasWeight As Boolean
Event ValueChanged(item As CommandLineParam)
MustOverride ReadOnly Property Items As List(Of CommandLineParam)
@@ -32,6 +33,11 @@ Namespace CommandLine
Protected Sub Add(path As String, ParamArray items As CommandLineParam())
For Each i In items
i.Path = path
If i.Weight <> 0 Then
HasWeight = True
End If
ItemsValue.Add(i)
Next
End Sub
@@ -121,6 +127,7 @@ Namespace CommandLine
Property Text As String
Property URLs As List(Of String)
Property VisibleFunc As Func(Of Boolean)
Property Weight As Integer
Friend Store As PrimitiveStore
Friend Params As CommandLineParams