Permalink
Browse files

-

  • Loading branch information...
stax76
stax76 committed Oct 3, 2017
1 parent 2e08134 commit eeae822bcb0540a8351af8a6453cb1394e176c79
Showing with 4,706 additions and 283 deletions.
  1. +4 −110 Forms/MainForm.vb
  2. +39 −39 General/ApplicationSettings.vb
  3. +9 −1 General/General.vb
  4. +98 −5 General/GlobalCommands.vb
  5. +23 −11 General/Misc.vb
  6. +2 −97 README.md
  7. +487 −0 docs/cli.rst
  8. +25 −0 docs/events.rst
  9. +35 −1 docs/features.rst
  10. +4 −0 docs/index.rst
  11. +54 −2 docs/intro.rst
  12. +1,049 −0 docs/macros.rst
  13. +2,797 −0 docs/mediainfo.rst
  14. +19 −16 docs/powershell.rst
  15. +25 −0 docs/powershell_events.rst
  16. +35 −0 docs/support.rst
  17. +1 −1 docs/tools.rst
View
@@ -1380,15 +1380,10 @@ Public Class MainForm
Dim plugin = TryCast(iPackage, PluginPackage)
If plugin Is Nothing Then
ActionMenuItem.Add(i.DropDownItems, "Apps | " + iPackage.Name, Sub() g.StartProcess(helpPath))
ActionMenuItem.Add(i.DropDownItems, iPackage.Name.Substring(0, 1).Upper + " | " + iPackage.Name, Sub() g.StartProcess(helpPath))
Else
If plugin.AvsFilterNames?.Length > 0 Then
ActionMenuItem.Add(i.DropDownItems, "Plugins | AviSynth | " + iPackage.Name, Sub() g.StartProcess(iPackage.GetHelpPath(ScriptEngine.AviSynth)))
End If
If plugin.VSFilterNames?.Length > 0 Then
ActionMenuItem.Add(i.DropDownItems, "Plugins | VapourSynth | " + iPackage.Name, Sub() g.StartProcess(iPackage.GetHelpPath(ScriptEngine.VapourSynth)))
End If
If plugin.AvsFilterNames?.Length > 0 Then ActionMenuItem.Add(i.DropDownItems, iPackage.Name.Substring(0, 1).Upper + " | " + iPackage.Name + " (AviSynth)", Sub() g.StartProcess(iPackage.GetHelpPath(ScriptEngine.AviSynth)))
If plugin.VSFilterNames?.Length > 0 Then ActionMenuItem.Add(i.DropDownItems, iPackage.Name.Substring(0, 1).Upper + " | " + iPackage.Name + " (VapourSynth)", Sub() g.StartProcess(iPackage.GetHelpPath(ScriptEngine.VapourSynth)))
End If
End If
Next
@@ -4263,95 +4258,6 @@ Public Class MainForm
End Using
End Sub
<Command("Shows help for command line automation.")>
Private Sub ShowCommandLineHelp()
BeginInvoke(Sub() ShowCommandLineHelpInternal())
End Sub
<Command("Shows help for script automation.")>
Private Sub ShowScriptingHelp()
BeginInvoke(Sub() ShowScriptingHelpInternal())
End Sub
Private Sub ShowCommandLineHelpInternal()
Dim f As New HelpForm()
f.Owner = Me
f.Doc.WriteStart("Command Line Reference")
f.Doc.WriteP("Switches are processed in the order they appear in the command line.")
f.Doc.WriteP("The command line interface, main menu and Event Commands feature are built on top of a common command engine which exposes a rich set of commands.")
f.Doc.WriteP("There is a special mode where only the MediaInfo window is shown using -mediainfo <file>, this is useful for Windows File Explorer integration with an app like Open++.")
f.Doc.WriteElement("h2", "Examples")
f.Doc.WriteP("StaxRip ""C:\Movie\project.srip""")
f.Doc.WriteP("StaxRip ""C:\Movie\VTS_01_1.VOB"" ""C:\Movie 2\VTS_01_2.VOB""")
f.Doc.WriteP("StaxRip -LoadTemplate:DVB ""C:\Movie\capture.mpg"" -StartEncoding -Standby")
f.Doc.WriteP("StaxRip -ShowMessageBox:""main text..."",""text..."",info")
Dim commands As New List(Of Command)(CommandManager.Commands.Values)
commands.Sort()
Dim commandList As New StringPairList
For Each command In commands
Dim params = command.MethodInfo.GetParameters
Dim cl = "-" + command.MethodInfo.Name + ":"
For Each param In params
cl += param.Name + ","
Next
cl = cl.TrimEnd(",:".ToCharArray)
f.Doc.WriteH2(cl)
For Each param In params
Dim d = param.GetCustomAttribute(Of DescriptionAttribute)
If Not d Is Nothing Then
f.Doc.WriteP(param.Name + ": " + param.GetCustomAttribute(Of DescriptionAttribute).Description)
End If
Next
Dim enumList As New List(Of String)
For Each param In params
If param.ParameterType.IsEnum Then
enumList.Add(param.ParameterType.Name + ": " +
System.Enum.GetNames(param.ParameterType).Join(", "))
End If
Next
For Each en In enumList
f.Doc.WriteP(en)
Next
f.Doc.WriteP(command.Attribute.Description)
Next
f.Show()
End Sub
Private Sub ShowScriptingHelpInternal()
Dim f As New HelpForm()
f.Doc.WriteStart("Scripting")
f.Doc.WriteP("StaxRip can be automated via PowerShell scripting, the documentation is on github:")
f.Doc.WriteP("[https://github.com/stax76/staxrip#scripting https://github.com/stax76/staxrip#scripting]")
f.Doc.WriteH2("In order to run scripts on certain events the following events are available:")
For Each i As ApplicationEvent In System.Enum.GetValues(GetType(ApplicationEvent))
f.Doc.WriteP(i.ToString + ": " + DispNameAttribute.GetValueForEnum(i))
Next
f.Doc.WriteH2("The following paths are recognized:")
For Each i In System.Enum.GetNames(GetType(ApplicationEvent))
f.Doc.WriteP(Folder.Settings + "Scripts\" + i.ToString + ".ps1")
Next
f.Show()
End Sub
<Command("Opens a given URL or local file in the help browser.")>
Sub ShowHelpURL(
<DispName("URL"),
@@ -4423,19 +4329,8 @@ Public Class MainForm
ret.Add("Apps|-")
ret.Add("Apps|Manage...", NameOf(ShowAppsDialog))
ret.Add("Help|Documentation", NameOf(g.DefaultCommands.ExecuteCommandLine), Symbol.Lightbulb, {"https://github.com/stax76/staxrip#documentation"})
ret.Add("Help|Support Forum", Symbol.People)
ret.Add("Help|Support Forum|forum.doom9.org", NameOf(g.DefaultCommands.ExecuteCommandLine), {"http://forum.doom9.org/showthread.php?t=172068&page=999999"})
If g.IsCulture("de") Then ret.Add("Help|Support Forum|forum.gleitz.info", NameOf(g.DefaultCommands.ExecuteCommandLine), {"http://forum.gleitz.info/showthread.php?26177-StaxRip-Encoding-Frontend-%28Diskussion%29/page999999"})
ret.Add("Help|Support Forum|forum.videohelp.com", NameOf(g.DefaultCommands.ExecuteCommandLine), {"http://forum.videohelp.com/threads/369913-StaxRip-x64-for-AviSynth-VapourSynth-x264-x265-GPU-encoding/page999999"})
ret.Add("Help|Website", Symbol.Globe)
ret.Add("Help|Website|Issue Tracker", NameOf(g.DefaultCommands.ExecuteCommandLine), Symbol.fa_bug, {"https://github.com/stax76/staxrip/issues"})
ret.Add("Help|Website|Release Build", NameOf(g.DefaultCommands.ExecuteCommandLine), {"https://github.com/stax76/staxrip/releases"})
ret.Add("Help|Website|Test Build", NameOf(g.DefaultCommands.ExecuteCommandLine), {"https://github.com/stax76/staxrip/blob/master/changelog.md"})
ret.Add("Help|Docs", NameOf(g.DefaultCommands.ExecuteCommandLine), Symbol.Lightbulb, {"http://staxrip.readthedocs.io"})
ret.Add("Help|Donate", NameOf(g.DefaultCommands.ExecuteCommandLine), Symbol.Heart, {Strings.DonationsURL})
ret.Add("Help|Scripting", NameOf(ShowScriptingHelp), Symbol.Code)
ret.Add("Help|Command Line", NameOf(ShowCommandLineHelp), Symbol.fa_terminal)
ret.Add("Help|Macros", NameOf(g.DefaultCommands.OpenHelpTopic), Symbol.CalculatorPercentage, {"macros"})
ret.Add("Help|Apps", NameOf(DynamicMenuItem), {DynamicMenuItemID.HelpApplications})
ret.Add("Help|-")
ret.Add("Help|Info...", NameOf(g.DefaultCommands.OpenHelpTopic), Symbol.Info, {"info"})
@@ -4806,7 +4701,6 @@ Public Class MainForm
End If
Catch ex As Exception
MsgWarn("Error parsing argument:" + BR2 + i.Value + BR2 + ex.Message)
ShowScriptingHelp()
End Try
Next
@@ -218,7 +218,7 @@ Public Class ApplicationSettings
CustomMenuCrop = CropForm.GetDefaultMenuCrop
End If
If Check(CustomMenuMainForm, "Main menu in main window", 161) Then
If Check(CustomMenuMainForm, "Main menu in main window", 163) Then
CustomMenuMainForm = MainForm.GetDefaultMenuMain
End If
@@ -280,44 +280,44 @@ Public Class ApplicationSettings
Dim mainMenuVersion = 14
If Not Storage.GetBool("main menu update" & mainMenuVersion) Then
If 0 = CustomMenuMainForm.GetAllItems().Where(
Function(val) Not val.Parameters.NothingOrEmpty AndAlso
TypeOf val.Parameters(0) Is String AndAlso
val.Parameters(0).ToString.Contains("Log Files")).Count Then
CustomMenuMainForm.Add("Tools|Directories|Log Files", NameOf(g.DefaultCommands.ExecuteCommandLine), {"""%settings_dir%Log Files"""})
End If
For Each i In CustomMenuMainForm.GetAllItems()
If i.MethodName = NameOf(g.DefaultCommands.ExecuteCommandLine) AndAlso
i.Parameters.Count > 0 AndAlso TypeOf i.Parameters(0) Is String AndAlso
i.Parameters(0).ToString <> "" AndAlso i.Parameters(0).ToString.EndsWith("test-build.md") Then
i.Parameters(0) = "https://github.com/stax76/staxrip/blob/master/changelog.md"
Exit For
End If
Next
For Each i In CustomMenuMainForm.GetAllItems()
If i.MethodName = NameOf(g.DefaultCommands.ExecuteCommandLine) AndAlso
i.Parameters.Count > 0 AndAlso TypeOf i.Parameters(0) Is String AndAlso
i.Parameters(0).ToString <> "" AndAlso i.Parameters(0).ToString.EndsWith("/md/changelog.md") Then
i.Parameters(0) = "https://github.com/stax76/staxrip/blob/master/changelog.md"
Exit For
End If
Next
For Each i In CustomMenuMainForm.GetAllItems()
If i.MethodName = NameOf(g.DefaultCommands.ExecuteCommandLine) AndAlso
i.Parameters.Count > 0 AndAlso TypeOf i.Parameters(0) Is String AndAlso
i.Parameters(0).ToString <> "" AndAlso i.Parameters(0).ToString.EndsWith("_staxrip.log""") Then
i.MethodName = "ShowLogFile"
i.Parameters.Clear()
Exit For
End If
Next
'If 0 = CustomMenuMainForm.GetAllItems().Where(
' Function(val) Not val.Parameters.NothingOrEmpty AndAlso
' TypeOf val.Parameters(0) Is String AndAlso
' val.Parameters(0).ToString.Contains("Log Files")).Count Then
' CustomMenuMainForm.Add("Tools|Directories|Log Files", NameOf(g.DefaultCommands.ExecuteCommandLine), {"""%settings_dir%Log Files"""})
'End If
'For Each i In CustomMenuMainForm.GetAllItems()
' If i.MethodName = NameOf(g.DefaultCommands.ExecuteCommandLine) AndAlso
' i.Parameters.Count > 0 AndAlso TypeOf i.Parameters(0) Is String AndAlso
' i.Parameters(0).ToString <> "" AndAlso i.Parameters(0).ToString.EndsWith("test-build.md") Then
' i.Parameters(0) = "https://github.com/stax76/staxrip/blob/master/changelog.md"
' Exit For
' End If
'Next
'For Each i In CustomMenuMainForm.GetAllItems()
' If i.MethodName = NameOf(g.DefaultCommands.ExecuteCommandLine) AndAlso
' i.Parameters.Count > 0 AndAlso TypeOf i.Parameters(0) Is String AndAlso
' i.Parameters(0).ToString <> "" AndAlso i.Parameters(0).ToString.EndsWith("/md/changelog.md") Then
' i.Parameters(0) = "https://github.com/stax76/staxrip/blob/master/changelog.md"
' Exit For
' End If
'Next
'For Each i In CustomMenuMainForm.GetAllItems()
' If i.MethodName = NameOf(g.DefaultCommands.ExecuteCommandLine) AndAlso
' i.Parameters.Count > 0 AndAlso TypeOf i.Parameters(0) Is String AndAlso
' i.Parameters(0).ToString <> "" AndAlso i.Parameters(0).ToString.EndsWith("_staxrip.log""") Then
' i.MethodName = "ShowLogFile"
' i.Parameters.Clear()
' Exit For
' End If
'Next
Storage.SetBool("main menu update" & mainMenuVersion, True)
End If
View
@@ -774,7 +774,7 @@ table {
End Sub
Sub WriteTable(title As String, text As String, list As StringPairList)
WriteTable(title, text, list, True)
WriteTable(title, text, list, False)
End Sub
Private Sub WriteTable(title As String, text As String, list As StringPairList, sort As Boolean)
@@ -797,6 +797,14 @@ table {
Writer.WriteAttributeString("bordercolordark", "white")
Writer.WriteAttributeString("bordercolorlight", "black")
Writer.WriteStartElement("col")
Writer.WriteAttributeString("style", "width: 40%")
Writer.WriteEndElement()
Writer.WriteStartElement("col")
Writer.WriteAttributeString("style", "width: 60%")
Writer.WriteEndElement()
For Each i As StringPair In list
Writer.WriteStartElement("tr")
Writer.WriteStartElement("td")
View
@@ -234,9 +234,9 @@ Public Class GlobalCommands
End Using
End Sub
<Command("Executes a PowerShell (*.ps1) script.")>
<Command("Executes a PowerShell script.")>
Sub ExecuteScriptFile(<DispName("File Path")>
<Description("Filepath to a PowerShell (*.ps1) script, the path may contain macros.")>
<Description("Filepath to a PowerShell script, the path may contain macros.")>
<Editor(GetType(OpenFileDialogEditor), GetType(UITypeEditor))>
filepath As String)
@@ -276,6 +276,11 @@ Public Class GlobalCommands
<Command("Test")>
Sub Test()
If Not File.Exists(Folder.Startup.Parent + "Encoding\nvenc.vb") Then
MsgError("This feature is development related.")
Exit Sub
End If
Dim msg = ""
Dim nvExcept = "--help --version --check-device --avsw --input-analyze
@@ -468,6 +473,97 @@ Public Class GlobalCommands
screenshots.WriteUTF8File("D:\Projekte\VS\VB\StaxRip\docs\screenshots.rst")
Dim macros = "Macros" + BR + "======" + BR2
For Each i In Macro.GetTips
macros += "``" + i.Name + "``" + BR2 + i.Value + BR2
Next
macros.WriteUTF8File("D:\Projekte\VS\VB\StaxRip\docs\macros.rst")
Dim scriptingEvents = ""
For Each i As ApplicationEvent In System.Enum.GetValues(GetType(ApplicationEvent))
scriptingEvents += "- ``" + i.ToString + "`` " + DispNameAttribute.GetValueForEnum(i) + BR
Next
scriptingEvents += BR + "Assign to an event by saving a script file in the scripting folder using the event name as file name." + BR2 + "The scripting folder can be opened with:" + BR2 + "Main Menu > Tools > Scripts > Open script folder" + BR2 + "Use one of the following file names:" + BR2
For Each i In System.Enum.GetNames(GetType(ApplicationEvent))
scriptingEvents += "- " + i.ToString + ".ps1" + BR
Next
scriptingEvents.WriteUTF8File("D:\Projekte\VS\VB\StaxRip\docs\powershell_events.rst")
Dim switches = "Command Line Interface
======================
Switches are processed in the order they appear in the command line.
The command line interface, the customizable main menu and Event Commands features are built with a shared command system.
There is a special mode where only the MediaInfo window is shown using -mediainfo , this is useful for Windows File Explorer integration with an app like Open++.
Examples
--------
StaxRip C:\\Movie\\project.srip
StaxRip C:\\Movie\\VTS_01_1.VOB C:\\Movie 2\\VTS_01_2.VOB
StaxRip -LoadTemplate:DVB C:\\Movie\\capture.mpg -StartEncoding -Standby
StaxRip -ShowMessageBox:""main text..."",""text ..."",info
Switches
--------
"
Dim commands As New List(Of Command)(g.MainForm.CommandManager.Commands.Values)
commands.Sort()
Dim commandList As New StringPairList
For Each command In commands
Dim params = command.MethodInfo.GetParameters
Dim switch = "-" + command.MethodInfo.Name + ":"
For Each param In params
switch += param.Name + ","
Next
switch = switch.TrimEnd(",:".ToCharArray)
switches += switch + BR + "~".Multiply(switch.Length) + BR2
For Each param In params
Dim d = param.GetCustomAttribute(Of DescriptionAttribute)
If Not d Is Nothing Then
switches += param.Name + ": " + param.GetCustomAttribute(Of DescriptionAttribute).Description + BR2
End If
Next
Dim enumList As New List(Of String)
For Each param In params
If param.ParameterType.IsEnum Then
enumList.Add(param.ParameterType.Name + ": " +
System.Enum.GetNames(param.ParameterType).Join(", "))
End If
Next
For Each en In enumList
switches += en + BR2
Next
switches += command.Attribute.Description + BR2 + BR
Next
switches.WriteUTF8File("D:\Projekte\VS\VB\StaxRip\docs\cli.rst")
If msg <> "" Then
Dim fs = Folder.Temp + "staxrip todo.txt"
File.WriteAllText(fs, msg)
@@ -508,9 +604,6 @@ Public Class GlobalCommands
Dim f As New HelpForm()
Select Case topic
Case "macros"
f.Doc.WriteStart("Macros")
f.Doc.WriteTable("Macros", Strings.MacrosHelp, Macro.GetTips())
Case "info"
f.Doc.WriteStart("StaxRip " + Application.ProductVersion + " " + GetReleaseType())
Dim licensePath = Folder.Startup + "License.txt"
Oops, something went wrong.

0 comments on commit eeae822

Please sign in to comment.