mirror of
https://github.com/staxrip/staxrip.git
synced 2026-10-29 06:06:44 +08:00
Weight property added to encoder framework
This commit is contained in:
+6
-6
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user