Стартовый пул
This commit is contained in:
336
acs/Src/classes/windows/acs_cdrom.inc
Normal file
336
acs/Src/classes/windows/acs_cdrom.inc
Normal file
@@ -0,0 +1,336 @@
|
||||
{
|
||||
$Log: acs_cdrom.inc,v $
|
||||
Revision 1.12 2006/08/31 20:10:56 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.11 2006/07/04 17:12:45 z0m3ie
|
||||
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
|
||||
|
||||
Revision 1.3 2006/01/03 15:37:51 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
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
|
||||
|
||||
Revision 1.1 2005/12/19 18:35:16 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.4 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.3 2005/10/02 16:51:46 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
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.5 2005/09/09 21:33:43 z0m3ie
|
||||
linux corrections
|
||||
|
||||
Revision 1.4 2005/09/08 22:19:00 z0m3ie
|
||||
completed akrip based CDIn
|
||||
|
||||
Revision 1.3 2005/09/07 20:53:22 z0m3ie
|
||||
begon to add MPEG and WMA support using DirectX
|
||||
|
||||
Revision 1.2 2005/09/04 17:59:38 z0m3ie
|
||||
moving CDIn support to AKRip mostly
|
||||
begon to add mpegin support for Win with mpg123
|
||||
|
||||
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
|
||||
MSFAddr = array[0..3] of Byte;
|
||||
|
||||
function Toc2MSF(t : MSFAddr) : TACSCDMSF;
|
||||
begin
|
||||
Result.Minute := t[1];
|
||||
Result.Second := t[2];
|
||||
Result.Frame := t[3];
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.OpenCD;
|
||||
var
|
||||
GetCD: GETCDHAND;
|
||||
begin
|
||||
with GetCD do
|
||||
begin
|
||||
Size := SizeOf(GETCDHAND);
|
||||
Ver := 1;
|
||||
ha := 0;
|
||||
tgt := FCurrentDrive;
|
||||
lun := 0;
|
||||
readType := CDR_ANY;
|
||||
jitterCorr := false;
|
||||
numJitter := 0;
|
||||
numOverlap := 0;
|
||||
end;
|
||||
FCDHandle := GetCDHandle(GetCD);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.CloseCD;
|
||||
begin
|
||||
if FCDHandle <> 0 then
|
||||
CloseCDHandle(FCDHandle);
|
||||
FCDHandle := 0;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetInfo : TACSCDInfo;
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
OpenCD;
|
||||
Result := cdiUnknown;
|
||||
ModifyCDParms(FCDHandle, CDP_MSF, DWORD(true));
|
||||
FillChar(FToc, SizeOf(FToc),0);
|
||||
if ReadTOC(FCDHandle, FTOC) <> 1 then
|
||||
begin
|
||||
Result := cdiNoDisc;
|
||||
Exit;
|
||||
end;
|
||||
for i := 0 to FToc.lastTrack-1 do
|
||||
begin
|
||||
if (FToc.Tracks[i].adr and $04) = 0 then
|
||||
begin
|
||||
case Result of
|
||||
cdiUnknown : Result := cdiDiscAudio;
|
||||
cdiDiscData : Result := cdiDiscMixed;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
case Result of
|
||||
cdiUnknown : Result := cdiDiscData;
|
||||
cdiDiscAudio : Result := cdiDiscMixed;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetStatus : TACSCDStatus;
|
||||
var
|
||||
ms : Integer;
|
||||
AP : LongBool;
|
||||
begin
|
||||
if FPlaying then
|
||||
Result := cdsPlaying
|
||||
else if (GetInfo <> cdiNoDisc) and (GetInfo <> cdiUnknown) then
|
||||
Result := cdsReady
|
||||
else
|
||||
Result := cdsNotReady;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetNumTracks : Integer;
|
||||
begin
|
||||
OpenCD;
|
||||
if FToc.lastTrack = 0 then
|
||||
begin
|
||||
ModifyCDParms(FCDHandle, CDP_MSF, DWORD(true));
|
||||
if ReadTOC(FCDHandle, FTOC) <> 1 then
|
||||
begin
|
||||
Result := -1;
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Result := FToc.lastTrack;
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
FUNCTION TACSCDIn.GetTrackInfo(const vIndex : Integer) : TACSCDTrackInfo;
|
||||
VAR
|
||||
Frames: Integer;
|
||||
tmpmsf : TACSCDMSF;
|
||||
BEGIN
|
||||
IF Busy THEN
|
||||
RAISE EACSException.Create(strBusy);
|
||||
IF (vIndex IN [0..GetNumTracks-1]) = False THEN
|
||||
RAISE EACSException.Create(strTrackoutofrange);
|
||||
IF (FToc.Tracks[vIndex].adr and $04) = 0 THEN
|
||||
Result.TrackType := ttAudio
|
||||
ELSE
|
||||
Result.TrackType := ttData;
|
||||
Result.TrackStart.Minute := FToc.Tracks[vIndex].addr[1];
|
||||
Result.TrackStart.Second := FToc.Tracks[vIndex].addr[2];
|
||||
Result.TrackStart.Frame := FToc.Tracks[vIndex].addr[3];
|
||||
Frames := MSF2Frames(Toc2MSF(MSFAddr(FToc.Tracks[vIndex+1].addr)))-MSF2Frames(Toc2MSF(MSFAddr(FToc.Tracks[vIndex].addr)));
|
||||
Frames2MSF(Frames, Result.TrackLength);
|
||||
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;
|
||||
FEndPos.Track := FEndTrack+1;
|
||||
FillChar(FEndPos.MSF, SizeOf(FEndPos.MSF), 0);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetSP;
|
||||
begin
|
||||
if Self.Busy then raise EACSException.Create(strBusy);
|
||||
FStartPos := Pos;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetEP;
|
||||
begin
|
||||
if Self.Busy then raise EACSException.Create(strBusy);
|
||||
FEndPos := Pos;
|
||||
if Pos.Track = EndOfDisc.Track then FEndPos.Track := TracksCount + 1;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetSize : Integer;
|
||||
var
|
||||
Sect1, Sect2 : Integer;
|
||||
begin
|
||||
if Busy then
|
||||
begin
|
||||
Result := FRipEnd-FRipStart*CD_FRAMESIZE_RAW;
|
||||
Exit;
|
||||
end;
|
||||
Sect1 := MSF2Frames(Toc2MSF(MSFAddr(FToc.tracks[FStartPos.Track].addr)));
|
||||
Sect1 := Sect1 + MSF2Frames(FStartPos.MSF);
|
||||
Sect2 := MSF2Frames(Toc2MSF(MSFAddr(FToc.tracks[FEndPos.Track].addr)));
|
||||
Sect2 := Sect2 + MSF2Frames(FEndPos.MSF);
|
||||
Result := (Sect2 - Sect1)*CD_FRAMESIZE_RAW;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.Init;
|
||||
var
|
||||
Sect1, Sect2 : Integer;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
if Status = cdsNotReady then
|
||||
raise EACSException.Create(strDrivenotready);
|
||||
if (FStartPos.Track in [0..GetNumTracks-1]) = False then
|
||||
raise EACSException.Create(strTrackoutofRange);
|
||||
if Tracks[FStartPos.Track].TrackType = ttData then
|
||||
raise EACSException.Create(strnoAudioTreck);
|
||||
OpenCD;
|
||||
FSize := GetSize;
|
||||
FBusy := True;
|
||||
BufStart := 1;
|
||||
BufEnd := 0;
|
||||
FPosition := 0;
|
||||
Sect1 := MSF2Frames(Toc2MSF(MSFAddr(FToc.tracks[FStartPos.Track].addr)));
|
||||
Sect1 := Sect1 + MSF2Frames(FStartPos.MSF);
|
||||
Sect2 := MSF2Frames(Toc2MSF(MSFAddr(FToc.tracks[FEndPos.Track].addr)));
|
||||
Sect2 := Sect2 + MSF2Frames(FEndPos.MSF);
|
||||
FRipEnd := Sect2;
|
||||
FRipStart := Sect1;
|
||||
SetLength(FBuffer,(BUF_SIZE * CD_FRAMESIZE_RAW)+TRACKBUFEXTRA);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.Flush;
|
||||
begin
|
||||
CloseCD;
|
||||
FBusy := False;
|
||||
Setlength(FBuffer,0);
|
||||
FBuffer := nil;
|
||||
FSize := 0;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
|
||||
var
|
||||
Abort : LongBool;
|
||||
fnum : Integer;
|
||||
begin
|
||||
if not Busy then raise EACSException.Create(strStreamnotOpen);
|
||||
if BufStart > BufEnd then //Buffer clear try to fill it
|
||||
begin
|
||||
BufStart := 1;
|
||||
Abort := False;
|
||||
if FRipEnd-FRipStart > BUF_SIZE then
|
||||
fNum := BUF_SIZE
|
||||
else
|
||||
fNum := FRipEnd-FRipStart;
|
||||
FiBuffer^.startFrame := FRipStart;
|
||||
FiBuffer^.numFrames := fNum;
|
||||
FiBuffer^.maxLen := FiBuffer^.numFrames * CD_FRAMESIZE_RAW;
|
||||
FiBuffer^.len := 0;
|
||||
FiBuffer^.status := 0;
|
||||
FiBuffer^.startOffset := 0;
|
||||
if ReadCDAudioLBA(FCDHandle,FiBuffer) = 1 then
|
||||
begin
|
||||
Inc(FRipStart,FiBuffer^.numFrames);
|
||||
BufEnd := FiBuffer^.len;
|
||||
end;
|
||||
end;
|
||||
if BufferSize < (BufEnd - BufStart + 1) then
|
||||
Result := BufferSize
|
||||
else
|
||||
Result := BufEnd - BufStart + 1;
|
||||
Move(FiBuffer^.buf[BufStart-1],Buffer^, Result);
|
||||
Inc(BufStart, Result);
|
||||
Inc(FPosition, Result);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.SetCurrentDrive;
|
||||
begin
|
||||
if Value in [0..FCDList.num-1] then
|
||||
FCurrentDrive := Value;
|
||||
OpenCD;
|
||||
FillChar(FToc, SizeOf(FToc),0);
|
||||
ModifyCDParms(FCDHandle, CDP_MSF, DWORD(true));
|
||||
ReadTOC(FCDHandle, FTOC);
|
||||
CloseCD;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetDrivesCount : Integer;
|
||||
begin
|
||||
Result := FCDList.num;
|
||||
end;
|
||||
|
||||
function TACSCDIn.GetDriveName : string;
|
||||
begin
|
||||
Result := FCDList.Cd[FCurrentDrive].id;
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.Eject;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
end;
|
||||
|
||||
procedure TACSCDIn.CloseTray;
|
||||
begin
|
||||
end;
|
||||
|
||||
constructor TACSCDIn.Create;
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
AppPath := ExtractFilePath(ParamStr(0));
|
||||
if AppPath[length(AppPath)] <> '\' then AppPath := AppPath + '\';
|
||||
CDRIPInit(AppPath);
|
||||
if not (csDesigning in ComponentState) then
|
||||
if not CDRipLoaded then
|
||||
raise EACSException.Create(akriplib + ' could not be loaded.');
|
||||
FillChar(FCDList, SizeOf(FCDList),0);
|
||||
FCDList.max := MAXCDLIST;
|
||||
GetCDList(FCDList);
|
||||
end;
|
||||
|
||||
destructor TACSCDIn.Destroy;
|
||||
begin
|
||||
if Busy then
|
||||
Flush;
|
||||
CloseCD;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
407
acs/Src/classes/windows/acs_mixer.inc
Normal file
407
acs/Src/classes/windows/acs_mixer.inc
Normal file
@@ -0,0 +1,407 @@
|
||||
{
|
||||
$Log: acs_mixer.inc,v $
|
||||
Revision 1.3 2006/07/04 17:12:45 z0m3ie
|
||||
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
|
||||
|
||||
Revision 1.1 2005/12/19 18:35:16 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.10 2005/08/31 20:30:40 z0m3ie
|
||||
Mixer Channelname work now
|
||||
minior corrections for Converters
|
||||
|
||||
Revision 1.9 2005/08/31 14:37:59 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.8 2005/08/30 22:10:55 z0m3ie
|
||||
Mixer mostly completed
|
||||
|
||||
Revision 1.7 2005/08/29 22:50:33 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.6 2005/08/29 21:46:43 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.5 2005/08/28 20:33:10 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.4 2005/08/28 18:35:53 z0m3ie
|
||||
created Delphi package for 2.4
|
||||
more Mixer stuff
|
||||
updated some things for Delphi
|
||||
|
||||
Revision 1.3 2005/08/26 17:12:56 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.2 2005/08/26 17:03:20 z0m3ie
|
||||
begon to make acs resourcestring aware
|
||||
more advanced tmixer for windows
|
||||
restructured tmixer its better handleable now
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
function mixerSetControlDetails(x1: HMIXEROBJ; x2: PMIXERCONTROLDETAILS; x3: DWORD): MMRESULT; stdcall;
|
||||
external 'winmm.dll' name
|
||||
'mixerSetControlDetails';
|
||||
|
||||
function GetChannelfromMask(Mask : DWORD) : TACSMixerChannel;
|
||||
begin
|
||||
case Mask of
|
||||
MIXERLINE_COMPONENTTYPE_DST_UNDEFINED : Result := mcUnknown;
|
||||
MIXERLINE_COMPONENTTYPE_DST_DIGITAL : Result := mcDigital;
|
||||
MIXERLINE_COMPONENTTYPE_DST_LINE : Result := mcLine;
|
||||
MIXERLINE_COMPONENTTYPE_DST_MONITOR : Result := mcMonitor;
|
||||
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS : Result := mcVolume;
|
||||
MIXERLINE_COMPONENTTYPE_DST_HEADPHONES : Result := mcHeadphone;
|
||||
MIXERLINE_COMPONENTTYPE_DST_TELEPHONE : Result := mcTelephone;
|
||||
MIXERLINE_COMPONENTTYPE_DST_WAVEIN : Result := mcPCM;
|
||||
MIXERLINE_COMPONENTTYPE_DST_VOICEIN : Result := mcUnknown;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED : Result := mcUnknown;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_DIGITAL : Result := mcDigital;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_LINE : Result := mcLine;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE : Result := mcMic;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER: Result := mcSynth;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC: Result := mcCD;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE : Result := mcTelephone;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER : Result := mcVolume;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT : Result := mcPCM;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY : Result := mcAltPCM;
|
||||
MIXERLINE_COMPONENTTYPE_SRC_ANALOG : Result := mcUnknown;
|
||||
else
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetDevNum(Num : Integer);
|
||||
type
|
||||
TData = array [0..3] of MIXERCONTROLDETAILS_UNSIGNED;
|
||||
PData = ^TData;
|
||||
var
|
||||
destination,
|
||||
connection : Integer;
|
||||
data : PData;
|
||||
pmxctrl : PMixerControl;
|
||||
s : String;
|
||||
aLineInfo,
|
||||
aConnLineInfo : TMixerLine;
|
||||
error : Integer;
|
||||
|
||||
procedure GetLineControls(mixLineInfo : TMixerLine);
|
||||
var
|
||||
j, k,
|
||||
datasize : Integer;
|
||||
aLineControl : TMixerLineControls;
|
||||
aControlDetails: TMixerControlDetails;
|
||||
amixControl : PMixerControl;
|
||||
aControl : PControlEntry;
|
||||
begin
|
||||
with aLineControl do
|
||||
begin
|
||||
cbStruct := SizeOf(TMixerLineControls);
|
||||
dwLineID := mixLineInfo.dwLineID;
|
||||
cControls := mixLineInfo.cControls;
|
||||
cbmxctrl := SizeOf(TMixerControl);
|
||||
GetMem(amixControl, SizeOf(TMixerControl) * mixLineInfo.cControls);
|
||||
pamxctrl := amixControl;
|
||||
end;
|
||||
error := mixerGetLineControls(Num, @aLineControl, MIXER_GETLINECONTROLSF_ALL);
|
||||
pmxctrl := amixControl;
|
||||
for j := 0 TO aLineControl.cControls -1 do
|
||||
begin
|
||||
if (pmxctrl^.dwControlType <> MIXERCONTROL_CONTROLTYPE_VOLUME)
|
||||
and (pmxctrl^.dwControlType <> MIXERCONTROL_CONTROLTYPE_MUTE) then
|
||||
continue;
|
||||
if (pmxctrl^.fdwControl and MIXERCONTROL_CONTROLF_UNIFORM) > 0 then
|
||||
aControlDetails.cChannels := 1
|
||||
else
|
||||
aControlDetails.cChannels := mixLineInfo.cChannels;
|
||||
if (pmxctrl^.fdwControl AND MIXERCONTROL_CONTROLF_MULTIPLE) > 0 then
|
||||
begin
|
||||
aControlDetails.cMultipleItems := pmxctrl^.cMultipleItems;
|
||||
Getmem(data,pmxctrl^.cMultipleItems * SizeOf(MIXERCONTROLDETAILS_UNSIGNED));
|
||||
datasize := pmxctrl^.cMultipleItems;
|
||||
end
|
||||
else
|
||||
begin
|
||||
aControlDetails.cMultipleItems := 0;
|
||||
Getmem(data, aControlDetails.cChannels * SizeOf(MIXERCONTROLDETAILS_UNSIGNED));
|
||||
datasize := aControlDetails.cChannels;
|
||||
end;
|
||||
with aControlDetails do
|
||||
begin
|
||||
cbStruct := sizeOf(TmixerControlDetails);
|
||||
dwControlID := pmxctrl^.dwControlID;
|
||||
cbDetails := SizeOf(MIXERCONTROLDETAILS_UNSIGNED);
|
||||
paDetails := data;
|
||||
end;
|
||||
error := mixerGetControlDetails(Num, @aControlDetails, MIXER_GETCONTROLDETAILSF_VALUE );
|
||||
if (pmxctrl^.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE) then
|
||||
begin
|
||||
setlength(FMuteControls,length(FControls)+1);
|
||||
aControl := @FMuteControls[length(FControls)-1];
|
||||
end
|
||||
else
|
||||
begin
|
||||
setlength(FControls,length(FControls)+1);
|
||||
aControl := @FControls[length(FControls)-1];
|
||||
end;
|
||||
setlength(FChannels,Max(length(FControls),length(FMuteControls)));
|
||||
with aControl^, pmxctrl^, aControlDetails do
|
||||
begin
|
||||
IsInited := True;
|
||||
CDestination := mixLineInfo.dwDestination;
|
||||
CName := String(szShortname);
|
||||
CComponentTyp := mixLineInfo.dwComponentType;
|
||||
CKanal := cChannels;
|
||||
CID := dwControlID;
|
||||
CConnect := mixLineInfo.cConnections;
|
||||
CCControls := mixLineInfo.cControls;
|
||||
CControl := fdwControl;
|
||||
CControlTyp := dwControlType;
|
||||
CMultItems := cMultipleItems;
|
||||
CMax := Bounds.lMaximum;
|
||||
CMin := Bounds.lMinimum;
|
||||
CcSteps := Metrics.cSteps;
|
||||
for k := 0 to datasize -1 do
|
||||
CDetails[k].dwValue := data^[k].dwvalue;
|
||||
end;
|
||||
FChannels[length(FControls)-1] := GetChannelfromMask(aControl.CComponentTyp);
|
||||
Freemem(data);
|
||||
inc(pmxctrl);
|
||||
end;
|
||||
Freemem(amixControl);
|
||||
end;
|
||||
|
||||
begin
|
||||
if Num in [0..MixersCount - 1] then // check [0..0] [0..-1]
|
||||
begin
|
||||
setlength(FChannels,0);
|
||||
setlength(FControls,0);
|
||||
setlength(FMuteControls,0);
|
||||
error := mixerGetDevCaps(Num, @FMixerCaps, sizeof(TMixerCaps));
|
||||
FMixer := Num;
|
||||
FMixerName := StrPas(FMixerCaps.szPName);
|
||||
error := mixerOpen(@Num, 0, 0, 0, MIXER_OBJECTF_MIXER);
|
||||
if error = MMSYSERR_NOERROR then
|
||||
begin
|
||||
for destination := 0 to FMixerCaps.cDestinations - 1 do
|
||||
begin
|
||||
aLineInfo.cbStruct := SizeOf(TMixerLine);
|
||||
aLineInfo.dwDestination := destination;
|
||||
error := mixerGetLineInfo(Num, @aLineInfo, MIXER_GETLINEINFOF_DESTINATION);
|
||||
if aLineInfo.dwComponentType <> MIXERLINE_COMPONENTTYPE_DST_SPEAKERS then
|
||||
continue;
|
||||
GetLineControls(aLineInfo);
|
||||
for connection := 0 TO aLineInfo.cConnections-1 do
|
||||
begin
|
||||
with aConnLineInfo do
|
||||
begin
|
||||
cbStruct := SizeOf(TMixerLine);
|
||||
dwDestination := destination;
|
||||
dwSource := connection;
|
||||
end;
|
||||
error := mixerGetLineInfo(Num, @aConnLineInfo, MIXER_GETLINEINFOF_SOURCE);
|
||||
GetLineControls(aConnLineInfo);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TACSMixer.GetVolume(vChannel : Integer) : TACSMixerLevel;
|
||||
type
|
||||
TData = array [0..3] of MIXERCONTROLDETAILS_UNSIGNED;
|
||||
PData = ^TData;
|
||||
var
|
||||
data : PData;
|
||||
aControldetails : TMixerControlDetails;
|
||||
datasize,k : Integer;
|
||||
begin
|
||||
if vChannel >= length(FControls) then
|
||||
exit;
|
||||
if FControls[vChannel].IsInited = False then
|
||||
exit;
|
||||
if (FControls[vChannel].CControl and MIXERCONTROL_CONTROLF_UNIFORM) > 0 then
|
||||
aControlDetails.cChannels := 1
|
||||
else
|
||||
aControlDetails.cChannels := FControls[vChannel].CKanal;
|
||||
if (FControls[vChannel].CControl AND MIXERCONTROL_CONTROLF_MULTIPLE) > 0 then
|
||||
begin
|
||||
aControlDetails.cMultipleItems := FControls[vChannel].CMultItems;
|
||||
Getmem(data, FControls[vChannel].CMultItems * SizeOf(MIXERCONTROLDETAILS_UNSIGNED));
|
||||
datasize := FControls[vChannel].CMultItems;
|
||||
end
|
||||
else
|
||||
begin
|
||||
aControlDetails.cMultipleItems := 0;
|
||||
Getmem(data, aControlDetails.cChannels * SizeOf(MIXERCONTROLDETAILS_UNSIGNED));
|
||||
datasize := aControlDetails.cChannels;
|
||||
end;
|
||||
with aControlDetails do
|
||||
begin
|
||||
cbStruct := SizeOf(TMixerControlDetails);
|
||||
dwControlID := FControls[vChannel].CID;
|
||||
cChannels := FControls[vChannel].CKanal;
|
||||
cMultipleItems := FControls[vChannel].CMultItems;
|
||||
cbDetails := sizeof(MIXERCONTROLDETAILS_Signed);
|
||||
padetails := data;
|
||||
end;
|
||||
mixerGetControlDetails(FMixer, @aControlDetails,MIXER_GETCONTROLDETAILSF_VALUE );
|
||||
with FControls[vChannel] do
|
||||
begin
|
||||
for k := 0 to datasize -1 do
|
||||
CDetails[k].dwValue := data^[k].dwvalue;
|
||||
end;
|
||||
Freemem(data);
|
||||
if IsStereo(vChannel) then
|
||||
begin
|
||||
Result.Left := round((FControls[vChannel].CDetails[0].dwValue*255)/FControls[vChannel].Cmax);
|
||||
Result.Right := round((FControls[vChannel].CDetails[1].dwValue*255)/FControls[vChannel].Cmax);
|
||||
end
|
||||
else
|
||||
Result.Main := round((FControls[vChannel].CDetails[0].dwValue*255)/FControls[vChannel].Cmax);
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetVolume(vChannel : Integer; vLevel : TACSMixerLevel);
|
||||
var
|
||||
aControlDetails : TMixerControlDetails;
|
||||
begin
|
||||
if vChannel >= length(FControls) then
|
||||
exit;
|
||||
if IsStereo(vChannel) then
|
||||
begin
|
||||
FControls[vChannel].CDetails[0].dwValue := round((vLevel.Left*FControls[vChannel].CMax)/255);
|
||||
FControls[vChannel].CDetails[1].dwValue := round((vLevel.Right*FControls[vChannel].CMax)/255);
|
||||
end
|
||||
else
|
||||
FControls[vChannel].CDetails[0].dwValue := round((vLevel.Main*FControls[vChannel].CMax)/255);
|
||||
with aControlDetails do
|
||||
begin
|
||||
cbStruct := SizeOf(TMixerControlDetails);
|
||||
dwControlID := FControls[vChannel].CID;
|
||||
cChannels := FControls[vChannel].CKanal;
|
||||
cMultipleItems := 0;
|
||||
cbDetails := sizeof(MIXERCONTROLDETAILS_Signed);
|
||||
padetails := @FControls[vChannel].CDetails;
|
||||
end;
|
||||
mixerSetControlDetails(FMixer, @aControlDetails,MIXER_SETCONTROLDETAILSF_Value);
|
||||
end;
|
||||
|
||||
function TACSMixer.IsStereo(vChannel : Integer) : Boolean;
|
||||
begin
|
||||
if vChannel >= length(FControls) then
|
||||
exit;
|
||||
Result := not (FControls[vChannel].CKanal = 1);
|
||||
end;
|
||||
|
||||
function TACSMixer.GetMute(vChannel : integer) : Boolean;
|
||||
type
|
||||
TData = array [0..3] of MIXERCONTROLDETAILS_UNSIGNED;
|
||||
PData = ^TData;
|
||||
var
|
||||
data : PData;
|
||||
aControldetails : TMixerControlDetails;
|
||||
datasize,k : Integer;
|
||||
begin
|
||||
if vChannel >= length(FMuteControls) then
|
||||
exit;
|
||||
if FMuteControls[vChannel].IsInited = False then
|
||||
exit;
|
||||
if (FMuteControls[vChannel].CControl and MIXERCONTROL_CONTROLF_UNIFORM) > 0 then
|
||||
aControlDetails.cChannels := 1
|
||||
else
|
||||
aControlDetails.cChannels := FMuteControls[vChannel].CKanal;
|
||||
if (FMuteControls[vChannel].CControl AND MIXERCONTROL_CONTROLF_MULTIPLE) > 0 then
|
||||
begin
|
||||
aControlDetails.cMultipleItems := FMuteControls[vChannel].CMultItems;
|
||||
Getmem(data, FMuteControls[vChannel].CMultItems * SizeOf(MIXERCONTROLDETAILS_UNSIGNED));
|
||||
datasize := FMuteControls[vChannel].CMultItems;
|
||||
end
|
||||
else
|
||||
begin
|
||||
aControlDetails.cMultipleItems := 0;
|
||||
Getmem(data, aControlDetails.cChannels * SizeOf(MIXERCONTROLDETAILS_UNSIGNED));
|
||||
datasize := aControlDetails.cChannels;
|
||||
end;
|
||||
with aControlDetails do
|
||||
begin
|
||||
cbStruct := SizeOf(TMixerControlDetails);
|
||||
dwControlID := FMuteControls[vChannel].CID;
|
||||
cChannels := FMuteControls[vChannel].CKanal;
|
||||
cMultipleItems := FMuteControls[vChannel].CMultItems;
|
||||
cbDetails := sizeof(MIXERCONTROLDETAILS_Signed);
|
||||
padetails := data;
|
||||
end;
|
||||
mixerGetControlDetails(FMixer, @aControlDetails,MIXER_GETCONTROLDETAILSF_VALUE );
|
||||
with FMuteControls[vChannel] do
|
||||
begin
|
||||
for k := 0 to datasize -1 do
|
||||
CDetails[k].dwValue := data^[k].dwvalue;
|
||||
end;
|
||||
Freemem(data);
|
||||
Result := (FMuteControls[vChannel].CDetails[0].dwValue = 1);
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetMute(vChannel : integer; Mute : Boolean);
|
||||
var
|
||||
aControlDetails : TMixerControlDetails;
|
||||
begin
|
||||
if vChannel >= length(FMuteControls) then
|
||||
exit;
|
||||
if FMuteControls[vChannel].IsInited = False then
|
||||
exit;
|
||||
if Mute then
|
||||
FMuteControls[vChannel].CDetails[0].dwValue := 1
|
||||
else
|
||||
FMuteControls[vChannel].CDetails[0].dwValue := 0;
|
||||
with aControlDetails do
|
||||
begin
|
||||
cbStruct := SizeOf(TMixerControlDetails);
|
||||
dwControlID := FMuteControls[vChannel].CID;
|
||||
cChannels := FMuteControls[vChannel].CKanal;
|
||||
cMultipleItems := 0;
|
||||
cbDetails := sizeof(MIXERCONTROLDETAILS_Signed);
|
||||
padetails := @FMuteControls[vChannel].CDetails;
|
||||
end;
|
||||
mixerSetControlDetails(FMixer, @aControlDetails,MIXER_SETCONTROLDETAILSF_Value);
|
||||
end;
|
||||
|
||||
function TACSMixer.IsRecordable(vChannel : Integer) : Boolean;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TACSMixer.SetRecSource(vChannel : Integer);
|
||||
begin
|
||||
end;
|
||||
|
||||
function TACSMixer.GetRecSource : Integer;
|
||||
begin
|
||||
end;
|
||||
|
||||
destructor TACSMixer.Destroy;
|
||||
begin
|
||||
Setlength(FControls,0);
|
||||
Setlength(FMuteControls,0);
|
||||
Setlength(FChannels,0);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function CountMixers : Byte;
|
||||
begin
|
||||
Result := mixerGetNumDevs;
|
||||
end;
|
||||
|
332
acs/Src/classes/windows/akrip32.pas
Normal file
332
acs/Src/classes/windows/akrip32.pas
Normal file
@@ -0,0 +1,332 @@
|
||||
unit akrip32;
|
||||
{*
|
||||
* akrip32.h - copyright (c) 1999 jay a. key
|
||||
*
|
||||
* api for akrip32.dll (v0.93)
|
||||
*
|
||||
* modified for acs (dynamic loading ...) y christian ulrich (mail@z0m3ie.de)
|
||||
* translated for borland delphi by holger dors (holger@dors.de)
|
||||
*
|
||||
* history of delphi version:
|
||||
*
|
||||
* 09. january 2000: first released version
|
||||
* 05. February 2000: Updated for new function "CDDBGetServerList"
|
||||
* in V.093 of akrip32.dll
|
||||
*
|
||||
**********************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*}
|
||||
|
||||
interface
|
||||
|
||||
uses windows;
|
||||
|
||||
const
|
||||
|
||||
TRACK_AUDIO = $00;
|
||||
TRACK_DATA = $01;
|
||||
|
||||
MAXIDLEN = 64;
|
||||
MAXCDLIST = 8;
|
||||
|
||||
{*
|
||||
* TRACKBUF
|
||||
*
|
||||
* This structure should not be allocated directly. If a buffer containing
|
||||
* 27 * 2353 bytes is desired, a buffer should be allocated containing
|
||||
* the desired amount + 24 bytes. The allocated memory can then be
|
||||
* typecast to a LPTRACKBUF. It is the program's responsibility to guard
|
||||
* against reading/writing past the end of allocated memory.
|
||||
*
|
||||
* The following must always apply:
|
||||
* (len + startOffset) <= (numFrames * 2352) <= maxLen
|
||||
*}
|
||||
|
||||
type
|
||||
PTRACKBUF = ^TRACKBUF;
|
||||
TRACKBUF = record
|
||||
startFrame: DWord; {* 00: starting frame number *}
|
||||
numFrames: DWord; {* 04: number of frames read *}
|
||||
maxLen: DWord; {* 08: length of buffer itself *}
|
||||
len: DWord; {* 0C: length of data actually in buf *}
|
||||
status: DWord; {* 10: status of last read operation *}
|
||||
startOffset: Integer; {* 14: offset of valid data in buf *}
|
||||
buf: array[0..1024 * 1024 - 1] of Byte; {* 18: the data itself *}
|
||||
end;
|
||||
|
||||
TRACKBUFDUMMY = record
|
||||
startFrame: DWord; {* 00: starting frame number *}
|
||||
numFrames: DWord; {* 04: number of frames read *}
|
||||
maxLen: DWord; {* 08: length of buffer itself *}
|
||||
len: DWord; {* 0C: length of data actually in buf *}
|
||||
status: DWord; {* 10: status of last read operation *}
|
||||
startOffset: Integer; {* 14: offset of valid data in buf *}
|
||||
end;
|
||||
|
||||
const
|
||||
TRACKBUFEXTRA = SizeOf(TRACKBUFDUMMY);
|
||||
|
||||
type
|
||||
PCDINFO = ^CDINFO;
|
||||
CDINFO = record
|
||||
vendor: array[0..8] of Char;
|
||||
prodId: array[0..16] of Char;
|
||||
rev: array[0..4] of Char;
|
||||
vendSpec: array[0..20] of Char;
|
||||
end;
|
||||
|
||||
PCDREC = ^CDREC;
|
||||
CDREC = record
|
||||
ha: Byte;
|
||||
tgt: Byte;
|
||||
lun: Byte;
|
||||
pad: Byte;
|
||||
id: array[0..MAXIDLEN] of Char;
|
||||
info: CDINFO;
|
||||
end;
|
||||
|
||||
PCDLIST = ^CDLIST;
|
||||
CDLIST = record
|
||||
max: Byte;
|
||||
num: Byte;
|
||||
cd: array[0..MAXCDLIST - 1] of CDREC;
|
||||
end;
|
||||
|
||||
{*
|
||||
* TOCTRACK and TOC must be byte-aligned. If you're not using Mingw32,
|
||||
* CygWin, or some other compiler that understands the PACKED keyword,
|
||||
* you need to ensure that these structures are byte aligned. Usually,
|
||||
* this is done using a
|
||||
* #pragma pack(1)
|
||||
* See your compiler's documentation for details
|
||||
*}
|
||||
|
||||
TOCTRACK = packed record
|
||||
rsvd: Byte;
|
||||
ADR: Byte;
|
||||
trackNumber: Byte;
|
||||
rsvd2: Byte;
|
||||
addr: array[0..3] of Byte;
|
||||
end;
|
||||
|
||||
PTOC = ^TOC;
|
||||
TOC = packed record
|
||||
tocLen: Word;
|
||||
firstTrack: Byte;
|
||||
lastTrack: Byte;
|
||||
tracks: array[0..99] of TOCTRACK;
|
||||
end;
|
||||
|
||||
PTRACK = ^TRACK;
|
||||
TRACK = packed record
|
||||
trackNo: Integer;
|
||||
startLBA: DWord;
|
||||
trackLen: DWord;
|
||||
_type: Byte;
|
||||
pad: array[0..3] of Byte;
|
||||
name: ShortString;//array[0..255] of Char;
|
||||
end;
|
||||
|
||||
PREADMSF = ^READMSF;
|
||||
READMSF = record
|
||||
sm: Byte;
|
||||
ss: Byte;
|
||||
sf: Byte;
|
||||
em: Byte;
|
||||
es: Byte;
|
||||
ef: Byte;
|
||||
end;
|
||||
|
||||
const
|
||||
{*
|
||||
* Error codes set by functions in ASPILIB.C
|
||||
*}
|
||||
|
||||
ALERR_NOERROR = 0;
|
||||
ALERR_NOWNASPI = 1;
|
||||
ALERR_NOGETASPI32SUPP = 2;
|
||||
ALERR_NOSENDASPICMD = 3;
|
||||
ALERR_ASPI = 4;
|
||||
ALERR_NOCDSELECTED = 5;
|
||||
ALERR_BUFTOOSMALL = 6;
|
||||
ALERR_INVHANDLE = 7;
|
||||
ALERR_NOMOREHAND = 8;
|
||||
ALERR_BUFPTR = 9;
|
||||
ALERR_NOTACD = 10;
|
||||
ALERR_LOCK = 11;
|
||||
ALERR_DUPHAND = 12;
|
||||
ALERR_INVPTR = 13;
|
||||
ALERR_INVPARM = 14;
|
||||
ALERR_JITTER = 15;
|
||||
|
||||
{*
|
||||
* constants used for queryCDParms()
|
||||
*}
|
||||
|
||||
CDP_READCDR = $0001; // can read CD-R
|
||||
CDP_READCDE = $0002; // can read CD-E
|
||||
CDP_METHOD2 = $0003; // can read CD-R wriiten via method 2
|
||||
CDP_WRITECDR = $0004; // can write CD-R
|
||||
CDP_WRITECDE = $0005; // can write CD-E
|
||||
CDP_AUDIOPLAY = $0006; // can play audio
|
||||
CDP_COMPOSITE = $0007; // composite audio/video stream
|
||||
CDP_DIGITAL1 = $0008; // digital output (IEC958) on port 1
|
||||
CDP_DIGITAL2 = $0009; // digital output (IEC958) on port 2
|
||||
CDP_M2FORM1 = $000A; // reads Mode 2 Form 1 (XA) format
|
||||
CDP_M2FORM2 = $000B; // reads Mode 2 Form 2 format
|
||||
CDP_MULTISES = $000C; // reads multi-session or Photo-CD
|
||||
CDP_CDDA = $000D; // supports cd-da
|
||||
CDP_STREAMACC = $000E; // supports "stream is accurate"
|
||||
CDP_RW = $000F; // can return R-W info
|
||||
CDP_RWCORR = $0010; // returns R-W de-interleaved and err.
|
||||
// corrected
|
||||
CDP_C2SUPP = $0011; // C2 error pointers
|
||||
CDP_ISRC = $0012; // can return the ISRC info
|
||||
CDP_UPC = $0013; // can return the Media Catalog Number
|
||||
CDP_CANLOCK = $0014; // prevent/allow cmd. can lock the media
|
||||
CDP_LOCKED = $0015; // current lock state (TRUE = LOCKED)
|
||||
CDP_PREVJUMP = $0016; // prevent/allow jumper state
|
||||
CDP_CANEJECT = $0017; // drive can eject disk
|
||||
CDP_MECHTYPE = $0018; // type of disk loading supported
|
||||
CDP_SEPVOL = $0019; // independent audio level for channels
|
||||
CDP_SEPMUTE = $001A; // independent mute for channels
|
||||
CDP_SDP = $001B; // supports disk present (SDP)
|
||||
CDP_SSS = $001C; // Software Slot Selection
|
||||
CDP_MAXSPEED = $001D; // maximum supported speed of drive
|
||||
CDP_NUMVOL = $001E; // number of volume levels
|
||||
CDP_BUFSIZE = $001F; // size of output buffer
|
||||
CDP_CURRSPEED = $0020; // current speed of drive
|
||||
CDP_SPM = $0021; // "S" units per "M" (MSF format)
|
||||
CDP_FPS = $0022; // "F" units per "S" (MSF format)
|
||||
CDP_INACTMULT = $0023; // inactivity multiplier ( x 125 ms)
|
||||
CDP_MSF = $0024; // use MSF format for READ TOC cmd
|
||||
CDP_OVERLAP = $0025; // number of overlap frames for jitter
|
||||
CDP_JITTER = $0026; // number of frames to check for jitter
|
||||
CDP_READMODE = $0027; // mode to attempt jitter corr.
|
||||
|
||||
{*
|
||||
* defines for GETCDHAND readType
|
||||
*
|
||||
*}
|
||||
CDR_ANY = $00; // unknown
|
||||
CDR_ATAPI1 = $01; // ATAPI per spec
|
||||
CDR_ATAPI2 = $02; // alternate ATAPI
|
||||
CDR_READ6 = $03; // using SCSI READ(6)
|
||||
CDR_READ10 = $04; // using SCSI READ(10)
|
||||
CDR_READ_D8 = $05; // using command 0xD8 (Plextor?)
|
||||
CDR_READ_D4 = $06; // using command 0xD4 (NEC?)
|
||||
CDR_READ_D4_1 = $07; // 0xD4 with a mode select
|
||||
CDR_READ10_2 = $08; // different mode select w/ READ(10)
|
||||
|
||||
{*
|
||||
* defines for the read mode (CDP_READMODE)
|
||||
*}
|
||||
CDRM_NOJITTER = $00; // never jitter correct
|
||||
CDRM_JITTER = $01; // always jitter correct
|
||||
CDRM_JITTERONERR = $02; // jitter correct only after a read error
|
||||
|
||||
type
|
||||
HCDROM = THandle;
|
||||
|
||||
PGETCDHAND = ^GETCDHAND;
|
||||
GETCDHAND = packed record
|
||||
size: Byte; {* set to sizeof(GETCDHAND) *}
|
||||
ver: Byte; {* set to AKRIPVER *}
|
||||
ha: Byte; {* host adapter *}
|
||||
tgt: Byte; {* target id *}
|
||||
lun: Byte; {* LUN *}
|
||||
readType: Byte; {* read function to use *}
|
||||
jitterCorr: Bool; {* use built-in jitter correction? *}
|
||||
numJitter: Byte; {* number of frames to try to match *}
|
||||
numOverlap: Byte; {* number of frames to overlap *}
|
||||
end;
|
||||
|
||||
const
|
||||
akriplib = 'akrip32.dll';
|
||||
|
||||
var
|
||||
LibHandle : Integer;
|
||||
CDRipLoaded : Boolean;
|
||||
|
||||
type
|
||||
GetNumAdapters_t = function : Integer; cdecl;
|
||||
GetCDList_t = function (var cd: CDLIST): Integer; cdecl;
|
||||
GetAspiLibError_t = function : Integer; cdecl;
|
||||
GetAspiLibAspiError_t = function : Byte; cdecl;
|
||||
|
||||
GetCDId_t = function (hCD: HCDROM; buf: PChar; maxBuf: Integer): DWord; cdecl;
|
||||
GetDriveInfo_t = function (ha, tgt, lun: byte; var cdrec: CDREC): DWord; cdecl;
|
||||
ReadTOC_t = function (hCD: HCDROM; var MyToc: TOC): DWord; cdecl;
|
||||
ReadCDAudioLBA_t = function (hCD: HCDROM; TrackBuf: PTRACKBUF): DWord; cdecl;
|
||||
QueryCDParms_t = function (hCD: HCDROM; which: Integer; var Num: DWord): Bool; cdecl;
|
||||
ModifyCDParms_t = function (hCD: HCDROM; which: Integer; val: DWord): Bool; cdecl;
|
||||
GetCDHandle_t = function (var cd: GETCDHAND): HCDROM; cdecl;
|
||||
CloseCDHandle_t = function (hCD: HCDROM): Bool; cdecl;
|
||||
ReadCDAudioLBAEx_t = function (hCD: HCDROM; TrackBuf, Overlap: PTRACKBUF): DWord; cdecl;
|
||||
|
||||
var
|
||||
GetNumAdapters : GetNumAdapters_t;
|
||||
GetCDList : GetCDList_t;
|
||||
GetAspiLibError : GetAspiLibError_t;
|
||||
GetAspiLibAspiError : GetAspiLibAspiError_t;
|
||||
|
||||
GetCDId : GetCDId_t;
|
||||
GetDriveInfo : GetDriveInfo_t;
|
||||
ReadTOC : ReadTOC_t;
|
||||
ReadCDAudioLBA : ReadCDAudioLBA_t;
|
||||
QueryCDParms : QueryCDParms_t;
|
||||
ModifyCDParms : ModifyCDParms_t;
|
||||
GetCDHandle : GetCDHandle_t;
|
||||
CloseCDHandle : CloseCDHandle_t;
|
||||
ReadCDAudioLBAEx : ReadCDAudioLBAEx_t;
|
||||
|
||||
procedure CDRIPInit(FilePath:String);
|
||||
|
||||
implementation
|
||||
|
||||
procedure CDRIPInit(FilePath:String);
|
||||
begin
|
||||
Libhandle := LoadLibraryEx(akriplib, 0, 0);
|
||||
if Libhandle <> 0 then
|
||||
begin
|
||||
CDRipLoaded := True;
|
||||
GetNumAdapters := GetProcAddress(Libhandle, 'GetNumAdapters');
|
||||
GetCDList := GetProcAddress(Libhandle, 'GetCDList');
|
||||
GetAspiLibError := GetProcAddress(Libhandle, 'GetAspiLibError');
|
||||
GetAspiLibAspiError := GetProcAddress(Libhandle, 'GetAspiLibAspiError');
|
||||
GetCDId := GetProcAddress(Libhandle, 'GetCDId');
|
||||
GetDriveInfo := GetProcAddress(Libhandle, 'GetCDDriveInfo');
|
||||
ReadTOC := GetProcAddress(Libhandle, 'ReadTOC');
|
||||
ReadCDAudioLBA := GetProcAddress(Libhandle, 'ReadCDAudioLBA');
|
||||
QueryCDParms := GetProcAddress(Libhandle, 'QueryCDParams');
|
||||
ModifyCDParms := GetProcAddress(Libhandle, 'ModifyCDParms');
|
||||
GetCDHandle := GetProcAddress(Libhandle, 'GetCDHandle');
|
||||
CloseCDHandle := GetProcAddress(Libhandle, 'CloseCDHandle');
|
||||
ReadCDAudioLBAEx := GetProcAddress(Libhandle, 'ReadCDAudioLBAEx');
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
finalization
|
||||
if Libhandle <> 0 then
|
||||
begin
|
||||
FreeLibrary(Libhandle);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user