FF-1785: Created a track remover based on the TrackSelectorFlowElement.cs

This commit is contained in:
John Andrews
2024-09-26 14:14:34 +12:00
parent 00c271efa3
commit cf1ac9604b
2 changed files with 10 additions and 0 deletions

View File

@@ -45,6 +45,11 @@ public abstract class TrackSelectorFlowElement<T> : FfmpegBuilderNode where T :
/// Gets the label for the custom selection
/// </summary>
protected virtual string CustomLabel => "Custom";
/// <summary>
/// Gets if this allows filtering by the index
/// </summary>
protected virtual bool AllowIndex => false;
/// <summary>
/// Gets or sets the track selection options
@@ -65,6 +70,7 @@ public abstract class TrackSelectorFlowElement<T> : FfmpegBuilderNode where T :
{
if (_TrackSelectionOptionsOptions == null)
{
var instance = (T)Activator.CreateInstance(typeof(T))!;
_TrackSelectionOptionsOptions = new List<ListOption>
{
new() { Label = "Channels", Value = "Channels" },
@@ -72,6 +78,8 @@ public abstract class TrackSelectorFlowElement<T> : FfmpegBuilderNode where T :
new() { Label = "Language", Value = "Language" },
new() { Label = "Title", Value = "Title" }
};
if(instance.AllowIndex)
_TrackSelectionOptionsOptions.Add(new () { Label = "Index", Value = "Index"});
}
return _TrackSelectionOptionsOptions;

View File

@@ -20,6 +20,8 @@ public class FfmpegBuilderTrackRemover: TrackSelectorFlowElement<FfmpegBuilderT
protected override string AutomaticLabel => "All";
/// <inheritdoc />
protected override string CustomLabel => "Matching";
/// <inheritdoc />
protected override bool AllowIndex => true;
/// <summary>
/// Gets or sets the stream types to remove