Стартовый пул
This commit is contained in:
384
acs/Src/classes/linux/acs_cdrom.inc
Normal file
384
acs/Src/classes/linux/acs_cdrom.inc
Normal file
@@ -0,0 +1,384 @@
|
||||
{
|
||||
$Log: acs_cdrom.inc,v $
|
||||
Revision 1.7 2006/08/31 20:10:56 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.6 2006/07/04 17:12:45 z0m3ie
|
||||
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
|
||||
|
||||
Revision 1.2 2005/12/26 17:31:39 z0m3ie
|
||||
fixed some problems in acs_dsfiles
|
||||
fixed some problems in acs_vorbis
|
||||
reworked all buffers
|
||||
|
||||
}
|
||||
|
||||
function GetTocEntry(cd_fd, Track : Integer): TACSCDTrackInfo;
|
||||
var
|
||||
Entry : cdrom_tocentry;
|
||||
toc : cdrom_tochdr;
|
||||
frames1, frames2 : Integer;
|
||||
begin
|
||||
fpioctl(cd_fd, CDROMREADTOCHDR, @toc);
|
||||
Entry.cdte_format := CDROM_MSF;
|
||||
Entry.cdte_track := Track+toc.cdth_trk0-1;
|
||||
fpioctl(cd_fd, CDROMREADTOCENTRY, @Entry);
|
||||
frames1 := MSF2Frames(TACSCDMSF(Entry.cdte_addr.msf));
|
||||
if (Entry.cdte_adr_ctrl and CDROM_DATA_TRACK) <> 0 then
|
||||
Result.TrackType := ttData
|
||||
else Result.TrackType := ttAudio;
|
||||
if Entry.cdte_track < toc.cdth_trk1 then Inc(Entry.cdte_track)
|
||||
else Entry.cdte_track := CDROM_LEADOUT;
|
||||
fpioctl(cd_fd, CDROMREADTOCENTRY, @Entry);
|
||||
frames2 := MSF2Frames(TACSCDMSF(Entry.cdte_addr.msf));
|
||||
Frames2MSF(frames2-frames1, Result.TrackLength);
|
||||
end;
|
||||
|
||||
function GetCDStatus(cd_fd : Integer) : TACSCDStatus;
|
||||
(* not all drivers support the CDROM_DRIVE_STATUS ioctl
|
||||
we use this ioctl first and then some other tecnique
|
||||
if it is not supported. *)
|
||||
var
|
||||
sci : cdrom_subchnl;
|
||||
res :Integer;
|
||||
Data: Integer;
|
||||
begin
|
||||
Data := CDSL_CURRENT;
|
||||
res := fpioctl(cd_fd, CDROM_DRIVE_STATUS, @Data);
|
||||
case res of
|
||||
CDS_TRAY_OPEN, CDS_NO_DISC, CDS_DRIVE_NOT_READY:
|
||||
begin
|
||||
Result := cdsNotReady;
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
(* Either the disc is ok or no information
|
||||
from the driver. Trying CDROMSUBCHNL.*)
|
||||
sci.cdsc_format := CDROM_MSF;
|
||||
if fpioctl(cd_fd, CDROMSUBCHNL, @sci) < 0 then
|
||||
begin
|
||||
Result := cdsNotReady;
|
||||
Exit;
|
||||
end;
|
||||
case sci.cdsc_audiostatus of
|
||||
CDROM_AUDIO_PLAY : Result := cdsPlaying;
|
||||
CDROM_AUDIO_PAUSED : Result := cdsPaused;
|
||||
CDROM_AUDIO_ERROR : Result := cdsNotReady;
|
||||
else Result := cdsReady;
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetCDInfo(cd_fd : Integer) : TACSCDInfo;
|
||||
var
|
||||
res : Integer;
|
||||
Data: Integer;
|
||||
begin
|
||||
Result := cdiUnknown;
|
||||
Data := CDSL_CURRENT;
|
||||
res := fpioctl(cd_fd, CDROM_DRIVE_STATUS, @Data);
|
||||
case res of
|
||||
CDS_TRAY_OPEN, CDS_NO_DISC: Result := cdiNoDisc;
|
||||
CDS_DISC_OK :
|
||||
begin
|
||||
res := fpioctl(cd_fd, CDROM_DISC_STATUS, @Data);
|
||||
case res of
|
||||
CDS_AUDIO : Result := cdiDiscAudio;
|
||||
CDS_MIXED : Result := cdiDiscMixed;
|
||||
else Result := cdiDiscData;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.OpenCD;
|
||||
begin
|
||||
if FCurrentDrive >= length(DrivesPaths) then
|
||||
exit;
|
||||
if FOpened = 0 then
|
||||
begin
|
||||
_cd_fd := fpopen(PChar(DrivesPaths[FCurrentDrive]), O_RDONLY or O_NONBLOCK);
|
||||
if _cd_fd < 0 then
|
||||
raise EACSException.Create(IntToStr(errno));
|
||||
end;
|
||||
Inc(FOpened);
|
||||
end;
|
||||
|
||||
|
||||
procedure TACSCDIn.CloseCD;
|
||||
begin
|
||||
if FOpened = 1 then fpclose(_cd_fd);
|
||||
if FOpened > 0 then Dec(FOpened);
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetInfo;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
OpenCD;
|
||||
Result := GetCDInfo(_cd_fd);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetStatus;
|
||||
begin
|
||||
if FCurrentDrive >= length(DrivesPaths) then
|
||||
exit;
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
if Fopened = 0 then
|
||||
_cd_fd := fpopen(PChar(DrivesPaths[FCurrentDrive]), O_RDONLY or O_NONBLOCK);
|
||||
if _cd_fd < 0 then
|
||||
begin
|
||||
Result := cdsNotReady;
|
||||
Exit;
|
||||
end;
|
||||
Inc(FOpened);
|
||||
Result := GetCDStatus(_cd_fd);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetNumTracks;
|
||||
var
|
||||
toc : cdrom_tochdr;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
OpenCD;
|
||||
if GetStatus <> cdsNotReady then
|
||||
begin
|
||||
fpioctl(_cd_fd, CDROMREADTOCHDR, @toc);
|
||||
Result := toc.cdth_trk1 - toc.cdth_trk0 + 1;
|
||||
end else Result := 0;
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetTrackInfo;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
OpenCD;
|
||||
if (vIndex in [1..GetNumTracks]) = False then
|
||||
begin
|
||||
fpclose(_cd_fd);
|
||||
FOpened := 0;
|
||||
raise EACSException.Create(strTrackOutofRange);
|
||||
end;
|
||||
Result := GetTocEntry(_cd_fd, vIndex);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
function GetTrackMSF(cd_fd, Track : Integer) : TACSCDMSF;
|
||||
var
|
||||
entry : cdrom_tocentry;
|
||||
hdr : cdrom_tochdr;
|
||||
begin
|
||||
fpioctl(cd_fd, CDROMREADTOCHDR, @hdr);
|
||||
entry.cdte_format := CDROM_MSF;
|
||||
entry.cdte_track := Track + hdr.cdth_trk0 - 1;
|
||||
if entry.cdte_track > hdr.cdth_trk1 then
|
||||
entry.cdte_track := CDROM_LEADOUT;
|
||||
fpioctl(cd_fd, CDROMREADTOCENTRY, @entry);
|
||||
Result := TACSCDMSF(entry.cdte_addr.msf);
|
||||
end;
|
||||
|
||||
function GetPosMSF(cd_fd : Integer; Pos : TACSCDPosition) : TACSCDMSF;
|
||||
var
|
||||
msf1 : TACSCDMSF;
|
||||
frames : Integer;
|
||||
begin
|
||||
msf1 := TACSCDMSF(GetTrackMSF(cd_fd, Pos.Track));
|
||||
frames := MSF2Frames(msf1);
|
||||
frames := frames + MSF2Frames(Pos.MSF);
|
||||
Frames2MSF(frames, msf1);
|
||||
Result := msf1;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetST;
|
||||
begin
|
||||
if Self.Busy then raise EACSException.Create(strBusy);
|
||||
FStartTrack := Track;
|
||||
FStartPos.Track := FStartTrack;
|
||||
FillChar(FStartPos.MSF, SizeOf(FStartPos.MSF), 0);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetET;
|
||||
begin
|
||||
if Self.Busy then raise EACSException.Create(strBusy);
|
||||
FEndTrack := Track;
|
||||
OpenCD;
|
||||
FEndPos.Track := FEndTrack + 1;
|
||||
FillChar(FEndPos.MSF, SizeOf(FEndPos.MSF), 0);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetSP;
|
||||
begin
|
||||
if Self.Busy then raise EACSException.Create(strBusy);
|
||||
Self.FStartPos := Pos;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetEP;
|
||||
begin
|
||||
if Self.Busy then raise EACSException.Create(strBusy);
|
||||
Self.FEndPos := Pos;
|
||||
end;
|
||||
|
||||
constructor TACSCDIn.Create;
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FCurrentDrive := 0;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetSize;
|
||||
var
|
||||
msf1, msf2 : TACSCDMSF;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
OpenCD;
|
||||
msf1 := GetPosMSF(_cd_fd, FStartPos);
|
||||
msf2 := GetPosMSF(_cd_fd, FEndPos);
|
||||
CloseCD;
|
||||
Result := ((msf2.minute*60 + msf2.second)*75 + msf2.frame -
|
||||
((msf1.minute*60 + msf1.second)*75 + msf1.frame))*CD_FRAMESIZE_RAW;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.Init;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
if not (DiscInfo in [cdiDiscAudio, cdiDiscMixed]) then
|
||||
raise EACSException.Create(strNoAudioCD);
|
||||
FSize := GetSize;
|
||||
FBusy := True;
|
||||
BufStart := 1;
|
||||
BufEnd := 0;
|
||||
FPosition := 0;
|
||||
OpenCD;
|
||||
FCurPos := GetPosMSF(_cd_fd, FStartPos);
|
||||
FEndMSF := GetPosMSF(_cd_fd, FEndPos);
|
||||
// GetMem(FBuffer,BUF_SIZE * CD_FRAMESIZE_RAW);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.Flush;
|
||||
begin
|
||||
CloseCD;
|
||||
FBusy := False;
|
||||
// FreeMem(FBuffer);
|
||||
FSize := 0;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetData;
|
||||
var
|
||||
StartFrame, EndFrame : Integer;
|
||||
cdaudio : cdrom_read_audio;
|
||||
begin
|
||||
if not Busy then raise EACSException.Create(strStreamnotopen);
|
||||
StartFrame := MSF2Frames(FCurPos);
|
||||
EndFrame := MSF2Frames(FEndMSF);
|
||||
if BufStart > BufEnd then
|
||||
begin
|
||||
if EndFrame = StartFrame then
|
||||
begin
|
||||
Result := 0;
|
||||
Exit;
|
||||
end;
|
||||
BufStart := 1;
|
||||
if (EndFrame - StartFrame) > (BUF_SIZE) then
|
||||
cdaudio.nframes := BUF_SIZE
|
||||
else
|
||||
cdaudio.nframes := EndFrame - StartFrame;
|
||||
cdaudio.addr_format := CDROM_MSF;
|
||||
cdaudio.addr.msf := cdrom_msf0(FCurPos);
|
||||
cdaudio.buf := Pointer(FBuffer);
|
||||
fpioctl(_cd_fd, CDROMREADAUDIO, @cdaudio);
|
||||
BufEnd := cdaudio.nframes * CD_FRAMESIZE_RAW;
|
||||
StartFrame := MSF2Frames(FCurPos) + cdaudio.nframes;
|
||||
Frames2MSF(StartFrame, FCurPos);
|
||||
end;
|
||||
if BufferSize < (BufEnd - BufStart + 1)
|
||||
then Result := BufferSize
|
||||
else Result := BufEnd - BufStart + 1;
|
||||
Move(FBuffer[BufStart], Buffer^, Result);
|
||||
Inc(BufStart, Result);
|
||||
Inc(FPosition, Result);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.Eject;
|
||||
var
|
||||
Data: Integer;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
OpenCD;
|
||||
Data := 0;
|
||||
fpioctl(_cd_fd, CDROMEJECT,@Data);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.CloseTray;
|
||||
var
|
||||
Data: Integer;
|
||||
begin
|
||||
OpenCD;
|
||||
Data := 0;
|
||||
fpioctl(_cd_fd, CDROMCLOSETRAY,@Data);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
procedure CountDrives;
|
||||
var
|
||||
_cd_fd, i : Integer;
|
||||
fname : String;
|
||||
sci : cdrom_subchnl;
|
||||
res :Integer;
|
||||
Data: Integer;
|
||||
begin
|
||||
DrivesCount := 0;
|
||||
Data := CDSL_CURRENT;
|
||||
for i := 0 to 3 do
|
||||
begin
|
||||
fname := '/dev/hd'+chr(ord('a')+i);
|
||||
_cd_fd := fpopen(PChar(fname), O_RDONLY or O_NONBLOCK);
|
||||
if _cd_fd >= 0 then
|
||||
begin
|
||||
res := fpioctl(_cd_fd, CDROM_DRIVE_STATUS, @Data);
|
||||
case res of
|
||||
CDS_TRAY_OPEN, CDS_NO_DISC, CDS_DRIVE_NOT_READY:
|
||||
begin
|
||||
inc(DrivesCount);
|
||||
setlength(DrivesPaths,DrivesCount);
|
||||
DrivesPaths[DrivesCount-1] := fname;
|
||||
fpclose(_cd_fd);
|
||||
continue;
|
||||
end;
|
||||
end;
|
||||
(* Either the disc is ok or no information
|
||||
from the driver. Trying CDROMSUBCHNL.*)
|
||||
sci.cdsc_format := CDROM_MSF;
|
||||
if fpioctl(_cd_fd, CDROMSUBCHNL, @sci) >= 0 then
|
||||
begin
|
||||
inc(DrivesCount);
|
||||
setlength(DrivesPaths,DrivesCount);
|
||||
DrivesPaths[DrivesCount-1] := fname;
|
||||
end;
|
||||
fpclose(_cd_fd);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetDrivesCount : Integer;
|
||||
begin
|
||||
Result := DrivesCount;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetCurrentDrive(Value : Integer);
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
FCurrentDrive := Value;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetDriveName : String;
|
||||
begin
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
destructor TACSCDIn.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
293
acs/Src/classes/linux/acs_mixer.inc
Normal file
293
acs/Src/classes/linux/acs_mixer.inc
Normal file
@@ -0,0 +1,293 @@
|
||||
{
|
||||
$Log: acs_mixer.inc,v $
|
||||
Revision 1.2 2005/12/30 12:54:42 z0m3ie
|
||||
some error checks
|
||||
|
||||
Revision 1.1 2005/12/19 18:35:03 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.3 2005/12/04 16:54:34 z0m3ie
|
||||
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
|
||||
|
||||
Revision 1.2 2005/09/13 21:54:11 z0m3ie
|
||||
acs is localizeable now (ACS_Strings)
|
||||
|
||||
Revision 1.1 2005/09/12 22:04:52 z0m3ie
|
||||
modified structure again, fileformats are now in an sperat folder.
|
||||
all File In/Out classes are capsulated from TFileIn and TFileOut
|
||||
|
||||
Revision 1.4 2005/09/09 21:33:43 z0m3ie
|
||||
linux corrections
|
||||
|
||||
Revision 1.3 2005/08/31 20:30:40 z0m3ie
|
||||
Mixer Channelname work now
|
||||
minior corrections for Converters
|
||||
|
||||
Revision 1.2 2005/08/28 20:31:18 z0m3ie
|
||||
linux restructuring for 2.4
|
||||
|
||||
Revision 1.1 2005/08/25 20:18:00 z0m3ie
|
||||
Version 2.4 restructure
|
||||
TCDPlayer removed (fits not in component structure)
|
||||
TMP3ToWavConverter removed (fits not in component structure)
|
||||
|
||||
}
|
||||
|
||||
|
||||
type
|
||||
TMixerInfo = record
|
||||
Path : String;
|
||||
Name : String;
|
||||
end;
|
||||
|
||||
const
|
||||
MAX_MIXERS = 5; (* There shouldn't be more than
|
||||
5 valid mixers in the system.
|
||||
Right? *)
|
||||
|
||||
var
|
||||
Mixers : array[0..MAX_MIXERS] of TMixerInfo; // one extra slot for /dev/mixer device
|
||||
|
||||
function GetChannelMask(Ch : TACSMixerChannel; Request : Integer): LongWord;
|
||||
begin
|
||||
Result := 0;
|
||||
case Request of
|
||||
0:
|
||||
case Ch of
|
||||
mcVolume: Result := SOUND_MIXER_VOLUME;
|
||||
mcTreble: Result := SOUND_MIXER_TREBLE;
|
||||
mcBass: Result := SOUND_MIXER_BASS;
|
||||
mcSynth: Result := SOUND_MIXER_SYNTH;
|
||||
mcPCM: Result := SOUND_MIXER_PCM;
|
||||
mcSpeaker: Result := SOUND_MIXER_SPEAKER;
|
||||
mcLine: Result := SOUND_MIXER_LINE;
|
||||
mcMic: Result := SOUND_MIXER_MIC;
|
||||
mcCD: Result := SOUND_MIXER_CD;
|
||||
mcIMix: Result := SOUND_MIXER_IMIX;
|
||||
mcAltPCM: Result := SOUND_MIXER_ALTPCM;
|
||||
mcRecLev: Result := SOUND_MIXER_RECLEV;
|
||||
mcUnknown: Result := 0;
|
||||
end;
|
||||
1:
|
||||
case Ch of
|
||||
mcVolume: Result := SOUND_MIXER_WRITE_VOLUME;
|
||||
mcTreble: Result := SOUND_MIXER_WRITE_TREBLE;
|
||||
mcBass: Result := SOUND_MIXER_WRITE_BASS;
|
||||
mcSynth: Result := SOUND_MIXER_WRITE_SYNTH;
|
||||
mcPCM: Result := SOUND_MIXER_WRITE_PCM;
|
||||
mcSpeaker: Result := SOUND_MIXER_WRITE_SPEAKER;
|
||||
mcLine: Result := SOUND_MIXER_WRITE_LINE;
|
||||
mcMic: Result := SOUND_MIXER_WRITE_MIC;
|
||||
mcCD: Result := SOUND_MIXER_WRITE_CD;
|
||||
mcIMix: Result := SOUND_MIXER_WRITE_IMIX;
|
||||
mcAltPCM: Result := SOUND_MIXER_WRITE_ALTPCM;
|
||||
mcRecLev: Result := SOUND_MIXER_WRITE_RECLEV;
|
||||
mcUnknown: Result := 0;
|
||||
end;
|
||||
2:
|
||||
case Ch of
|
||||
mcVolume: Result := SOUND_MIXER_READ_VOLUME;
|
||||
mcTreble: Result := SOUND_MIXER_READ_TREBLE;
|
||||
mcBass: Result := SOUND_MIXER_READ_BASS;
|
||||
mcSynth: Result := SOUND_MIXER_READ_SYNTH;
|
||||
mcPCM: Result := SOUND_MIXER_READ_PCM;
|
||||
mcSpeaker: Result := SOUND_MIXER_READ_SPEAKER;
|
||||
mcLine: Result := SOUND_MIXER_READ_LINE;
|
||||
mcMic: Result := SOUND_MIXER_READ_MIC;
|
||||
mcCD: Result := SOUND_MIXER_READ_CD;
|
||||
mcIMix: Result := SOUND_MIXER_READ_IMIX;
|
||||
mcAltPCM: Result := SOUND_MIXER_READ_ALTPCM;
|
||||
mcRecLev: Result := SOUND_MIXER_READ_RECLEV;
|
||||
mcUnknown: Result := 0;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetChannelType(Mask : Integer) : TACSMixerChannel;
|
||||
begin
|
||||
case Mask of
|
||||
SOUND_MIXER_VOLUME: Result := mcVolume;
|
||||
SOUND_MIXER_TREBLE: Result := mcTreble;
|
||||
SOUND_MIXER_BASS: Result := mcBass;
|
||||
SOUND_MIXER_SYNTH: Result := mcSynth;
|
||||
SOUND_MIXER_PCM: Result := mcPCM;
|
||||
SOUND_MIXER_SPEAKER: Result := mcSpeaker;
|
||||
SOUND_MIXER_LINE: Result := mcLine;
|
||||
SOUND_MIXER_MIC: Result := mcMic;
|
||||
SOUND_MIXER_CD: Result := mcCD;
|
||||
SOUND_MIXER_IMIX: Result := mcIMix;
|
||||
SOUND_MIXER_ALTPCM: Result := mcAltPCM;
|
||||
SOUND_MIXER_RECLEV: Result := mcRecLev;
|
||||
else Result := mcUnknown;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetDevNum(Num : Integer);
|
||||
var
|
||||
DevMask, i : Integer;
|
||||
Channel : TACSMixerChannel;
|
||||
begin
|
||||
if Num in [0..MixersCount - 1] then // check [0..0] [0..-1]
|
||||
begin
|
||||
FFileName := Mixers[Num].Path;
|
||||
FMixerName := Mixers[Num].Name;
|
||||
setlength(FChannels,0);
|
||||
_mix_fd := fpopen(PChar(FFileName), O_RDONLY);
|
||||
fpioctl(_mix_fd, SOUND_MIXER_READ_DEVMASK, @DevMask);
|
||||
fpclose(_mix_fd);
|
||||
for i:=0 to 31 do
|
||||
begin
|
||||
if (DevMask and (1 shl i)) <> 0 then
|
||||
begin
|
||||
Channel := GetChannelType(i);
|
||||
if Channel <> mcUnknown then
|
||||
begin
|
||||
setlength(FChannels,length(FChannels)+1);
|
||||
FChannels[length(FChannels)-1] := Channel;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TACSMixer.GetRecSource;
|
||||
var
|
||||
rs, pow,i : Integer;
|
||||
begin
|
||||
Result := -1;
|
||||
_mix_fd := fpopen(PChar(FFileName), O_RDONLY);
|
||||
fpioctl(_mix_fd, SOUND_MIXER_READ_RECSRC, @rs);
|
||||
fpclose(_mix_fd);
|
||||
pow := 0;
|
||||
while rs <> 1 do
|
||||
begin
|
||||
rs := rs shr 1;
|
||||
Inc(pow);
|
||||
end;
|
||||
for i := 0 to length(FChannels)-1 do
|
||||
if FChannels[i] = GetChannel(pow) then
|
||||
Result := i;
|
||||
end;
|
||||
|
||||
function TACSMixer.GetVolume;
|
||||
var
|
||||
vol, chan : Integer;
|
||||
begin
|
||||
_mix_fd := fpopen(PChar(FFileName), O_RDONLY);
|
||||
chan := GetChannelMask(FChannels[vChannel], 2);
|
||||
fpioctl(_mix_fd, chan, @vol);
|
||||
fpclose(_mix_fd);
|
||||
if vol > 255 then
|
||||
begin
|
||||
Result.Left := Lo(vol);
|
||||
Result.Right := Lo(vol shr 8);
|
||||
end else Result.Main := vol;
|
||||
end;
|
||||
|
||||
function TACSMixer.IsStereo;
|
||||
var
|
||||
mask, chan : Integer;
|
||||
begin
|
||||
_mix_fd := fpopen(PChar(FFileName), O_RDONLY);
|
||||
fpioctl(_mix_fd, SOUND_MIXER_READ_STEREODEVS, @mask);
|
||||
chan := GetChannelMask(FChannels[vChannel], 0);
|
||||
fpclose(_mix_fd);
|
||||
Result := (mask and (1 shl chan))<>0;
|
||||
end;
|
||||
|
||||
function TACSMixer.IsRecordable;
|
||||
var
|
||||
mask, chan : Integer;
|
||||
begin
|
||||
_mix_fd := fpopen(PChar(FFileName), O_RDONLY);
|
||||
fpioctl(_mix_fd, SOUND_MIXER_READ_RECMASK, @mask);
|
||||
chan := GetChannelMask(FChannels[vChannel], 0);
|
||||
fpclose(_mix_fd);
|
||||
Result := (mask and (1 shl chan))<>0;
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetRecSource;
|
||||
var
|
||||
chan : Integer;
|
||||
begin
|
||||
chan := 1 shl GetChannelMask(FChannels[vChannel], 0);
|
||||
_mix_fd := fpopen(PChar(FFileName), O_WRONLY);
|
||||
fpioctl(_mix_fd, SOUND_MIXER_WRITE_RECSRC, @chan);
|
||||
fpclose(_mix_fd);
|
||||
if chan <> (1 shl GetChannelMask(FChannels[vChannel], 0)) then
|
||||
raise EACSException.Create(Format(strChannelnotRecordable,[vChannel]));
|
||||
end;
|
||||
|
||||
function TACSMixer.GetMute(vChannel : integer) : Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetMute(vChannel : integer; Mute : Boolean);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetVolume;
|
||||
var
|
||||
vol, chan : Integer;
|
||||
begin
|
||||
chan := GetChannelMask(FChannels[vChannel], 1);
|
||||
if IsStereo(vChannel) then
|
||||
vol := vLevel.Left + (vLevel.Right shl 8)
|
||||
else vol := vLevel.Main;
|
||||
_mix_fd := fpopen(PChar(FFileName), O_WRONLY);
|
||||
fpioctl(_mix_fd, chan, @vol);
|
||||
fpclose(_mix_fd);
|
||||
end;
|
||||
|
||||
destructor TACSMixer.Destroy;
|
||||
begin
|
||||
Setlength(FChannels,0);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function CountMixers : Byte;
|
||||
var
|
||||
fd, i, DevMask : Integer;
|
||||
fname : String;
|
||||
mi : mixer_info;
|
||||
begin
|
||||
Result := 0;
|
||||
for i := 0 to MAX_MIXERS-1 do
|
||||
begin
|
||||
fname := '/dev/mixer'+IntToStr(i-1);
|
||||
try
|
||||
fd := fpopen(PChar(fname), O_RDONLY);
|
||||
except
|
||||
Break;
|
||||
end;
|
||||
if fd = -1 then Break;
|
||||
DevMask := 0;
|
||||
fpioctl(fd, SOUND_MIXER_READ_DEVMASK, @DevMask);
|
||||
if DevMask <> 0 then
|
||||
begin
|
||||
Mixers[Result].Path := fname;
|
||||
fpioctl(fd, SOUND_MIXER_INFO, @mi);
|
||||
Mixers[Result].Name := String(mi.name);
|
||||
Inc(Result);
|
||||
end;
|
||||
fpclose(fd);
|
||||
end;
|
||||
fname := '/dev/mixer';
|
||||
try
|
||||
fd := fpopen(PChar(fname), O_RDONLY);
|
||||
except
|
||||
Exit;
|
||||
end;
|
||||
if fd = -1 then Exit;
|
||||
fpioctl(fd, SOUND_MIXER_READ_DEVMASK, @DevMask);
|
||||
if DevMask <> 0 then
|
||||
begin
|
||||
Mixers[Result].Path := fname;
|
||||
fpioctl(fd, SOUND_MIXER_INFO, @mi);
|
||||
Mixers[Result].Name := String(mi.name);
|
||||
end;
|
||||
fpclose(fd);
|
||||
Inc(Result);
|
||||
end;
|
||||
|
392
acs/Src/classes/linux/cd_rom.pas
Normal file
392
acs/Src/classes/linux/cd_rom.pas
Normal file
@@ -0,0 +1,392 @@
|
||||
(* cd_rom kylix unit
|
||||
translated from cdrom.h by andrei borovsky.
|
||||
|
||||
this unit contains declarations translated
|
||||
from the huge cdrom.h header file. In fact
|
||||
cdrom.h covers a lot of stuff concerning
|
||||
CDs, DVDs, writable CDs, etc. Of all these
|
||||
there are only the declarations needed for
|
||||
reading/playing CDs in this unit. *)
|
||||
(*
|
||||
This file is a part of Audio Components Suite v 2.3.
|
||||
Copyright (c) 2002-2005 Andrei Borovsky. All rights reserved.
|
||||
See the LICENSE file for more details.
|
||||
You can contact me at mail@z0m3ie.de
|
||||
*)
|
||||
|
||||
{
|
||||
$Log: cd_rom.pas,v $
|
||||
Revision 1.3 2005/12/19 18:35:03 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.1 2005/09/12 22:04:52 z0m3ie
|
||||
modified structure again, fileformats are now in an sperat folder.
|
||||
all File In/Out classes are capsulated from TFileIn and TFileOut
|
||||
|
||||
Revision 1.1 2005/08/25 20:18:00 z0m3ie
|
||||
Version 2.4 restructure
|
||||
TCDPlayer removed (fits not in component structure)
|
||||
TMP3ToWavConverter removed (fits not in component structure)
|
||||
|
||||
Revision 1.2 2005/08/22 20:17:01 z0m3ie
|
||||
changed Headers to log
|
||||
changed mail adress
|
||||
|
||||
}
|
||||
|
||||
|
||||
unit cd_rom;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
baseunix,unix;
|
||||
|
||||
type
|
||||
__U8 = Byte;
|
||||
request_sense = Byte;
|
||||
(* request_sense is a bitmask : veeeeeee
|
||||
v - valid
|
||||
eeeeeee - error code
|
||||
*)
|
||||
PRequest_sense = ^request_sense;
|
||||
|
||||
//const
|
||||
// EDRIVE_CANT_DO_THIS = EOPNOTSUPP;
|
||||
|
||||
(*
|
||||
The CD-ROM IOCTL commands -- these should be supported by }
|
||||
all the various cdrom drivers. For the CD-ROM ioctls, we }
|
||||
will commandeer byte 0x53, or 'S'. *)
|
||||
|
||||
const
|
||||
|
||||
CDROMPAUSE = $5301; // Pause Audio Operation
|
||||
CDROMRESUME = $5302; // Resume paused Audio Operation
|
||||
CDROMPLAYMSF = $5303; // Play Audio MSF (struct cdrom_msf)
|
||||
CDROMPLAYTRKIND = $5304; // Play Audio Track/index
|
||||
CDROMREADTOCHDR = $5305; // Read TOC header
|
||||
CDROMREADTOCENTRY = $5306; // Read TOC entry
|
||||
CDROMSTOP = $5307; // Stop the cdrom drive
|
||||
CDROMSTART = $5308; // Start the cdrom drive
|
||||
CDROMEJECT = $5309; // Ejects the cdrom media
|
||||
CDROMVOLCTRL = $530a; // Control output volume
|
||||
CDROMSUBCHNL = $530b; // Read subchannel data
|
||||
CDROMREADMODE2 = $530c; // Read CDROM mode 2 data (2336 Bytes)
|
||||
CDROMREADMODE1 = $530d; // Read CDROM mode 1 data (2048 Bytes)
|
||||
CDROMREADAUDIO = $530e; // (struct cdrom_read_audio)
|
||||
CDROMEJECT_SW = $530; // enable(1)/disable(0) auto-ejecting
|
||||
CDROMMULTISESSION = $5310; // Obtain the start-of-last-session
|
||||
CDROM_GET_MCN = $5311; // Obtain the "Universal Product Code"
|
||||
CDROM_GET_UPC = CDROM_GET_MCN; // depricated
|
||||
CDROMRESET = $5312; // hard-reset the drive
|
||||
CDROMVOLREAD = $5313; // Get the drive's volume setting
|
||||
CDROMREADRAW = $5314; // read data in raw mode (2352 Bytes)
|
||||
|
||||
{ These ioctls are used only used in aztcd.c and optcd.c }
|
||||
|
||||
CDROMREADCOOKED = $5315; // read data in cooked mode
|
||||
CDROMSEEK = $5316; // seek msf address
|
||||
|
||||
{ This ioctl is only used by the scsi-cd driver. }
|
||||
{ It is for playing audio in logical block addressing mode. }
|
||||
|
||||
CDROMPLAYBLK = $5317; // (struct cdrom_blk)
|
||||
|
||||
{ These ioctls are only used in optcd.c }
|
||||
|
||||
CDROMREADALL = $5318; // read all 2646 bytes
|
||||
|
||||
(* These ioctls are (now) only in ide-cd.c for controlling
|
||||
drive spindown time. They should be implemented in the
|
||||
Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
|
||||
GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
|
||||
-Erik *)
|
||||
|
||||
const
|
||||
|
||||
CDROMGETSPINDOWN = $531d;
|
||||
CDROMSETSPINDOWN = $531e;
|
||||
|
||||
(* These ioctls are implemented through the uniform CD-ROM driver
|
||||
They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
|
||||
drivers are eventually ported to the uniform CD-ROM driver interface. *)
|
||||
|
||||
const
|
||||
|
||||
CDROMCLOSETRAY = $5319; // pendant of CDROMEJECT
|
||||
CDROM_SET_OPTIONS = $5320; // Set behavior options
|
||||
CDROM_CLEAR_OPTIONS = $5321; // Clear behavior options
|
||||
CDROM_SELECT_SPEED = $5322; // Set the CD-ROM speed
|
||||
CDROM_SELECT_DISC = $5323; // Select disc (for juke-boxes)
|
||||
CDROM_MEDIA_CHANGED = $5325; // Check is media changed
|
||||
CDROM_DRIVE_STATUS = $5326; // Get tray position, etc.
|
||||
CDROM_DISC_STATUS = $5327; // Get disc type, etc.
|
||||
CDROM_CHANGER_NSLOTS = $5328; // Get number of slots
|
||||
CDROM_LOCKDOOR = $5329; // lock or unlock door
|
||||
CDROM_DEBUG = $5330; // Turn debug messages on/off
|
||||
CDROM_GET_CAPABILITY = $5331; // get capabilities
|
||||
|
||||
// This ioctl is only used by sbpcd at the moment
|
||||
|
||||
CDROMAUDIOBUFSIZ = $5382; // set the audio buffer size
|
||||
CDROM_SEND_PACKET = $5393; // send a packet to the drive
|
||||
CDROM_NEXT_WRITABLE = $5394; // get next writable block
|
||||
CDROM_LAST_WRITTEN = $5395; // get last block written on disc
|
||||
|
||||
//******************************************************}
|
||||
// CDROM IOCTL structures
|
||||
//******************************************************}
|
||||
|
||||
type
|
||||
|
||||
// Address in MSF format
|
||||
cdrom_msf0 = record
|
||||
minute: __U8;
|
||||
second: __U8;
|
||||
frame: __U8;
|
||||
end;
|
||||
|
||||
// Address in either MSF or logical format
|
||||
cdrom_addr = record
|
||||
case Word of
|
||||
1: (msf: cdrom_msf0;);
|
||||
2: (lba: Integer;);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
(* cdrom_msf renamed to cdrom_msf_t since there is
|
||||
also a cdrom_msf constant in this unit *)
|
||||
|
||||
// This struct is used by the CDROMPLAYMSF ioctl
|
||||
cdrom_msf_t = record
|
||||
cdmsf_min0: __U8; // start minute
|
||||
cdmsf_sec0: __U8; // start second
|
||||
cdmsf_frame0: __U8; // start frame
|
||||
cdmsf_min1: __U8; // end minute
|
||||
cdmsf_sec1: __U8; // end second
|
||||
cdmsf_frame1: __U8; // end frame
|
||||
end;
|
||||
|
||||
// This struct is used by the CDROMPLAYTRKIND ioctl
|
||||
cdrom_ti = record
|
||||
cdti_trk0: __U8; // start track
|
||||
cdti_ind0: __U8; // start index
|
||||
cdti_trk1: __U8; // end track
|
||||
cdti_ind1: __U8; // end index
|
||||
end;
|
||||
|
||||
// This struct is used by the CDROMREADTOCHDR ioctl
|
||||
cdrom_tochdr = record
|
||||
cdth_trk0: __U8; // start track
|
||||
cdth_trk1: __U8; // end track
|
||||
end;
|
||||
|
||||
// This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls
|
||||
cdrom_volctrl = record
|
||||
channel0: __U8;
|
||||
channel1: __U8;
|
||||
channel2: __U8;
|
||||
channel3: __U8;
|
||||
end;
|
||||
|
||||
// This struct is used by the CDROMSUBCHNL ioctl
|
||||
cdrom_subchnl = record
|
||||
cdsc_format: __U8;
|
||||
cdsc_audiostatus: __U8;
|
||||
CDSC_ADR_CTRL : __U8; // 4 bits - ADR, 4 bits - CTRL
|
||||
cdsc_trk: __U8;
|
||||
cdsc_ind: __U8;
|
||||
cdsc_absaddr: cdrom_addr;
|
||||
cdsc_reladdr: cdrom_addr;
|
||||
end;
|
||||
|
||||
|
||||
// This struct is used by the CDROMREADTOCENTRY ioctl
|
||||
cdrom_tocentry = record
|
||||
cdte_track: __U8;
|
||||
cdte_adr_ctrl: __U8;
|
||||
cdte_format: __U8;
|
||||
cdte_addr: cdrom_addr;
|
||||
cdte_datamode: __U8;
|
||||
end;
|
||||
|
||||
// This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls
|
||||
cdrom_read = record
|
||||
cdread_lba: Integer;
|
||||
cdread_bufaddr: PChar;
|
||||
cdread_buflen: Integer;
|
||||
end;
|
||||
|
||||
// This struct is used by the CDROMREADAUDIO ioctl
|
||||
cdrom_read_audio = record
|
||||
addr: cdrom_addr; // frame address
|
||||
addr_format: __U8; // CDROM_LBA or CDROM_MSF
|
||||
nframes: Integer; // number of 2352-byte-frames to read at once
|
||||
buf: PChar; // frame buffer (size: nframes*2352 bytes)
|
||||
end;
|
||||
|
||||
// This struct is used with the CDROMMULTISESSION ioctl
|
||||
cdrom_multisession = record
|
||||
addr: cdrom_addr;
|
||||
(* frame address: start-of-last-session
|
||||
(not the new "frame 16"!). Only valid
|
||||
if the "xa_flag" is true. *)
|
||||
xa_flag: __U8; // 1: "is XA disk"
|
||||
addr_format: __U8; // CDROM_LBA or CDROM_MSF }
|
||||
end;
|
||||
|
||||
(* This struct is used with the CDROM_GET_MCN ioctl.
|
||||
Very few audio discs actually have Universal Product Code information,
|
||||
which should just be the Medium Catalog Number on the box. Also note
|
||||
that the way the codeis written on CD is _not_ uniform across all discs! *)
|
||||
|
||||
cdrom_mcn = record
|
||||
medium_catalog_number: array[0..13] of __U8;
|
||||
{ 13 ASCII digits, null-terminated }
|
||||
end;
|
||||
|
||||
// This is used by the CDROMPLAYBLK ioctl
|
||||
type
|
||||
cdrom_blk = record
|
||||
from: Word;
|
||||
len: Word;
|
||||
end;
|
||||
|
||||
const
|
||||
CDROM_PACKET_SIZE = 12;
|
||||
CGC_DATA_UNKNOWN = 0;
|
||||
CGC_DATA_WRITE = 1;
|
||||
CGC_DATA_READ = 2;
|
||||
CGC_DATA_NONE = 3;
|
||||
|
||||
// for CDROM_PACKET_COMMAND ioctl
|
||||
type
|
||||
cdrom_generic_command = record
|
||||
cmd: array[0..CDROM_PACKET_SIZE-1] of Byte;
|
||||
buffer: PByte;
|
||||
buflen: Word;
|
||||
stat: Integer;
|
||||
sense: PREQUEST_SENSE;
|
||||
data_direction: Byte;
|
||||
quiet: Integer;
|
||||
timeout: Integer;
|
||||
reserved: array[0..0] of Pointer;
|
||||
end;
|
||||
|
||||
// Some generally useful CD-ROM information -- mostly based on the above
|
||||
const
|
||||
|
||||
CD_MINS = 74; // max. minutes per CD, not really a limit
|
||||
CD_SECS = 60; // seconds per minute
|
||||
CD_FRAMES = 75; // frames per second
|
||||
CD_SYNC_SIZE = 12; // 12 sync bytes per raw data frame
|
||||
CD_MSF_OFFSET = 150; // MSF numbering offset of first frame
|
||||
CD_CHUNK_SIZE = 24; // lowest-level 'data bytes piece'
|
||||
CD_NUM_OF_CHUNKS = 98; // chunks per frame
|
||||
CD_FRAMESIZE_SUB = 96; // subchannel data 'frame' size
|
||||
CD_HEAD_SIZE = 4; // header (address) bytes per raw data frame
|
||||
CD_SUBHEAD_SIZE = 8; // subheader bytes per raw XA data frame
|
||||
CD_EDC_SIZE = 4; // bytes EDC per most raw data frame types
|
||||
CD_ZERO_SIZE = 8; // bytes zero per yellow book mode 1 frame
|
||||
CD_ECC_SIZE = 276; // bytes ECC per most raw data frame types
|
||||
CD_FRAMESIZE = 2048; // bytes per frame, 'cooked' mode
|
||||
CD_FRAMESIZE_RAW = 2352; // bytes per frame, 'raw' mode
|
||||
CD_FRAMESIZE_RAWER = 2646; // The maximum possible returned bytes
|
||||
|
||||
// most drives don't deliver everything:
|
||||
|
||||
CD_FRAMESIZE_RAW1 = (CD_FRAMESIZE_RAW-CD_SYNC_SIZE); //2340
|
||||
CD_FRAMESIZE_RAW0 = (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE); //2336
|
||||
CD_XA_HEAD = (CD_HEAD_SIZE+CD_SUBHEAD_SIZE); // 'before data' part of raw XA frame
|
||||
CD_XA_TAIL = (CD_EDC_SIZE+CD_ECC_SIZE); // 'after data' part of raw XA frame
|
||||
CD_XA_SYNC_HEAD = (CD_SYNC_SIZE+CD_XA_HEAD); // sync bytes + header of XA frame
|
||||
|
||||
// CD-ROM address types (cdrom_tocentry.cdte_format)
|
||||
|
||||
CDROM_LBA = $01; // 'logical block': first frame is #0
|
||||
CDROM_MSF = $02; // 'minute-second-frame': binary, not bcd here!
|
||||
|
||||
// bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl)
|
||||
|
||||
CDROM_DATA_TRACK = $40;
|
||||
|
||||
// The leadout track is always 0xAA, regardless of # of tracks on disc
|
||||
|
||||
CDROM_LEADOUT = $AA;
|
||||
|
||||
// audio states (from SCSI-2, but seen with other drives, too)
|
||||
|
||||
CDROM_AUDIO_INVALID = $00; // audio status not supported
|
||||
CDROM_AUDIO_PLAY = $11; // audio play operation in progress
|
||||
CDROM_AUDIO_PAUSED = $12; // audio play operation paused
|
||||
CDROM_AUDIO_COMPLETED = $13; // audio play successfully completed
|
||||
CDROM_AUDIO_ERROR = $14; // audio play stopped due to error
|
||||
CDROM_AUDIO_NO_STATUS = $15; // no current audio status to return
|
||||
|
||||
// capability flags used with the uniform CD-ROM driver
|
||||
|
||||
CDC_CLOSE_TRAY = $1; // caddy systems _can't_ close
|
||||
CDC_OPEN_TRAY = $2; // but _can_ eject.
|
||||
CDC_LOCK = $4; // disable manual eject
|
||||
CDC_SELECT_SPEED = $8; // programmable speed
|
||||
CDC_SELECT_DISC = $10; // select disc from juke-box
|
||||
CDC_MULTI_SESSION = $20; // read sessions>1
|
||||
CDC_MCN = $40; // Medium Catalog Number
|
||||
CDC_MEDIA_CHANGED = $80; // media changed
|
||||
CDC_PLAY_AUDIO = $100; // audio functions
|
||||
CDC_RESET = $200; // hard reset device
|
||||
CDC_IOCTLS = $400; // driver has non-standard ioctls
|
||||
CDC_DRIVE_STATUS = $800; // driver implements drive status
|
||||
CDC_GENERIC_PACKET = $1000; // driver implements generic packets
|
||||
CDC_CD_R = $2000; // drive is a CD-R
|
||||
CDC_CD_RW = $4000; // drive is a CD-RW
|
||||
CDC_DVD = $8000; // drive is a DVD
|
||||
CDC_DVD_R = $10000; // drive can write DVD-R
|
||||
CDC_DVD_RAM = $20000; // drive can write DVD-RAM
|
||||
|
||||
// drive status possibilities returned by CDROM_DRIVE_STATUS ioctl
|
||||
|
||||
CDS_NO_INFO = 0; // if not implemented
|
||||
CDS_NO_DISC = 1;
|
||||
CDS_TRAY_OPEN = 2;
|
||||
CDS_DRIVE_NOT_READY = 3;
|
||||
CDS_DISC_OK = 4;
|
||||
|
||||
(* return values for the CDROM_DISC_STATUS ioctl
|
||||
can also return CDS_NO_[INFO|DISC], from above *)
|
||||
|
||||
CDS_AUDIO = 100;
|
||||
CDS_DATA_1 = 101;
|
||||
CDS_DATA_2 = 102;
|
||||
CDS_XA_2_1 = 103;
|
||||
CDS_XA_2_2 = 104;
|
||||
CDS_MIXED = 105;
|
||||
|
||||
// User-configurable behavior options for the uniform CD-ROM driver
|
||||
|
||||
CDO_AUTO_CLOSE = $1; // close tray on first open()
|
||||
CDO_AUTO_EJECT = $2; // open tray on last release()
|
||||
CDO_USE_FFLAGS = $4; // use O_NONBLOCK information on open
|
||||
CDO_LOCK = $8; // lock tray on open files
|
||||
CDO_CHECK_TYPE = $10; // check type on open for data
|
||||
|
||||
// Special codes used when specifying changer slots.
|
||||
|
||||
CDSL_NONE = $7FFFFFFE;
|
||||
CDSL_CURRENT = $7FFFFFFF;
|
||||
|
||||
(* For partition based multisession access. IDE can handle 64 partitions
|
||||
per drive - SCSI CD-ROM's use minors to differentiate between the
|
||||
various drives, so we can't do multisessions the same way there.
|
||||
Use the -o session=x option to mount on them. *)
|
||||
|
||||
CD_PART_MAX = 64;
|
||||
CD_PART_MASK = (CD_PART_MAX - 1);
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
Reference in New Issue
Block a user