mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Code cleanup; Reader classes renamed to Decoders, Writers to Encoders, every Decoder must have a corresponding Settings class now just like Encoders. UserDefinedEncoders renamed to CommandLineEncoders, etc.
This commit is contained in:
@@ -5,20 +5,6 @@ using System.IO;
|
||||
|
||||
namespace CUETools.Codecs.BDLPCM
|
||||
{
|
||||
public class DecoderSettings : AudioDecoderSettings
|
||||
{
|
||||
public override string Extension => "m2ts";
|
||||
|
||||
public override string Name => "cuetools";
|
||||
|
||||
public override Type DecoderType => typeof(AudioDecoder);
|
||||
|
||||
public override int Priority => 2;
|
||||
|
||||
public DecoderSettings() : base() { }
|
||||
}
|
||||
|
||||
[AudioDecoderClass(typeof(DecoderSettings))]
|
||||
public class AudioDecoder : IAudioSource
|
||||
{
|
||||
public unsafe AudioDecoder(string path, Stream IO, ushort pid)
|
||||
@@ -37,7 +23,7 @@ namespace CUETools.Codecs.BDLPCM
|
||||
_samplePos = 0;
|
||||
_sampleLen = -1;
|
||||
demux_ts_packets(null, 0);
|
||||
settings = new BDLPCMDecoderSettings();
|
||||
settings = new DecoderSettings();
|
||||
}
|
||||
|
||||
public AudioDecoderSettings Settings { get { return settings; } }
|
||||
@@ -749,6 +735,6 @@ namespace CUETools.Codecs.BDLPCM
|
||||
int demuxer_channel;
|
||||
TsStream chosenStream;
|
||||
long _samplePos, _sampleLen;
|
||||
BDLPCMDecoderSettings settings;
|
||||
DecoderSettings settings;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,25 @@ using Newtonsoft.Json;
|
||||
namespace CUETools.Codecs.BDLPCM
|
||||
{
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class BDLPCMDecoderSettings : AudioDecoderSettings
|
||||
public class DecoderSettings : AudioDecoderSettings
|
||||
{
|
||||
public BDLPCMDecoderSettings()
|
||||
{
|
||||
IgnoreShortItems = true;
|
||||
}
|
||||
public override string Extension => "m2ts";
|
||||
|
||||
public override string Name => "cuetools";
|
||||
|
||||
public override Type DecoderType => typeof(AudioDecoder);
|
||||
|
||||
public override int Priority => 2;
|
||||
|
||||
public bool IgnoreShortItems { get; set; }
|
||||
|
||||
public int? Stream { get; set; }
|
||||
|
||||
public ushort? Pid { get; set; }
|
||||
|
||||
public DecoderSettings() : base()
|
||||
{
|
||||
IgnoreShortItems = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,20 +6,6 @@ using System.Globalization;
|
||||
|
||||
namespace CUETools.Codecs.BDLPCM
|
||||
{
|
||||
public class MPLSDecoderSettings : AudioDecoderSettings
|
||||
{
|
||||
public override string Extension => "mpls";
|
||||
|
||||
public override string Name => "cuetools";
|
||||
|
||||
public override Type DecoderType => typeof(MPLSDecoder);
|
||||
|
||||
public override int Priority => 2;
|
||||
|
||||
public MPLSDecoderSettings() : base() { }
|
||||
}
|
||||
|
||||
[AudioDecoderClass(typeof(MPLSDecoderSettings))]
|
||||
public class MPLSDecoder : IAudioSource
|
||||
{
|
||||
public unsafe MPLSDecoder(string path, Stream IO, ushort pid)
|
||||
@@ -30,7 +16,7 @@ namespace CUETools.Codecs.BDLPCM
|
||||
|
||||
public unsafe MPLSDecoder(string path, Stream IO)
|
||||
{
|
||||
settings = new BDLPCMDecoderSettings();
|
||||
settings = new DecoderSettings();
|
||||
_path = path;
|
||||
_IO = IO != null ? IO : new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 0x10000);
|
||||
int length = (int)_IO.Length;
|
||||
@@ -453,7 +439,7 @@ namespace CUETools.Codecs.BDLPCM
|
||||
List<AudioDecoder> readers;
|
||||
AudioDecoder currentReader;
|
||||
MPLSHeader hdr_m;
|
||||
BDLPCMDecoderSettings settings;
|
||||
DecoderSettings settings;
|
||||
}
|
||||
|
||||
public struct MPLSPlaylistMark
|
||||
|
||||
31
CUETools.Codecs.BDLPCM/MPLSReaderSettings.cs
Normal file
31
CUETools.Codecs.BDLPCM/MPLSReaderSettings.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CUETools.Codecs.MPLS
|
||||
{
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class DecoderSettings : AudioDecoderSettings
|
||||
{
|
||||
public override string Extension => "mpls";
|
||||
|
||||
public override string Name => "cuetools";
|
||||
|
||||
public override Type DecoderType => typeof(BDLPCM.MPLSDecoder);
|
||||
|
||||
public override int Priority => 2;
|
||||
|
||||
public bool IgnoreShortItems { get; set; }
|
||||
|
||||
public int? Stream { get; set; }
|
||||
|
||||
public ushort? Pid { get; set; }
|
||||
|
||||
public DecoderSettings() : base()
|
||||
{
|
||||
IgnoreShortItems = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user