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="IAudioSource" />.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// When plugins with classes that provide <see cref="IAudioSource" /> are
|
|
|
|
|
|
/// registered, their <see cref="AudioDecoderClass" /> attributes are read.
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
/// <example>
|
|
|
|
|
|
/// <code lang="C#">using CUETools.Codecs;
|
|
|
|
|
|
///
|
|
|
|
|
|
///[AudioDecoderClass("libFLAC", "flac")]
|
|
|
|
|
|
///public class MyDecoder : IAudioSource {
|
|
|
|
|
|
/// ...
|
|
|
|
|
|
///}</code>
|
|
|
|
|
|
/// </example>
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
|
|
|
|
|
public sealed class AudioDecoderClass : Attribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public string DecoderName
|
|
|
|
|
|
{
|
2013-03-31 13:29:09 -04:00
|
|
|
|
get;
|
|
|
|
|
|
set;
|
2011-10-24 00:13:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Extension
|
|
|
|
|
|
{
|
2013-03-31 13:29:09 -04:00
|
|
|
|
get;
|
|
|
|
|
|
set;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Priority
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
set;
|
2011-10-24 00:13:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-03-31 13:29:09 -04:00
|
|
|
|
public AudioDecoderClass(string decoderName, string extension, int priority)
|
2011-10-24 00:13:35 +00:00
|
|
|
|
{
|
2013-03-31 13:29:09 -04:00
|
|
|
|
DecoderName = decoderName;
|
|
|
|
|
|
Extension = extension;
|
|
|
|
|
|
Priority = priority;
|
2011-10-24 00:13:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|