2018-04-07 23:02:01 -04:00
|
|
|
|
using System;
|
2018-04-29 16:53:55 -04:00
|
|
|
|
using System.Collections.Generic;
|
2018-04-07 23:02:01 -04:00
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs
|
2011-10-24 00:13:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
public interface IAudioSource
|
|
|
|
|
|
{
|
2018-03-25 17:24:27 -04:00
|
|
|
|
IAudioDecoderSettings Settings { get; }
|
2018-02-10 17:33:22 -05:00
|
|
|
|
|
2011-10-24 00:13:35 +00:00
|
|
|
|
AudioPCMConfig PCM { get; }
|
|
|
|
|
|
string Path { get; }
|
|
|
|
|
|
|
2018-04-07 23:02:01 -04:00
|
|
|
|
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
|
|
|
|
}
|