2011-10-24 00:13:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This class provides an attribute for marking
|
|
|
|
|
|
/// classes that provide <see cref="IAudioDest" />.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// When plugins with classes that provide <see cref="IAudioDest" /> are
|
2013-04-08 23:11:03 -04:00
|
|
|
|
/// registered, their <see cref="AudioEncoderClassAttribute" /> attributes are read.
|
2011-10-24 00:13:35 +00:00
|
|
|
|
/// </remarks>
|
|
|
|
|
|
/// <example>
|
|
|
|
|
|
/// <code lang="C#">using CUETools.Codecs;
|
|
|
|
|
|
///
|
|
|
|
|
|
///[AudioEncoderClass("libFLAC", "flac", true, "0 1 2 3 4 5 6 7 8", "5", 1)]
|
|
|
|
|
|
///public class MyEncoder : IAudioDest {
|
|
|
|
|
|
/// ...
|
|
|
|
|
|
///}</code>
|
|
|
|
|
|
/// </example>
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
2013-04-08 23:11:03 -04:00
|
|
|
|
public sealed class AudioEncoderClassAttribute : Attribute
|
2011-10-24 00:13:35 +00:00
|
|
|
|
{
|
2013-04-01 23:03:22 -04:00
|
|
|
|
private string _encoderName, _extension;
|
2011-10-24 00:13:35 +00:00
|
|
|
|
private bool _lossless;
|
|
|
|
|
|
private int _priority;
|
|
|
|
|
|
private Type _settings;
|
|
|
|
|
|
|
|
|
|
|
|
public string EncoderName
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _encoderName; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Extension
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _extension; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Lossless
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _lossless; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Priority
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _priority; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Type Settings
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _settings; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-04-08 23:11:03 -04:00
|
|
|
|
public AudioEncoderClassAttribute(string encoderName, string extension, bool lossless, int priority, Type settings)
|
2011-10-24 00:13:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
_encoderName = encoderName;
|
|
|
|
|
|
_extension = extension;
|
|
|
|
|
|
_lossless = lossless;
|
|
|
|
|
|
_priority = priority;
|
|
|
|
|
|
_settings = settings;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|