Files
cuetools.net/CUETools.Ripper/Ripper.cs

92 lines
2.2 KiB
C#
Raw Normal View History

2010-02-08 01:29:31 +00:00
using System;
2010-02-28 21:04:34 +00:00
using System.IO;
2010-02-08 01:29:31 +00:00
using System.Collections;
using System.Collections.Generic;
using CUETools.CDImage;
using CUETools.Codecs;
using System.Text;
namespace CUETools.Ripper
{
public interface ICDRipper : IAudioSource, IDisposable
{
bool Open(char Drive);
2013-04-28 16:14:58 -04:00
void EjectDisk();
bool DetectGaps();
bool GapsDetected { get; }
2010-02-08 01:29:31 +00:00
CDImageLayout TOC { get; }
string ARName { get; }
string EACName { get; }
int DriveOffset { get; set; }
string RipperVersion { get; }
string CurrentReadCommand { get; }
int CorrectionQuality { get; set; }
BitArray FailedSectors { get; }
BitArray RetrySectors { get; }
2010-02-08 01:29:31 +00:00
event EventHandler<ReadProgressArgs> ReadProgress;
}
2010-02-28 21:04:34 +00:00
public class CDDrivesList
{
public static char[] DrivesAvailable()
{
List<char> result = new List<char>();
foreach (DriveInfo info in DriveInfo.GetDrives())
if (info.DriveType == DriveType.CDRom)
result.Add(info.Name[0]);
return result.ToArray();
}
}
2010-02-08 01:29:31 +00:00
public sealed class ReadProgressArgs : EventArgs
{
public string Action;
2010-02-08 01:29:31 +00:00
public int Position;
public int Pass;
public int PassStart, PassEnd;
public int ErrorsCount;
public DateTime PassTime;
public ReadProgressArgs()
{
}
2010-02-08 01:29:31 +00:00
public ReadProgressArgs(int position, int pass, int passStart, int passEnd, int errorsCount, DateTime passTime)
{
Position = position;
Pass = pass;
PassStart = passStart;
PassEnd = passEnd;
ErrorsCount = errorsCount;
PassTime = passTime;
}
}
public static class BitArrayUtils
{
public static int PopulationCount(this BitArray bits, int start, int len)
{
int cnt = 0;
for (int i = start; i < start + len; i++)
if (bits[i])
cnt++;
return cnt;
}
public static int PopulationCount(this BitArray bits)
{
return bits.PopulationCount(0, bits.Count);
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
internal sealed class ExtensionAttribute : Attribute
{
public ExtensionAttribute() { }
}
2010-02-08 01:29:31 +00:00
}