Files
cuetools.net/CUETools.Codecs/IAudioSource.cs

47 lines
1.2 KiB
C#
Raw Normal View History

using System;
2018-04-29 16:53:55 -04:00
using System.Collections.Generic;
namespace CUETools.Codecs
2011-10-24 00:13:35 +00:00
{
public interface IAudioSource
{
IAudioDecoderSettings Settings { get; }
2011-10-24 00:13:35 +00:00
AudioPCMConfig PCM { get; }
string Path { get; }
TimeSpan Duration { get; }
long Length { get; }
2011-10-24 00:13:35 +00:00
long Position { get; set; }
long Remaining { get; }
int Read(AudioBuffer buffer, int maxLength);
void Close();
}
2018-04-29 16:53:55 -04:00
public interface IAudioTitle
{
List<TimeSpan> Chapters { get; }
//IAudioSource Open { get; }
}
public interface IAudioContainer
{
List<IAudioTitle> AudioTitles { get; }
}
public class NoContainerAudioTitle : IAudioTitle
{
public NoContainerAudioTitle(IAudioSource source) { this.source = source; }
public List<TimeSpan> Chapters => new List<TimeSpan> { TimeSpan.Zero, source.Duration };
IAudioSource source;
}
public class NoContainer : IAudioContainer
{
public NoContainer(IAudioSource source) { this.source = source; }
public List<IAudioTitle> AudioTitles => new List<IAudioTitle> { new NoContainerAudioTitle(source) };
IAudioSource source;
}
2011-10-24 00:13:35 +00:00
}