Cuetools.Converter.exe: support for --decoder-option parameter.

Implemented "Stream" option in BDLPCM Reader to make it possible to select
the right stream in m2ts file.
This commit is contained in:
Grigory Chudov
2018-02-10 17:33:22 -05:00
parent 0e624d610d
commit 8cedc982a6
25 changed files with 179 additions and 33 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
namespace CUETools.Codecs
{
public class AudioDecoderSettings
{
public AudioDecoderSettings()
{
// Iterate through each property and call ResetValue()
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
property.ResetValue(this);
}
public AudioDecoderSettings Clone()
{
return this.MemberwiseClone() as AudioDecoderSettings;
}
public bool HasBrowsableAttributes()
{
bool hasBrowsable = false;
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
{
bool isBrowsable = true;
foreach (var attribute in property.Attributes)
{
var browsable = attribute as BrowsableAttribute;
isBrowsable &= browsable == null || browsable.Browsable;
}
hasBrowsable |= isBrowsable;
}
return hasBrowsable;
}
}
}

View File

@@ -18,6 +18,8 @@ namespace CUETools.Codecs
private bool own;
private ThreadPriority priority;
public AudioDecoderSettings Settings { get { return null; } }
public long Position
{
get

View File

@@ -64,6 +64,7 @@
<ItemGroup>
<Compile Include="AudioBuffer.cs" />
<Compile Include="AudioDecoderClass.cs" />
<Compile Include="AudioDecoderSettings.cs" />
<Compile Include="AudioEncoderSettings.cs" />
<Compile Include="AudioPCMConfig.cs" />
<Compile Include="AudioPipe.cs" />

View File

@@ -72,6 +72,7 @@ namespace CUETools.Codecs
formats.Add("wv", new CUEToolsFormat("wv", CUEToolsTagger.TagLibSharp, true, false, true, true, encoders.GetDefault("wv", true), null, decoders.GetDefault("wv", true)));
formats.Add("ape", new CUEToolsFormat("ape", CUEToolsTagger.TagLibSharp, true, false, true, true, encoders.GetDefault("ape", true), null, decoders.GetDefault("ape", true)));
formats.Add("tta", new CUEToolsFormat("tta", CUEToolsTagger.APEv2, true, false, false, true, encoders.GetDefault("tta", true), null, decoders.GetDefault("tta", true)));
formats.Add("m2ts", new CUEToolsFormat("m2ts", CUEToolsTagger.APEv2, true, false, false, true, null, null, decoders.GetDefault("m2ts", true)));
formats.Add("wav", new CUEToolsFormat("wav", CUEToolsTagger.TagLibSharp, true, false, false, true, encoders.GetDefault("wav", true), null, decoders.GetDefault("wav", true)));
formats.Add("m4a", new CUEToolsFormat("m4a", CUEToolsTagger.TagLibSharp, true, true, false, true, encoders.GetDefault("m4a", true), encoders.GetDefault("m4a", false), decoders.GetDefault("m4a", true)));
formats.Add("tak", new CUEToolsFormat("tak", CUEToolsTagger.APEv2, true, false, true, true, encoders.GetDefault("tak", true), null, decoders.GetDefault("tak", true)));

View File

@@ -2,6 +2,8 @@
{
public interface IAudioSource
{
AudioDecoderSettings Settings { get; }
AudioPCMConfig PCM { get; }
string Path { get; }

View File

@@ -6,6 +6,8 @@
private AudioPCMConfig pcm;
private int _sampleVal;
public AudioDecoderSettings Settings { get { return null; } }
public long Length
{
get { return _sampleCount; }

View File

@@ -10,6 +10,8 @@ namespace CUETools.Codecs
Process _decoderProcess;
WAVReader rdr;
public AudioDecoderSettings Settings { get { return null; } }
public long Position
{
get

View File

@@ -14,6 +14,8 @@ namespace CUETools.Codecs
bool _largeFile;
string _path;
public AudioDecoderSettings Settings { get { return null; } }
public long Position
{
get