mirror of
https://github.com/staxrip/staxrip.git
synced 2026-10-28 13:38:01 +08:00
menu renderer
This commit is contained in:
@@ -272,7 +272,7 @@ Public Class ProcessingForm
|
||||
|
||||
Sub StopAfterCurrentJob()
|
||||
g.StopAfterCurrentJob = Not g.StopAfterCurrentJob
|
||||
StopAfterCurrentJobMenuItem.SetImage(If(g.StopAfterCurrentJob, Symbol.CheckMark, Symbol.None))
|
||||
StopAfterCurrentJobMenuItem.Checked = g.StopAfterCurrentJob
|
||||
End Sub
|
||||
|
||||
Sub Abort()
|
||||
@@ -296,7 +296,7 @@ Public Class ProcessingForm
|
||||
mbShutdown.Enabled = g.IsJobProcessing
|
||||
bnJobs.Enabled = g.IsJobProcessing
|
||||
StopAfterCurrentJobMenuItem.Enabled = g.IsJobProcessing
|
||||
StopAfterCurrentJobMenuItem.SetImage(If(g.StopAfterCurrentJob, Symbol.CheckMark, Symbol.None))
|
||||
StopAfterCurrentJobMenuItem.Checked = g.StopAfterCurrentJob
|
||||
mbShutdown.Value = CType(Registry.CurrentUser.GetInt("Software\" + Application.ProductName, "ShutdownMode"), ShutdownMode)
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
Imports StaxRip.UI
|
||||
|
||||
Public Class TestForm
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
|
||||
+17
-6
@@ -100,12 +100,20 @@ Public Class GlobalClass
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Sub Execute(fileName As String, arguments As String)
|
||||
Sub Execute(fileName As String, Optional arguments As String = Nothing)
|
||||
Dim info As New ProcessStartInfo
|
||||
info.UseShellExecute = False
|
||||
info.FileName = fileName
|
||||
info.Arguments = arguments
|
||||
Process.Start(info)?.Dispose()
|
||||
|
||||
If arguments <> "" Then
|
||||
info.Arguments = arguments
|
||||
End If
|
||||
|
||||
Using pr As New Process
|
||||
pr.StartInfo = info
|
||||
Proc.SetEnvironmentVariables(pr)
|
||||
pr.Start()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Sub ShellExecute(fileName As String, Optional arguments As String = Nothing)
|
||||
@@ -141,14 +149,17 @@ Public Class GlobalClass
|
||||
|
||||
Sub AddToPath(ParamArray dirs As String())
|
||||
Dim path = Environment.GetEnvironmentVariable("path")
|
||||
Dim newPath = path
|
||||
|
||||
For Each d In dirs
|
||||
If d.DirExists AndAlso Not d.StartsWith(Folder.System) Then
|
||||
path = d + ";" + path
|
||||
If d.DirExists AndAlso Not d.StartsWith(Folder.System) AndAlso Not path.Contains(d + ";") Then
|
||||
newPath = d + ";" + newPath
|
||||
End If
|
||||
Next
|
||||
|
||||
Environment.SetEnvironmentVariable("path", path)
|
||||
If newPath <> path Then
|
||||
Environment.SetEnvironmentVariable("path", newPath)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function IsFixedDrive(path As String) As Boolean
|
||||
|
||||
+22
-18
@@ -47,7 +47,11 @@ Public Class Package
|
||||
.WebURL = "https://github.com/dubhater/D2VWitch",
|
||||
.DownloadURL = "https://github.com/dubhater/D2VWitch/releases",
|
||||
.Location = "Support\D2V Witch",
|
||||
.RequiredFunc = Function() CommandLineDemuxer.IsActive("%app:D2V Witch%")})
|
||||
.RequiredFunc = Function() CommandLineDemuxer.IsActive("%app:D2V Witch%"),
|
||||
.LaunchAction = Sub()
|
||||
g.AddToPath(Package.d2vsource.Directory)
|
||||
g.Execute(D2VWitch.Path)
|
||||
End Sub})
|
||||
|
||||
Shared Property Haali As Package = Add(New Package With {
|
||||
.Name = "Haali Splitter",
|
||||
@@ -728,6 +732,23 @@ Public Class Package
|
||||
.AvsFilterNames = {"FFT3DGPU"},
|
||||
.AvsFiltersFunc = Function() {New VideoFilter("Noise", "FFT3DFilter | FFT3DGPU", "FFT3DGPU(sigma=1.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.4, NVPerf=$select:msg:Enable Nvidia Function;True;False$)")}})
|
||||
|
||||
Shared Property MPEG2DecPlus As Package = Add(New PluginPackage With {
|
||||
.Name = "MPEG2DecPlus",
|
||||
.Filename = "MPEG2DecPlus64.dll",
|
||||
.WebURL = "https://github.com/Asd-g/MPEG2DecPlus",
|
||||
.DownloadURL = "https://github.com/Asd-g/MPEG2DecPlus/releases",
|
||||
.Description = "Source filter to open D2V index files created with DGIndex or D2V Witch.",
|
||||
.AvsFilterNames = {"MPEG2Source"},
|
||||
.AvsFiltersFunc = Function() {New VideoFilter("Source", "MPEG2Source", "MPEG2Source(""%source_file%"")")}})
|
||||
|
||||
Shared Property d2vsource As Package = Add(New PluginPackage With {
|
||||
.Name = "d2vsource",
|
||||
.Filename = "d2vsource.dll",
|
||||
.Description = "Source filter to open D2V index files created with DGIndex or D2V Witch.",
|
||||
.WebURL = "http://github.com/dwbuiten/d2vsource",
|
||||
.VSFilterNames = {"d2v.Source"},
|
||||
.VSFiltersFunc = Function() {New VideoFilter("Source", "d2vsource", "clip = core.d2v.Source(r""%source_file%"")")}})
|
||||
|
||||
Shared Sub New()
|
||||
Add(New PluginPackage With {
|
||||
.Name = "KNLMeansCL",
|
||||
@@ -741,15 +762,6 @@ Public Class Package
|
||||
.AvsFiltersFunc = Function() {New VideoFilter("Noise", "NLMeans | KNLMeansCL", "KNLMeansCL(D=1, A=1, h=$select:msg:Select Strength;Light|2;Medium|4;Strong|4$, device_type=""auto"")")},
|
||||
.VSFiltersFunc = Function() {New VideoFilter("Noise", "KNLMeansCL", "clip = core.knlm.KNLMeansCL(clip, d=1, a=1, h=$select:msg:Select Strength;Light|2;Medium|4;Strong|4$, device_type='auto')")}})
|
||||
|
||||
Add(New PluginPackage With {
|
||||
.Name = "MPEG2DecPlus",
|
||||
.Filename = "MPEG2DecPlus64.dll",
|
||||
.WebURL = "https://github.com/Asd-g/MPEG2DecPlus",
|
||||
.DownloadURL = "https://github.com/Asd-g/MPEG2DecPlus/releases",
|
||||
.Description = "Source filter to open D2V index files created with DGIndex or D2V Witch.",
|
||||
.AvsFilterNames = {"MPEG2Source"},
|
||||
.AvsFiltersFunc = Function() {New VideoFilter("Source", "MPEG2Source", "MPEG2Source(""%source_file%"")")}})
|
||||
|
||||
Add(New PluginPackage With {
|
||||
.Name = "DSS2mod",
|
||||
.Filename = "avss.dll",
|
||||
@@ -1555,14 +1567,6 @@ Public Class Package
|
||||
"mvsfunc.GetMatrix", "mvsfunc.zDepth", "mvsfunc.GetPlane", "mvsfunc.PlaneAverage",
|
||||
"mvsfunc.Preview", "mvsfunc.GrayScale"}})
|
||||
|
||||
Add(New PluginPackage With {
|
||||
.Name = "d2vsource",
|
||||
.Filename = "d2vsource.dll",
|
||||
.Description = "Source filter to open D2V index files created with DGIndex or D2V Witch.",
|
||||
.WebURL = "http://github.com/dwbuiten/d2vsource",
|
||||
.VSFilterNames = {"d2v.Source"},
|
||||
.VSFiltersFunc = Function() {New VideoFilter("Source", "d2vsource", "clip = core.d2v.Source(r""%source_file%"")")}})
|
||||
|
||||
Add(New PluginPackage With {
|
||||
.Name = "Bwdif",
|
||||
.Filename = "Bwdif.dll",
|
||||
|
||||
+8
-13
@@ -1156,23 +1156,20 @@ Namespace UI
|
||||
Dim x3 = x1 + w
|
||||
Dim y3 = y1
|
||||
|
||||
Using brush = New SolidBrush(ForeColor)
|
||||
Using pen = New Pen(brush, Font.Height / 20.0F)
|
||||
e.Graphics.DrawLine(pen, x1, y1, x2, y2)
|
||||
e.Graphics.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
Using pen = New Pen(ForeColor, Font.Height / 16.0F)
|
||||
e.Graphics.DrawLine(pen, x1, y1, x2, y2)
|
||||
e.Graphics.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
End If
|
||||
|
||||
If Symbol <> ButtonSymbol.None Then
|
||||
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
|
||||
|
||||
Dim p = New Pen(Brushes.Black)
|
||||
p = New Pen(Brushes.Black)
|
||||
Dim p = New Pen(Color.Black)
|
||||
p.Alignment = Drawing2D.PenAlignment.Center
|
||||
p.EndCap = Drawing2D.LineCap.Round
|
||||
p.StartCap = Drawing2D.LineCap.Round
|
||||
p.Width = Height \ 12
|
||||
p.Width = CInt(Height / 14)
|
||||
|
||||
Dim d As New SymbolDrawer()
|
||||
d.Graphics = e.Graphics
|
||||
@@ -1886,11 +1883,9 @@ Namespace UI
|
||||
y3 = y1
|
||||
End If
|
||||
|
||||
Using brush = New SolidBrush(If(Enabled, Color.Black, SystemColors.GrayText))
|
||||
Using pen = New Pen(brush, Font.Height / 20.0F)
|
||||
e.Graphics.DrawLine(pen, x1, y1, x2, y2)
|
||||
e.Graphics.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
Using pen = New Pen(If(Enabled, Color.Black, SystemColors.GrayText), Font.Height / 20.0F)
|
||||
e.Graphics.DrawLine(pen, x1, y1, x2, y2)
|
||||
e.Graphics.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ Public Class Thumbnails
|
||||
|
||||
gp.AddString(timestamp, ft.FontFamily, CInt(ft.Style), ft.Size, pt, New StringFormat())
|
||||
|
||||
Using pen As New Pen(Brushes.Black, ft.Height \ 5)
|
||||
Using pen As New Pen(Color.Black, ft.Height \ 5)
|
||||
g.DrawPath(pen, gp)
|
||||
End Using
|
||||
|
||||
|
||||
+43
-11
@@ -240,8 +240,44 @@ Public Class ToolStripRendererEx
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnRenderItemCheck(e As ToolStripItemImageRenderEventArgs)
|
||||
Dim item = TryCast(e.Item, ToolStripMenuItem)
|
||||
|
||||
If item Is Nothing OrElse Not item.Checked Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim gx = e.Graphics
|
||||
gx.SmoothingMode = SmoothingMode.AntiAlias
|
||||
Dim h = item.Height
|
||||
|
||||
If IsFlat() Then
|
||||
Dim rect = New Rectangle(2, 0, h, h)
|
||||
Dim col = If(item.Selected, Color.FromArgb(&HFF56B0FA), ColorChecked)
|
||||
|
||||
Using brush As New SolidBrush(col)
|
||||
gx.FillRectangle(brush, rect)
|
||||
End Using
|
||||
End If
|
||||
|
||||
Dim x1 = CInt(2 + h * 0.4)
|
||||
Dim y1 = CInt(h * 0.7)
|
||||
|
||||
Dim x2 = CInt(x1 - h * 0.2)
|
||||
Dim y2 = CInt(y1 - h * 0.2)
|
||||
|
||||
Dim x3 = CInt(x1 + h * 0.37)
|
||||
Dim y3 = CInt(y1 - h * 0.37)
|
||||
|
||||
Using pen = New Pen(Color.Black, e.Item.Font.Height / 16.0F)
|
||||
gx.DrawLine(pen, x1, y1, x2, y2)
|
||||
gx.DrawLine(pen, x1, y1, x3, y3)
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Protected Overloads Overrides Sub OnRenderArrow(e As ToolStripArrowRenderEventArgs)
|
||||
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
|
||||
Dim gx = e.Graphics
|
||||
gx.SmoothingMode = SmoothingMode.HighQuality
|
||||
|
||||
If e.Direction = ArrowDirection.Down Then
|
||||
Dim h = CInt(e.Item.Font.Height * 0.3)
|
||||
@@ -257,11 +293,9 @@ Public Class ToolStripRendererEx
|
||||
Dim x3 = x1 + w
|
||||
Dim y3 = y1
|
||||
|
||||
Using brush = New SolidBrush(e.Item.ForeColor)
|
||||
Using pen = New Pen(brush, e.Item.Font.Height / 20.0F)
|
||||
e.Graphics.DrawLine(pen, x1, y1, x2, y2)
|
||||
e.Graphics.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
Using pen = New Pen(e.Item.ForeColor, e.Item.Font.Height / 16.0F)
|
||||
gx.DrawLine(pen, x1, y1, x2, y2)
|
||||
gx.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
Else
|
||||
Dim x1 = e.Item.Width - e.Item.Height * 0.6F
|
||||
@@ -273,11 +307,9 @@ Public Class ToolStripRendererEx
|
||||
Dim x3 = x1
|
||||
Dim y3 = e.Item.Height * 0.75F
|
||||
|
||||
Using brush = New SolidBrush(e.Item.ForeColor)
|
||||
Using pen = New Pen(brush, e.Item.Font.Height / 20.0F)
|
||||
e.Graphics.DrawLine(pen, x1, y1, x2, y2)
|
||||
e.Graphics.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
Using pen = New Pen(e.Item.ForeColor, e.Item.Font.Height / 16.0F)
|
||||
gx.DrawLine(pen, x1, y1, x2, y2)
|
||||
gx.DrawLine(pen, x2, y2, x3, y3)
|
||||
End Using
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user