Update Docs

This commit is contained in:
Dendraspis
2025-05-19 21:58:58 +02:00
parent ec65e63681
commit eea48499c6
29 changed files with 340 additions and 65 deletions
-3
View File
@@ -1,3 +0,0 @@
# [Documentation](../README.md) / Installation
- [Long Path Support](Long-Path-Support.md)
+4 -2
View File
@@ -26,8 +26,10 @@ Users are encouraged to visit those [communities](Community.md) for help and mor
## Target Group
Everyone, who wants to encode videos safely and in a controlled and transparent way and who is not afraid to
invest some time in getting to know StaxRip, testing things out, reading the documentation and asking questions if necessary.
Everyone, who wants to encode videos safely and in a controlled and transparent way,
especially by the usage of [AviSynth+](../Usage/Frame-Servers.md) or [VapourSynth](../Usage/Frame-Servers.md),
and who is not afraid to invest some time in getting to know StaxRip,
testing things out, reading the documentation and asking questions if necessary.
## License
+3
View File
@@ -19,7 +19,10 @@ you can replace these tools with an older, compatible, version, which should wor
- **StaxRip** itself
- The *Blu-ray ISO image opening and mounting feature* requires at least **Windows 8** to work.
- **MKVToolNix**
- Latest working version is reported to be `v64.0`. Last (complete) working StaxRip version is *StaxRip v2.10.0 (2021-10-06)* including *MKVToolNix v61.0*
- Nevertheless `mkvtoolnix-64-bit-68.0.0-revision-001-g6a55c58d2` is reported to work, you can download it here: https://mkvtoolnix.download/windows/continuous/64-bit/68.0.0/
- **Python**
- Needed for VapourSynth. Last **Windows 7** compatible version was used in *StaxRip v2.25.0 (2023-08-02)*. As of now using VapourSynth R63 it could be possible to downgrade Python to `v3.8.*`that is **Windows 7** compatible, but requires experienced users.
For more information see: [Installation](Installation.md)
+9 -4
View File
@@ -6,7 +6,7 @@
> This documentation is under development and therefore incomplete.
> [!NOTE]
> This documentation is based on StaxRip **`v2.50.0`**.
> This documentation is based on StaxRip **`v2.54`**.
## [Introduction](Introduction/README.md)
- [Overview](Introduction/Overview.md)
@@ -29,10 +29,11 @@
- [Target](Usage/User-Interface/Main.md#target)
- [Filter](Usage/User-Interface/Main.md#filter)
- [Resize](Usage/User-Interface/Main.md#resize)
- [Encoder/Container](Usage/User-Interface/Main.md#encodercontainer) :x:
- [Audio](Usage/User-Interface/Main.md#audio) :x:
- [Encoder/Container](Usage/User-Interface/Main.md#encodercontainer)
- [Audio](Usage/User-Interface/Main.md#audio)
- [Assistant](Usage/User-Interface/Main.md#assistant)
- [Open Video Source File(s)](Usage/User-Interface/Opening.md) :x:
- [eac3to Demuxing](Usage/User-Interface/Opening#eac3to-demuxing.md) :x:
- [Template Selection](Usage/User-Interface/Template-Selection.md) :x:
- [Save Template](Usage/User-Interface/Save-Template.md)
- [Crop](Usage/User-Interface/Crop.md) :x:
@@ -64,8 +65,9 @@
- [Danger Zone](Usage/User-Interface/Settings.md#danger-zone) :x:
- [Frame Servers](Usage/Frame-Servers.md) :x:
- [Cropping](Usage/Cropping.md) :x:
- [Workflow](Usage/Workflow/README.md) :x:
- [Workflow](Usage/Workflow.md) :x:
- [Fonts](Usage/Fonts.md)
- [Events](Usage/Events.md) :x:
- [Macros](Usage/Macros.md)
- [Global Macros](Usage/Macros.md#global-macros)
- [Parameter Included Macros](Usage/Macros.md#parameter-included-macros)
@@ -73,6 +75,9 @@
- [Special Macros](Usage/Macros.md#special-macros)
- [Encoder Macros](Usage/Macros.md#encoder-macros)
- [While Processing Macros](Usage/Macros.md#while-processing-macros)
- [Function Macros](Usage/Macros.md#function-macros)
- [Appendix](Usage/Macros.md#appendix)
- [Appendix A: DataColumn Expression Syntax](Usage/Macros.md#appendix-a-datacolumn-expression-syntax)
- [Commands](Usage/Commands.md)
- [Command Line Interface](Usage/Command-Line-Interface.md)
- [Filter Profiles](Usage/Filter-Profiles.md) :x:
+2 -2
View File
@@ -191,7 +191,7 @@ Executes a PowerShell script file.
### -Exit
Exits StaxRip
Exits StaxRip.
### -ExitWithoutSaving
@@ -662,7 +662,7 @@ Runs all active jobs of the job list.
### -StartNewInstance
Launches a new instance of StaxRip
Launches a new instance of StaxRip.
### -StartSmartCrop
+2 -2
View File
@@ -191,7 +191,7 @@ Executes a PowerShell script file.
### Exit
Exits StaxRip
Exits StaxRip.
### ExitWithoutSaving
@@ -662,7 +662,7 @@ Runs all active jobs of the job list.
### StartNewInstance
Launches a new instance of StaxRip
Launches a new instance of StaxRip.
### StartSmartCrop
+1 -1
View File
@@ -40,4 +40,4 @@ as all decisions have been made and stored:
> [!TIP]
> For a better understanding of what you see, what you can use and most important *how*,
I recommend reading about the [Workflow](Workflow/README.md) and [User Interface](User-Interface/README.md).
I recommend reading about the [Workflow](Workflow.md) and [User Interface](User-Interface/README.md).
+2 -1
View File
@@ -11,6 +11,7 @@ To change them go to: `Tools » Settings » User Interface`:
> You can also add you own fonts.
> Make sure you use `.ttf` font files and put them into your Settings folder:
> - `.\Settings\Fonts\Code\` for *Code Fonts*
> - `.\Settings\Fonts\Default\` for *Defauls Fonts*
> - `.\Settings\Fonts\Default\` for *Default Fonts*
> - `.\Settings\Fonts\Thumbnail\` for *Thumbnail Fonts* (see [Project Options](User-Interface/Project-Options#User-Interface.md))
>
> Folder hierarchy doesn't matter as all subfolders are included for searching.
+119 -14
View File
@@ -1,14 +1,26 @@
# [Documentation](../README.md) / [Usage](README.md) / Macros
# [Documentation](../README.md) / [Usage](README.md) / Macros
Macros can be used almost everywhere in StaxRip and give you the ability to to set dynamic values where needed or wanted,
for example in scripts or settings. Most of them are also used for [events](Events.md) as criteria.
- [Global Macros](Macros.md#global-macros)
- [Parameter Included Macros](Macros.md#parameter-included-macros)
- [Interactive Macros](Macros.md#interactive-macros)
- [Special Macros](Macros.md#special-macros)
- [Encoder Macros](Macros.md#encoder-macros)
- [While Processing Macros](Macros.md#while-processing-macros)
- [Audio Track Macros](Macros.md#audio-track-macros)
- [Function Macros](Macros.md#function-macros)
- [Appendix](Macros.md#appendix)
- [Appendix A: DataColumn Expression Syntax](Macros.md#appendix-a-datacolumn-expression-syntax)
-----
## Global Macros
| Name | Description |
|---|---|
| `%audio_bitrate%` | Overall audio bitrate. |
| `%audio_bitrateX%` | Audio bitrate of the X'th audio track. |
| `%audio_channelsX%` | Audio channels of the X'th audio track. |
| `%audio_codecX%` | Audio codec of the X'th audio track. |
| `%audio_delayX%` | Audio delay of the X'th audio track. |
| `%audio_fileX%` | File path of the X'th audio file. |
| `%compressibility%` | Compressibility value. |
| `%crop_bottom%` | Bottom crop value. |
| `%crop_height%` | Crop height. |
@@ -89,22 +101,29 @@
| `%working_dir%` | Directory of the source file or the temp directory if enabled. |
## Parameter Included Macros
| Name | Description |
|---|---|
| `%app:name%` | Returns the path of a given tool, it can be any type of tool found in the Apps dialog. Example: %app:x265% |
| `%app_dir:name%` | Returns the directory of a given tool, it can be any type of tool found in the Apps dialog. Example: %app_dir:x265% |
| `%app_path:name%` | Returns the path of a given tool, it can be any type of tool found in the Apps dialog. Example: %app:x265% |
| `%app_version:name%` | Returns the version of a given tool, it can be any type of tool found in the Apps dialog. Example: %version:x265% |
| `%app_path:name%` | Returns the path of a given tool, it can be any type of tool found in the Apps dialog. Example: %app_path:x265% |
| `%app_version:name%` | Returns the version of a given tool, it can be any type of tool found in the Apps dialog. Example: %app_version:x265% |
| `%audio_bitrate:X%` | Audio bitrate of the X'th audio track. |
| `%audio_channels:X%` | Audio channels of the X'th audio track. |
| `%audio_codec:X%` | Audio codec of the X'th audio track. |
| `%audio_delay:X%` | Audio delay of the X'th audio track. |
| `%audio_file:X%` | File path of the X'th audio file. |
| `%eval:expression%` | Evaluates a PowerShell expression which may contain macros. |
| `%filter:name%` | Returns the script code of a filter of the active project that matches the specified name. |
| `%random:digits%` | Returns a 'digits' long random number, whereas 'digits' is clamped between 1 and 10. |
| `%source_mi_a:property%` | Returns the given MediaInfo property from the Audio section for the source file. Before ':' you can add a zero-based index for the track number of that section. |
| `%isfilteractive:name%` | Returns `1` if the filter is active, otherwise `0`. |
| `%random:digits%` | Returns a 'digits' long random number, whereas 'digits' is clamped between `1` and `10`. |
| `%source_mi_a:property%` | Returns the given MediaInfo property from the Audio section for the source file. Before `:` you can add a zero-based index for the track number of that section. |
| `%source_mi_g:property%` | Returns the given MediaInfo property from the General section for the source file. |
| `%source_mi_t:property%` | Returns the given MediaInfo property from the Text section for the source file. Before ':' you can add a zero-based index for the track number of that section. |
| `%source_mi_v:property%` | Returns the given MediaInfo property from the Video section for the source file. Before ':' you can add a zero-based index for the track number of that section. |
| `%source_mi_t:property%` | Returns the given MediaInfo property from the Text section for the source file. Before `:` you can add a zero-based index for the track number of that section. |
| `%source_mi_v:property%` | Returns the given MediaInfo property from the Video section for the source file. Before `:` you can add a zero-based index for the track number of that section. |
## Interactive Macros
Interactive macros can be used in certain menus like the filter profiles menu. They give you the ability to pop up dialogs in which you have to put values in or select an option.
| Name | Description |
|---|---|
| `$browse_file$` | Filepath returned from a file browser. |
@@ -117,19 +136,105 @@ Interactive macros can be used in certain menus like the filter profiles menu. T
### Encoder Macros
When choosing the option to override the target file name via the encoder options, you have the possibility to extend the normal macros with encoder specific ones.
The syntax is: `%parameter%`
**Note**: There are some special parameters, that might be not supported (yet). In such cases you can open a feature request.
> :information_source: There are some special parameters, that might be not supported (yet). In such cases you can open a [feature request](https://github.com/staxrip/staxrip/issues/new?template=request-a-feature.md).
Examples:
| Encoder | Example | Result |
|---|---|---|
| x265 | `%source_name%_CRF%--crf%_AQ-Mode%--aq-mode%` | `%source_name%_CRF23_AQ-Mode2` |
| SvtAv1EncApp | `%source_name%_CRF%--crf%_Predict%--pred-struct%` | `%source_name%_CRF35_Predict2` |
| SvtAv1EncApp | `%source_name%_CRF%--crf%_VBoost%--enable-variance-boost%` | `%source_name%_CRF35_VBoost1` |
Encoder related parameters can be extended with some modifiers to modify the output of the values.
| Modifier | Syntax | Example | Result | Note |
|---|---|---|---|---|
| ` ` | `%parameter%` | `%--preset%` | `VeryFast` | No modifier, normal value without spaces |
| `D` | `%parameter_D%` | `%--preset_D%` | `True` | `True` if the default value is set, otherwise `False` |
| `L` | `%parameter_L%` | `%--preset_L%` | `veryfast` | Value in lowercase without spaces |
| `T` | `%parameter_T%` | `%--preset_T%` | `Veryfast` | Value in Title-case (Only first letter in uppercase) without spaces |
| `U` | `%parameter_U%` | `%--preset_U%` | `VERYFAST` | Value in uppercase without spaces |
| `V` | `%parameter_V%` | `%--preset_V%` | `2` | Returns the numeric value of the option list,<br>`1` for checked checkboxes, otherwise `0`<br>[Only available for checkboxes and option lists] |
| `Z` | `%parameter_Z%` | `%--preset_Z%` | `0` | `1` in case it is active/visible, otherwise `0` |
> :warning: All modifier letters are **case sensitive**!
### While Processing Macros
These macros are only available while a process is running. They can be used for the `While Processing` event, for example to call an API.
| Name | Description |
|---|---|
| `%commandline%` | Returns the command line used for the running app. |
| `%progress%` | Returns the current progress as Integer value. |
| `%progressline%` | Returns the progress line received from the running app. |
### Audio Track Macros
These macros are only available in audio processing, for example inside the Audio Options.
| Name | Description |
|---|---|
| `%bitrate%` | Audio bitrate. |
| `%channels%` | Audio channels count. |
| `%delay%` | Audio delay. |
| `%input%` | Audio source file. |
| `%language_english%` | English language name. |
| `%language_native%` | Native language name. |
| `%output%` | Audio target file. |
| `%streamid0%` | ID of the stream (starts with 0). |
| `%streamid1%` | ID of the stream (starts with 1). |
## Function Macros
Function macros are similar to *normal* macros, but they don't just replace a text with a specific value; they can perform an action like a condition.
This makes it possible to return different strings depending on the expression, especially when cascaded/nested. The following table and the examples below should give you enough explanation and ideas.
- `<lower(<input>)>`
- **\<input\>** is any text you want to have in lower case
- Examples:
- `<lower(StaxRip is COOL)>` => `staxrip is cool`
- `<if(<expression>;<true>;<false>)>`
- **\<expression\>** corresponds to the [*Expression Syntax*](Macros.md#appendix-a-datacolumn-expression-syntax)
- Can also include another (nested) function
- **\<true\>** or **\<false\>** is returned depending on whether the expression is true or false
- Can be another (nested) function, a macro or any text
- First whitespace after `;` will be ignored
- Examples with `--preset VeryFast`:
- `<if('%--preset%' = 'Medium'; Default; %--preset%)>`
- `<if('%--preset_V%' = 2; Default; %--preset%)>`
- `<if('%--preset_V%' <> 0; %--preset%; 'PresetIs0')>`
- `<if('%--preset_V%' IN (0,1,2); Faster than Faster; Faster or slower)>`
- `<if('%--preset%' LIKE '*Fast*'; Includes 'Fast'; SomethingElse)>`
- `<if(%target_height% > 1080; 4K; <if(%target_height% > 720; FullHD; SD)>)>`
- `<if('%source_mi_g:Title%' <> ''; Original Title: %source_mi_g:Title%; <if('%source_mi_g:Movie%' <> ''; Original Title: %source_mi_g:Movie%; '')>)>`
- `<if(%--sao%; SAO; NoSAO)>`
- `<if(%--sao% AND NOT %--limit-sao%; FullSAO; <if(%--sao% AND %--limit-sao%; RestrictedSAO; NoSAO)>)>`
- `<if('%source_mi_v:Framerate%' >= 48; HiFPS; '')>`
- `<if(CONVERT(%source_mi_v:FrameRate%, 'System.Decimal') >= 48; HighFPS; '')>`
- `<replace(<input>;<oldText>;<newText>)>`
- **\<input\>** is any text you want to replace parts of
- **\<oldText\>** is the text or macro that shall be replaced
- First whitespace after `;` will be ignored
- **\<newText\>** is the text or macro that shall be used for the replacement
- First whitespace after `;` will be ignored
- Examples:
- `<replace(This is any text you like; you; I)>`
- `<replace(%source_name%; 1080p; 720p)>`
- `<title(<input>)>`
- **\<input\>** is any text you want to have in title case
- Examples:
- `<title(StaxRip is COOL)>` => `Staxrip Is Cool`
- `<upper(<input>)>`
- **\<input\>** is any text you want to have in upper case
- Examples:
- `<upper(StaxRip is COOL)>` => `STAXRIP IS COOL`
## Appendix
### Appendix A: DataColumn Expression Syntax
Generally the whole *ADO.NET DataColumn Expression Syntax* is supported. Here are the most important operands and functions:
- `+`, `-`, `*`, `/`, `%`
- `<`, `<=`, `<>`, `=`, `>=`, `>`, `IN`, `LIKE`
- `AND`, `OR`, `NOT`
- `CONVERT(expression, .NET Data Type)`, `LEN(expression)`, `ISNULL(expression, replacementvalue)`, `SUBSTRING(expression, start, length)`, `TRIM(expression)`
- For more information: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-data-datacolumn-expression
+6 -1
View File
@@ -16,6 +16,7 @@ so you can use StaxRip and its settings correctly.
- [Audio](User-Interface/Main.md#audio)
- [Assistant](User-Interface/Main.md#assistant)
- [Open Video Source File(s)](User-Interface/Opening.md)
- [eac3to Demuxing](User-Interface/Opening#eac3to-demuxing.md)
- [Template Selection](User-Interface/Template-Selection.md)
- [Save Template](User-Interface/Save-Template.md)
- [Crop](User-Interface/Crop.md)
@@ -47,8 +48,9 @@ so you can use StaxRip and its settings correctly.
- [Danger Zone](User-Interface/Settings.md#danger-zone)
- [Frame Servers](Frame-Servers.md)
- [Cropping](Cropping.md)
- [Workflow](Workflow/README.md)
- [Workflow](Workflow.md)
- [Fonts](Fonts.md)
- [Events](Events.md)
- [Macros](Macros.md)
- [Global Macros](Macros.md#global-macros)
- [Parameter Included Macros](Macros.md#parameter-included-macros)
@@ -56,6 +58,9 @@ so you can use StaxRip and its settings correctly.
- [Special Macros](Macros.md#special-macros)
- [Encoder Macros](Macros.md#encoder-macros)
- [While Processing Macros](Macros.md#while-processing-macros)
- [Function Macros](Macros.md#function-macros)
- [Appendix](Macros.md#appendix)
- [Appendix A: DataColumn Expression Syntax](Macros.md#appendix-a-datacolumn-expression-syntax)
- [Commands](Commands.md)
- [Command Line Interface](Command-Line-Interface.md)
- [Filter Profiles](Filter-Profiles.md)
+38
View File
@@ -260,9 +260,47 @@ Then you get some information about the target image/video:
## Encoder/Container
This panel comes in 2 outfits: A more complex variant, that let's you see/check and set certain parameters (see left image),
and a basic panel with two options to open the [Encoder Options](Encoder-Options.md) as well the [Container Options](Container-Options.md).
<img width=300 src="../../../Images/Screenshots/MainWindowEncoderContainer.png"> <img width=300 src="../../../Images/Screenshots/MainWindowEncoderContainer2.png">
What both have in common is a button on the upper left side, that shows the name of the current selected encoder.
When you click on it, you get a context menu, where you can choose all encoder profiles from.
In the upper right corner there is another button, indicating the file extension of the target file.
This is `MKV` or `MP4` in most cases, but can be something else, especially when `No Muxing` is selected.
By clicking on `Edit Profiles...` you can open a dialog,
where you can edit these lists as well as the encoder/muxer themselves.
<img width=300 src="../../../Images/Screenshots/MainWindowEncoderMenu.png">
So let's go back and concentrate on the more advanced variant (left image):
At the bottom left there is a button saying `Options`, where you can open the [Encoder Options](Encoder-Options.md) and
at the bottom right there is one saying `Container Options`, where you open the [Container Options](Container-Options.md).
In between a button saying `Target Name Override` indicates whether the [Override Target File Name](Encoder-Options.md)
feature is enabled or not. By clicking on it you can toggle its status.
## Audio
Each row represents one audio track. The text field contains the stream or file name of the source.
Right next to it, a label is showing the name of the language, that is assigned to that audio track.
Next to the language name is a button with the name of the current set audio profile.
When clicked on it a menu with all available audio profiles opens and by clicking on `Edit Profiles...` you can open a dialog,
where you can edit this list as well as the audio profiles themselves.
At the very right an `Edit` button lets you open and edit the current audio profile.
> :information_source: The profile `No Audio` lets the audio track being ignored and not muxed to the final result.
> :information_source: The number of available audio tracks is optional and can be set in [Project Options](Project-Options.md).
> [!NOTE]
> TODO: How are the tracks filled? Menus?
<img width=600 src="../../../Images/Screenshots/MainWindowAudio.png">
> [!NOTE]
> TODO: Right-Click-Menu
<img width=300 src="../../../Images/Screenshots/MainWindowAudioMenu.png">
## Assistant
+1
View File
@@ -15,6 +15,7 @@ Most controls, and/or their belonging labels, offer you a quick help, if you rig
- [Audio](Main.md#audio)
- [Assistant](Main.md#assistant)
- [Open Video Source File(s)](Opening.md)
- [eac3to Demuxing](Opening#eac3to-demuxing.md)
- [Template Selection](Template-Selection.md)
- [Save Template](Save-Template.md)
- [Crop](Crop.md)
+16 -4
View File
@@ -9,10 +9,22 @@ There you will find everything, that is globally relevant, means not bound to a
<img width=600 src="../../../Images/Screenshots/SettingsGeneral.png">
- **Save projects automatically**
Whenever a project is modified and an action is performed, that will close the current project,
StaxRip will ask you, if you want to save the latest changes so they don't get lost.
With this option enabled StaxRip will automatically save the project and don't bother you.
:warning: ***They will always overwrite the last configuration, even if you just want to test something out. So be careful!***
Whenever a project is modified and an action is performed, that will close the current project,
StaxRip will ask you, if you want to save the latest changes so they don't get lost.
With this option enabled StaxRip will automatically save the project and don't bother you.
:warning: ***They will always overwrite the last configuration, even if you just want to test something out. So be careful!***
- **In addition save video encoder profiles separately**
Save video encoder profiles in a separate file called `VideoEncoderProfiles.dat` in the `Settings` folder,
additional to being saved in `Settings.dat`. Once loaded all information will also be saved to `Settings.dat`.
:information_source: If disabled, the separate file will be ignored completely.
- **In addition save audio profiles separately**
Save audio profiles in a separate file called `AudioProfiles.dat` in the `Settings` folder,
additional to being saved in `Settings.dat`. Once loaded all information will also be saved to `Settings.dat`.
:information_source: If disabled, the separate file will be ignored completely.
- **In addition save events separately**
Save events in a separate file called `Events.dat` in the `Settings` folder,
additional to being saved in `Settings.dat`. Once loaded all information will also be saved to `Settings.dat`.
:information_source: If disabled, the separate file will be ignored completely.
- **Reverse mouse wheel video seek direction**
- **Number of most recently used projects to keep**
- **Maximum number of parallel processes**
+3
View File
@@ -0,0 +1,3 @@
# [Documentation](../README.md) / [Usage](README.md) / Workflow
...
-2
View File
@@ -1,2 +0,0 @@
# [Documentation](../../README.md) / [Usage](../README.md) / Workflow
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 34 KiB

+2 -13
View File
@@ -601,24 +601,13 @@ End Sub
form.Doc.WriteH2("Options")
form.Doc.WriteTips(TipProvider.GetTips, EditControl.TipProvider.GetTips)
Dim macroList As New StringPairList From {
{"%input%", "Audio source file"},
{"%output%", "Audio target File"},
{"%bitrate%", "Audio bitrate"},
{"%delay%", "Audio delay"},
{"%channels%", "Audio channels count"},
{"%language_native%", "Native language name"},
{"%language_english%", "English language name"},
{"%streamid0%", "ID of the stream (starts with 0)"},
{"%streamid1%", "ID of the stream (starts with 1)"}
}
Dim macroList = Macro.GetTips(False, False, False, False, True)
form.Doc.WriteTable("Command Line Audio Macros",
"The following macros are available in the command line audio dialog and override global macros with the same name.",
macroList)
form.Doc.WriteTable("Global Macros", "Global macros are passed to the process as environment variables.",
Macro.GetTips(True, False, True, True))
form.Doc.WriteTable("Global Macros", "Global macros are passed to the process as environment variables.", Macro.GetTips(True, False, True, True, False))
form.Show()
End Sub
+1 -1
View File
@@ -372,7 +372,7 @@ Public Class EventCommandEditor
Dim allCriteria As New List(Of Criteria)
For Each m In Macro.GetMacros(True, False, True, True)
For Each m In Macro.GetMacros(True, False, True, True, False)
Dim c = Criteria.Create(m.Type)
c.Name = m.FriendlyName
c.Description = m.Description
+1 -1
View File
@@ -161,7 +161,7 @@ Public Class MacroEditorDialog
form.Doc.WriteStart(Text)
form.Doc.WriteParagraph(HelpText)
form.Doc.WriteTips(MacroEditorControl.TipProvider.GetTips)
form.Doc.WriteTable("Macros", Macro.GetTips(True, False, True, True))
form.Doc.WriteTable("Macros", Macro.GetTips(True, False, True, True, False))
form.Show()
End Sub
+1 -1
View File
@@ -285,7 +285,7 @@ Public Class MacrosForm
Dim macros As New StringPairList
For Each mac In Macro.GetMacros(True, True, True, True)
For Each mac In Macro.GetMacros(True, True, True, True, False)
macros.Add(mac.Name, mac.Description)
Next
+1 -1
View File
@@ -1303,7 +1303,7 @@ Public Class MuxerForm
"A muxer merges different video, audio and subtitle files " +
"into a single container file which is the actual output file.")
form.Doc.WriteTips(TipProvider.GetTips, SimpleUI.ActivePage.TipProvider.GetTips)
form.Doc.WriteTable("Macros", Macro.GetTips(True, False, True, True))
form.Doc.WriteTable("Macros", Macro.GetTips(True, False, True, True, False))
form.Show()
End Sub
+111 -7
View File
@@ -11,7 +11,7 @@ Public Class Documentation
FolderHelp.Create(outDir)
GetCommands(True).WriteFileUTF8(Path.Combine(outDir, "Command-Line-Interface.md"))
GetCommands(False).WriteFileUTF8(Path.Combine(outDir, "Commands.md"))
GetMacros.WriteFileUTF8(Path.Combine(outDir, "Macros.md"))
GetMacros.WriteFileUTF8BOM(Path.Combine(outDir, "Macros.md"))
GetTools.WriteFileUTF8(Path.Combine(outDir, "Tools.md"))
g.ShellExecute(outDir)
End Sub
@@ -110,30 +110,49 @@ Public Class Documentation
Dim sb As New StringBuilder()
sb.AppendLine("# [Documentation](../README.md) / [Usage](README.md) / Macros")
sb.AppendLine()
sb.AppendLine("Macros can be used almost everywhere in StaxRip and give you the ability to to set dynamic values where needed or wanted,")
sb.AppendLine("for example in scripts or settings. Most of them are also used for [events](Events.md) as criteria.")
sb.AppendLine()
sb.AppendLine("- [Global Macros](Macros.md#global-macros)")
sb.AppendLine("- [Parameter Included Macros](Macros.md#parameter-included-macros)")
sb.AppendLine("- [Interactive Macros](Macros.md#interactive-macros)")
sb.AppendLine("- [Special Macros](Macros.md#special-macros)")
sb.AppendLine(" - [Encoder Macros](Macros.md#encoder-macros)")
sb.AppendLine(" - [While Processing Macros](Macros.md#while-processing-macros)")
sb.AppendLine(" - [Audio Track Macros](Macros.md#audio-track-macros)")
sb.AppendLine("- [Function Macros](Macros.md#function-macros)")
sb.AppendLine("- [Appendix](Macros.md#appendix)")
sb.AppendLine(" - [Appendix A: DataColumn Expression Syntax](Macros.md#appendix-a-datacolumn-expression-syntax)")
sb.AppendLine()
sb.AppendLine("-----")
sb.AppendLine()
sb.AppendLine("## Global Macros")
sb.AppendLine()
sb.AppendLine("| Name | Description |")
sb.AppendLine("|---|---|")
For Each tip In Macro.GetTips(True, False, False, False)
For Each tip In Macro.GetTips(True, False, False, False, False)
sb.AppendLine($"| `{tip.Name}` | {tip.Value} |")
Next
sb.AppendLine()
sb.AppendLine("## Parameter Included Macros")
sb.AppendLine()
sb.AppendLine("| Name | Description |")
sb.AppendLine("|---|---|")
For Each tip In Macro.GetTips(False, False, True, False)
For Each tip In Macro.GetTips(False, False, True, False, False)
sb.AppendLine($"| `{tip.Name}` | {tip.Value} |")
Next
sb.AppendLine()
sb.AppendLine("## Interactive Macros")
sb.AppendLine("Interactive macros can be used in certain menus like the filter profiles menu. They give you the ability to pop up dialogs in which you have to put values in or select an option.")
sb.AppendLine()
sb.AppendLine("| Name | Description |")
sb.AppendLine("|---|---|")
For Each tip In Macro.GetTips(False, True, False, False)
For Each tip In Macro.GetTips(False, True, False, False, False)
sb.AppendLine($"| `{tip.Name}` | {tip.Value} |")
Next
@@ -144,26 +163,111 @@ Public Class Documentation
sb.AppendLine("### Encoder Macros")
sb.AppendLine("When choosing the option to override the target file name via the encoder options, you have the possibility to extend the normal macros with encoder specific ones. ")
sb.AppendLine("The syntax is: `%parameter%` ")
sb.AppendLine("**Note**: There are some special parameters, that might be not supported (yet). In such cases you can open a feature request.")
sb.AppendLine("> :information_source: There are some special parameters, that might be not supported (yet). In such cases you can open a [feature request](https://github.com/staxrip/staxrip/issues/new?template=request-a-feature.md).")
sb.AppendLine()
sb.AppendLine("Examples:")
sb.AppendLine()
sb.AppendLine("| Encoder | Example | Result |")
sb.AppendLine("|---|---|---|")
sb.AppendLine("| x265 | `%source_name%_CRF%--crf%_AQ-Mode%--aq-mode%` | `%source_name%_CRF23_AQ-Mode2` |")
sb.AppendLine("| SvtAv1EncApp | `%source_name%_CRF%--crf%_Predict%--pred-struct%` | `%source_name%_CRF35_Predict2` |")
sb.AppendLine("| SvtAv1EncApp | `%source_name%_CRF%--crf%_VBoost%--enable-variance-boost%` | `%source_name%_CRF35_VBoost1` |")
sb.AppendLine()
sb.AppendLine("Encoder related parameters can be extended with some modifiers to modify the output of the values.")
sb.AppendLine()
sb.AppendLine("| Modifier | Syntax | Example | Result | Note |")
sb.AppendLine("|---|---|---|---|---|")
sb.AppendLine("| ` ` | `%parameter%` | `%--preset%` | `VeryFast` | No modifier, normal value without spaces |")
sb.AppendLine("| `D` | `%parameter_D%` | `%--preset_D%` | `True` | `True` if the default value is set, otherwise `False` |")
sb.AppendLine("| `L` | `%parameter_L%` | `%--preset_L%` | `veryfast` | Value in lowercase without spaces |")
sb.AppendLine("| `T` | `%parameter_T%` | `%--preset_T%` | `Veryfast` | Value in Title-case (Only first letter in uppercase) without spaces |")
sb.AppendLine("| `U` | `%parameter_U%` | `%--preset_U%` | `VERYFAST` | Value in uppercase without spaces |")
sb.AppendLine("| `V` | `%parameter_V%` | `%--preset_V%` | `2` | Returns the numeric value of the option list,<br>`1` for checked checkboxes, otherwise `0`<br>[Only available for checkboxes and option lists] |")
sb.AppendLine("| `Z` | `%parameter_Z%` | `%--preset_Z%` | `0` | `1` in case it is active/visible, otherwise `0` |")
sb.AppendLine()
sb.AppendLine("> :warning: All modifier letters are **case sensitive**!")
sb.AppendLine()
sb.AppendLine("### While Processing Macros")
sb.AppendLine("These macros are only available while a process is running. They can be used for the `While Processing` event, for example to call an API.")
sb.AppendLine()
sb.AppendLine("| Name | Description |")
sb.AppendLine("|---|---|")
For Each tip In Macro.GetTips(False, False, False, True)
For Each tip In Macro.GetTips(False, False, False, True, False)
sb.AppendLine($"| `{tip.Name}` | {tip.Value} |")
Next
Return sb.ToString
sb.AppendLine()
sb.AppendLine("### Audio Track Macros")
sb.AppendLine("These macros are only available in audio processing, for example inside the Audio Options.")
sb.AppendLine()
sb.AppendLine("| Name | Description |")
sb.AppendLine("|---|---|")
For Each tip In Macro.GetTips(False, False, False, False, True)
sb.AppendLine($"| `{tip.Name}` | {tip.Value} |")
Next
sb.AppendLine()
sb.AppendLine("## Function Macros")
sb.AppendLine("Function macros are similar to *normal* macros, but they don't just replace a text with a specific value; they can perform an action like a condition.")
sb.AppendLine("This makes it possible to return different strings depending on the expression, especially when cascaded/nested. The following table and the examples below should give you enough explanation and ideas.")
sb.AppendLine()
sb.AppendLine("- `<lower(<input>)>`")
sb.AppendLine(" - **\<input\>** is any text you want to have in lower case")
sb.AppendLine(" - Examples:")
sb.AppendLine(" - `<lower(StaxRip is COOL)>` => `staxrip is cool`")
sb.AppendLine("- `<if(<expression>;<true>;<false>)>`")
sb.AppendLine(" - **\<expression\>** corresponds to the [*Expression Syntax*](Macros.md#appendix-a-datacolumn-expression-syntax)")
sb.AppendLine(" - Can also include another (nested) function")
sb.AppendLine(" - **\<true\>** or **\<false\>** is returned depending on whether the expression is true or false")
sb.AppendLine(" - Can be another (nested) function, a macro or any text")
sb.AppendLine(" - First whitespace after `;` will be ignored")
sb.AppendLine(" - Examples with `--preset VeryFast`:")
sb.AppendLine(" - `<if('%--preset%' = 'Medium'; Default; %--preset%)>`")
sb.AppendLine(" - `<if('%--preset_V%' = 2; Default; %--preset%)>`")
sb.AppendLine(" - `<if('%--preset_V%' <> 0; %--preset%; 'PresetIs0')>`")
sb.AppendLine(" - `<if('%--preset_V%' IN (0,1,2); Faster than Faster; Faster or slower)>`")
sb.AppendLine(" - `<if('%--preset%' LIKE '*Fast*'; Includes 'Fast'; SomethingElse)>`")
sb.AppendLine(" - `<if(%target_height% > 1080; 4K; <if(%target_height% > 720; FullHD; SD)>)>`")
sb.AppendLine(" - `<if('%source_mi_g:Title%' <> ''; Original Title: %source_mi_g:Title%; <if('%source_mi_g:Movie%' <> ''; Original Title: %source_mi_g:Movie%; '')>)>`")
sb.AppendLine(" - `<if(%--sao%; SAO; NoSAO)>`")
sb.AppendLine(" - `<if(%--sao% AND NOT %--limit-sao%; FullSAO; <if(%--sao% AND %--limit-sao%; RestrictedSAO; NoSAO)>)>`")
sb.AppendLine(" - `<if('%source_mi_v:Framerate%' >= 48; HiFPS; '')>`")
sb.AppendLine(" - `<if(CONVERT(%source_mi_v:FrameRate%, 'System.Decimal') >= 48; HighFPS; '')>`")
sb.AppendLine("- `<replace(<input>;<oldText>;<newText>)>`")
sb.AppendLine(" - **\<input\>** is any text you want to replace parts of")
sb.AppendLine(" - **\<oldText\>** is the text or macro that shall be replaced")
sb.AppendLine(" - First whitespace after `;` will be ignored")
sb.AppendLine(" - **\<newText\>** is the text or macro that shall be used for the replacement")
sb.AppendLine(" - First whitespace after `;` will be ignored")
sb.AppendLine(" - Examples:")
sb.AppendLine(" - `<replace(This is any text you like; you; I)>`")
sb.AppendLine(" - `<replace(%source_name%; 1080p; 720p)>`")
sb.AppendLine("- `<title(<input>)>`")
sb.AppendLine(" - **\<input\>** is any text you want to have in title case")
sb.AppendLine(" - Examples:")
sb.AppendLine(" - `<title(StaxRip is COOL)>` => `Staxrip Is Cool`")
sb.AppendLine("- `<upper(<input>)>`")
sb.AppendLine(" - **\<input\>** is any text you want to have in upper case")
sb.AppendLine(" - Examples:")
sb.AppendLine(" - `<upper(StaxRip is COOL)>` => `STAXRIP IS COOL`")
sb.AppendLine()
sb.AppendLine()
sb.AppendLine("## Appendix")
sb.AppendLine()
sb.AppendLine("### Appendix A: DataColumn Expression Syntax")
sb.AppendLine("Generally the whole *ADO.NET DataColumn Expression Syntax* is supported. Here are the most important operands and functions:")
sb.AppendLine("- `+`, `-`, `*`, `/`, `%`")
sb.AppendLine("- `<`, `<=`, `<>`, `=`, `>=`, `>`, `IN`, `LIKE`")
sb.AppendLine("- `AND`, `OR`, `NOT`")
sb.AppendLine("- `CONVERT(expression, .NET Data Type)`, `LEN(expression)`, `ISNULL(expression, replacementvalue)`, `SUBSTRING(expression, start, length)`, `TRIM(expression)`")
sb.AppendLine("- For more information: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-data-datacolumn-expression")
Return sb.ToString()
End Function
Shared Function GetTools() As String
+16 -4
View File
@@ -89,10 +89,10 @@ Public Class Macro
End Set
End Property
Shared Function GetTips(includeGlobals As Boolean, includeInteractive As Boolean, includeParam As Boolean, includeWhileProcessing As Boolean) As StringPairList
Shared Function GetTips(includeGlobals As Boolean, includeInteractive As Boolean, includeParam As Boolean, includeWhileProcessing As Boolean, includeAudioSpecific As Boolean) As StringPairList
Dim ret As New StringPairList
For Each macro In GetMacros(includeGlobals, includeInteractive, includeParam, includeWhileProcessing)
For Each macro In GetMacros(includeGlobals, includeInteractive, includeParam, includeWhileProcessing, includeAudioSpecific)
ret.Add(macro.Name, macro.Description)
Next
@@ -102,7 +102,7 @@ Public Class Macro
Shared Function GetTipsFriendly(convertHTMLChars As Boolean) As StringPairList
Dim ret As New StringPairList
For Each mac As Macro In GetMacros(True, False, False, True)
For Each mac As Macro In GetMacros(True, False, False, True, False)
If convertHTMLChars Then
ret.Add(HelpDocument.ConvertChars(mac.FriendlyName), mac.Description)
Else
@@ -121,7 +121,7 @@ Public Class Macro
Return Name.CompareTo(other.Name)
End Function
Shared Function GetMacros(includeGlobals As Boolean, includeInteractive As Boolean, includeParam As Boolean, includeWhileProcessing As Boolean) As List(Of Macro)
Shared Function GetMacros(includeGlobals As Boolean, includeInteractive As Boolean, includeParam As Boolean, includeWhileProcessing As Boolean, includeAudioSpecific As Boolean) As List(Of Macro)
Dim ret As New List(Of Macro)
If includeGlobals Then
@@ -237,6 +237,18 @@ Public Class Macro
ret.Add(New Macro("progressline", "Progress Line", GetType(String), "Returns the progress line received from the running app."))
End If
If includeAudioSpecific Then
ret.Add(New Macro("input", "Input", GetType(String), "Audio source file."))
ret.Add(New Macro("output", "Output", GetType(String), "Audio target file."))
ret.Add(New Macro("bitrate", "Bitrate", GetType(String), "Audio bitrate."))
ret.Add(New Macro("channels", "Channels", GetType(String), "Audio channels count."))
ret.Add(New Macro("delay", "Delay", GetType(String), "Audio delay."))
ret.Add(New Macro("language_native", "Language Native", GetType(String), "Native language name."))
ret.Add(New Macro("language_english", "Language English", GetType(String), "English language name."))
ret.Add(New Macro("streamid0", "0-based Stream ID", GetType(String), "ID of the stream (starts with 0)."))
ret.Add(New Macro("streamid1", "1-based Stream ID", GetType(String), "ID of the stream (starts with 1)."))
End If
ret.Sort()
Return ret
+1 -1
View File
@@ -419,7 +419,7 @@ Public Class Proc
Dim keys = dic.Keys.OfType(Of String).Select(Function(key) key.ToLowerInvariant)
For Each mac In Macro.GetMacros(True, False, False, True)
For Each mac In Macro.GetMacros(True, False, False, True, False)
Dim name = mac.Name.Trim("%"c)
If Not keys.Contains(name) Then