Стартовый пул
This commit is contained in:
266
acs/Src/drivers/linux/acs_audio.inc
Normal file
266
acs/Src/drivers/linux/acs_audio.inc
Normal file
@@ -0,0 +1,266 @@
|
||||
{
|
||||
$Log
|
||||
}
|
||||
|
||||
const
|
||||
MAX_CHANNELS = 16; // Maximum number of audio channels/devices
|
||||
O_RDONLY = 0;
|
||||
O_WRONLY = 1;
|
||||
libname = 'libc.so.6';
|
||||
|
||||
var
|
||||
AudioChannels : array[0..MAX_CHANNELS-1] of String;
|
||||
|
||||
(* We import libc functions directly to avoid Kylix
|
||||
Libc unit limitations *)
|
||||
|
||||
function __write(fd : Integer; data : Pointer; size : Integer): Integer; cdecl; external libname;
|
||||
function __read(Handle: Integer; var Buffer; Count: Integer): Integer; cdecl; external libname;
|
||||
function ioctl(fd : Integer; command : Integer): Integer; varargs; cdecl; external libname;
|
||||
function open(PathName: PChar; Flags: Integer): Integer; varargs; cdecl; external libname;
|
||||
function __close(Handle: Integer): Integer; cdecl; external libname;
|
||||
|
||||
|
||||
function GetAudioDeviceInfo(DevID : Integer; OutputDev : Boolean) : TACSDeviceInfo;
|
||||
begin
|
||||
Result.DeviceName := '/dev/dsp'+IntToStr(DevID);
|
||||
Result.DrvVersion := 0;
|
||||
Result.Formats := [];
|
||||
Result.Stereo := True;
|
||||
end;
|
||||
|
||||
procedure TStdAudioOut.SetDevice;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
if Ch < OutputChannelsCount then FBaseChannel := Ch
|
||||
else raise EACSException.Create(Format(strChannelnotavailable,[ch]));
|
||||
end;
|
||||
|
||||
procedure TStdAudioOut.Prepare;
|
||||
var
|
||||
parm : Integer;
|
||||
begin
|
||||
GetMem(FBuffer,FBufferSize);
|
||||
// No exceptions here!
|
||||
FInput.Init;
|
||||
case FInput.BitsPerSample of
|
||||
8 : parm := AFMT_U8;
|
||||
16 : parm := AFMT_S16_LE;
|
||||
end;
|
||||
_audio_fd := open(PChar(AudioChannels[FBaseChannel]), O_WRONLY);
|
||||
ioctl(_audio_fd, SNDCTL_DSP_SETFMT, @parm);
|
||||
parm := FInput.Channels;
|
||||
ioctl(_audio_fd, SNDCTL_DSP_CHANNELS, @parm);
|
||||
parm := FInput.SampleRate;
|
||||
ioctl(_audio_fd, SNDCTL_DSP_SPEED, @parm);
|
||||
end;
|
||||
|
||||
procedure TStdAudioOut.Done;
|
||||
begin
|
||||
//TODO:why this raises an exception ?? FreeMem(FBuffer);
|
||||
__close(_audio_fd);
|
||||
_audio_fd := -1;
|
||||
FInput.Flush;
|
||||
end;
|
||||
|
||||
function TStdAudioOut.DoOutput;
|
||||
var
|
||||
Len, i, VCoef : Integer;
|
||||
P : Pointer;
|
||||
P1 : PACSBuffer8;
|
||||
P2 : PACSBuffer16;
|
||||
begin
|
||||
// No exceptions Here
|
||||
Result := True;
|
||||
if not CanOutput then Exit;
|
||||
Len := 0;
|
||||
if Abort then
|
||||
begin
|
||||
__close(_audio_fd);
|
||||
Result := False;
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
P := @FBuffer[0];
|
||||
while InputLock do;
|
||||
InputLock := True;
|
||||
Len := Finput.GetData(P, FBufferSize);
|
||||
InputLock := False;
|
||||
if FVolume < 255 then
|
||||
begin
|
||||
VCoef := Round(FVolume/255);
|
||||
if FInput.BitsPerSample = 16 then
|
||||
begin
|
||||
P2 := @FBuffer[0];
|
||||
for i := 0 to (Len shr 1) -1 do
|
||||
P2[i] := P2[i]*VCoef;
|
||||
end else
|
||||
begin
|
||||
P1 := @FBuffer[0];
|
||||
for i := 0 to Len - 1 do
|
||||
P1[i] := P1[i]*VCoef;
|
||||
end;
|
||||
end;
|
||||
__write(_audio_fd, P, Len);
|
||||
except
|
||||
end;
|
||||
if Len > 0 then Result := True
|
||||
else Result := False;
|
||||
end;
|
||||
|
||||
constructor TStdAudioOut.Create;
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FVolume := 255;
|
||||
FBufferSize := $8000;
|
||||
_audio_fd := -1;
|
||||
end;
|
||||
|
||||
destructor TStdAudioOut.Destroy;
|
||||
begin
|
||||
if _audio_fd > 0 then __close(_audio_fd);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
destructor TStdAudioIn.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
__close(_audio_fd);
|
||||
end;
|
||||
|
||||
procedure TStdAudioIn.OpenAudio;
|
||||
begin
|
||||
if FOpened = 0 then
|
||||
_audio_fd := open(PChar(AudioChannels[FBaseChannel]), O_RDONLY);
|
||||
Inc(FOpened);
|
||||
end;
|
||||
|
||||
procedure TStdAudioIn.CloseAudio;
|
||||
begin
|
||||
if FOpened = 1 then __close(_audio_fd);
|
||||
if FOpened > 0 then Dec(FOpened);
|
||||
end;
|
||||
|
||||
function TStdAudioIn.GetBPS;
|
||||
var
|
||||
BPS : Integer;
|
||||
begin
|
||||
OpenAudio;
|
||||
BPS := FBPS;
|
||||
if (BPS in [8, 16]) = False then BPS := 16;
|
||||
ioctl(_audio_fd, SNDCTL_DSP_SETFMT, @BPS);
|
||||
FBPS := BPS;
|
||||
Result := BPS;
|
||||
CloseAudio;
|
||||
end;
|
||||
|
||||
function TStdAudioIn.GetCh;
|
||||
var
|
||||
Ch : Integer;
|
||||
begin
|
||||
OpenAudio;
|
||||
Ch := FChan;
|
||||
ioctl(_audio_fd, SNDCTL_DSP_CHANNELS, @Ch);
|
||||
FChan := Ch;
|
||||
Result := Ch;
|
||||
CloseAudio;
|
||||
end;
|
||||
|
||||
function TStdAudioIn.GetSR;
|
||||
var
|
||||
SR : Integer;
|
||||
begin
|
||||
OpenAudio;
|
||||
SR := FFreq;
|
||||
ioctl(_audio_fd, SNDCTL_DSP_SPEED, @SR);
|
||||
FFreq := SR;
|
||||
Result := SR;
|
||||
CloseAudio;
|
||||
end;
|
||||
|
||||
procedure TStdAudioIn.Init;
|
||||
begin
|
||||
if Busy then raise EACSException.Create(strBusy);
|
||||
BufEnd := 0;
|
||||
BufStart := 1;
|
||||
FPosition := 0;
|
||||
BufferSize := $8000;
|
||||
OpenAudio;
|
||||
FRecBytes := FRecTime * (GetBPS div 8) * GetCh * GetSR;
|
||||
FBusy := True;
|
||||
FSize := FRecBytes;
|
||||
end;
|
||||
|
||||
procedure TStdAudioIn.Flush;
|
||||
begin
|
||||
CloseAudio;
|
||||
FBusy := False;
|
||||
end;
|
||||
|
||||
procedure TStdAudioIn.SetDevice;
|
||||
begin
|
||||
if Ch > (OutputChannelsCount - 1) then
|
||||
if not (csDesigning in ComponentState) then
|
||||
raise EACSException.Create(Format(strChannelnotavailable,[Ch]));
|
||||
FBaseChannel := Ch;
|
||||
end;
|
||||
|
||||
function TStdAudioIn.GetData;
|
||||
var
|
||||
l : Integer;
|
||||
begin
|
||||
if not Busy then raise EACSException.Create(strStreamnotOpen);
|
||||
if FRecBytes >= 0 then
|
||||
if FPosition >= FRecBytes then
|
||||
begin
|
||||
Result := 0;
|
||||
Exit;
|
||||
end;
|
||||
if BufStart > BufEnd then
|
||||
begin
|
||||
BufStart := 1;
|
||||
l := __read(_audio_fd, FBuffer[BufStart], BufferSize);
|
||||
if l < 1 then
|
||||
begin
|
||||
Result := 0;
|
||||
Exit;
|
||||
end
|
||||
else BufEnd := l;
|
||||
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 CountChannels;
|
||||
var
|
||||
i, fd : Integer;
|
||||
fname : String;
|
||||
begin
|
||||
OutputChannelsCount := 0;
|
||||
fname := '/dev/dsp0';
|
||||
fd := open(PChar(fname), O_RDONLY);
|
||||
if fd < 0 then
|
||||
begin
|
||||
// Under ALSA there is no /dev/dsp0 device
|
||||
fname := '/dev/dsp';
|
||||
fd := open(PChar(fname), O_RDONLY);
|
||||
if fd < 0 then Exit;
|
||||
end;
|
||||
AudioChannels[OutputChannelsCount] := fname;
|
||||
__close(fd);
|
||||
Inc(OutputChannelsCount);
|
||||
for i := 1 to MAX_CHANNELS - 2 do
|
||||
begin
|
||||
fname := '/dev/dsp' + IntToStr(i);
|
||||
fd := open(PChar(fname), O_RDONLY);
|
||||
if fd < 0 then Break;
|
||||
__close(fd);
|
||||
AudioChannels[OutputChannelsCount] := fname;
|
||||
Inc(OutputChannelsCount);
|
||||
end;
|
||||
end;
|
||||
|
907
acs/Src/drivers/linux/alsa.pas
Normal file
907
acs/Src/drivers/linux/alsa.pas
Normal file
@@ -0,0 +1,907 @@
|
||||
(*
|
||||
application interface library for the alsa driver
|
||||
free pascal / kylix import unit
|
||||
converted from file <alsa/asoundlib.h>
|
||||
|
||||
ALSA library is copyrighted by its authors:
|
||||
Jaroslav Kysela <perex@suse.cz>
|
||||
Abramo Bagnara <abramo@alsa-project.org>
|
||||
Takashi Iwai <tiwai@suse.de>
|
||||
|
||||
Pascal translation:
|
||||
Copyright (C) 2002, Pedro Lopez-Cabanillas <plcl@bigfoot.com>
|
||||
|
||||
Modified by Andrei Borovsky, 01-06-2003
|
||||
Note by A.B.: currently only <alsa/pcm.h> translation is included in this file.
|
||||
|
||||
This library 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.1 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 Lesser General Public License for more details.
|
||||
|
||||
*)
|
||||
|
||||
(* attention! in this unit asoundlib is linked dynamically.
|
||||
In order to decrease loading time, only the symbols needed by ACS
|
||||
are actually resolved. *)
|
||||
|
||||
{
|
||||
$Log: alsa.pas,v $
|
||||
Revision 1.6 2006/08/30 18:59:51 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.5 2006/07/04 17:12:45 z0m3ie
|
||||
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
|
||||
|
||||
Revision 1.3 2005/12/19 18:36:16 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.1 2005/09/14 21:19:37 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 alsa;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
baseunix,ACS_Procs;
|
||||
|
||||
const
|
||||
asoundlib_path = 'libasound.so*';
|
||||
|
||||
var
|
||||
AsoundlibLoaded : Boolean = False;
|
||||
|
||||
type
|
||||
Pint16_t = ^int16_t;
|
||||
|
||||
{ PCM generic info container }
|
||||
Psnd_pcm_info_t = pointer;
|
||||
{ PCM hardware configuration space container }
|
||||
Psnd_pcm_hw_params_t = pointer;
|
||||
{ PCM software configuration container }
|
||||
Psnd_pcm_sw_params_t = pointer;
|
||||
{ PCM status container }
|
||||
Psnd_pcm_status_t = pointer;
|
||||
{ PCM access types mask }
|
||||
Psnd_pcm_access_mask_t = pointer;
|
||||
{ PCM formats mask }
|
||||
Psnd_pcm_format_mask_t = pointer;
|
||||
{ PCM subformats mask }
|
||||
Psnd_pcm_subformat_mask_t = pointer;
|
||||
|
||||
Psnd_config_t = pointer;
|
||||
|
||||
Psnd_async_handler_t = pointer;
|
||||
|
||||
Psnd_output_t = Pointer;
|
||||
|
||||
{ PCM class }
|
||||
_snd_pcm_class = Longint;
|
||||
snd_pcm_class_t = _snd_pcm_class;
|
||||
const
|
||||
SND_PCM_CLASS_GENERIC = 0; { standard device }
|
||||
SND_PCM_CLASS_MULTI = 1; { multichannel device }
|
||||
SND_PCM_CLASS_MODEM = 2; { software modem device }
|
||||
SND_PCM_CLASS_DIGITIZER = 3; { digitizer device }
|
||||
SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER;
|
||||
|
||||
type
|
||||
{ PCM subclass }
|
||||
_snd_pcm_subclass = Longint;
|
||||
snd_pcm_subclass_t = _snd_pcm_subclass;
|
||||
const
|
||||
SND_PCM_SUBCLASS_GENERIC_MIX = 0; { subdevices are mixed together }
|
||||
SND_PCM_SUBCLASS_MULTI_MIX = 1; { multichannel subdevices are mixed together }
|
||||
SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX;
|
||||
|
||||
type
|
||||
{ PCM stream (direction) }
|
||||
_snd_pcm_stream = Longint;
|
||||
snd_pcm_stream_t = _snd_pcm_stream;
|
||||
const
|
||||
SND_PCM_STREAM_PLAYBACK = 0; { Playback stream }
|
||||
SND_PCM_STREAM_CAPTURE = 1; { Capture stream }
|
||||
SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE;
|
||||
|
||||
type
|
||||
{ PCM access type }
|
||||
_snd_pcm_access = Longint;
|
||||
snd_pcm_access_t = _snd_pcm_access;
|
||||
const
|
||||
SND_PCM_ACCESS_MMAP_INTERLEAVED = 0; { mmap access with simple interleaved channels }
|
||||
SND_PCM_ACCESS_MMAP_NONINTERLEAVED = 1; { mmap access with simple non interleaved channels }
|
||||
SND_PCM_ACCESS_MMAP_COMPLEX = 2; { mmap access with complex placement }
|
||||
SND_PCM_ACCESS_RW_INTERLEAVED = 3; { snd_pcm_readi/snd_pcm_writei access }
|
||||
SND_PCM_ACCESS_RW_NONINTERLEAVED = 4; { snd_pcm_readn/snd_pcm_writen access }
|
||||
SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED;
|
||||
|
||||
type
|
||||
{ PCM sample format }
|
||||
_snd_pcm_format = Longint;
|
||||
snd_pcm_format_t = _snd_pcm_format;
|
||||
const
|
||||
{ Unknown }
|
||||
SND_PCM_FORMAT_UNKNOWN = -1;
|
||||
{ Signed 8 bit }
|
||||
SND_PCM_FORMAT_S8 = 0;
|
||||
{ Unsigned 8 bit }
|
||||
SND_PCM_FORMAT_U8 = 1;
|
||||
{ Signed 16 bit Little Endian }
|
||||
SND_PCM_FORMAT_S16_LE = 2;
|
||||
{ Signed 16 bit Big Endian }
|
||||
SND_PCM_FORMAT_S16_BE = 3;
|
||||
{ Unsigned 16 bit Little Endian }
|
||||
SND_PCM_FORMAT_U16_LE = 4;
|
||||
{ Unsigned 16 bit Big Endian }
|
||||
SND_PCM_FORMAT_U16_BE = 5;
|
||||
{ Signed 24 bit Little Endian }
|
||||
SND_PCM_FORMAT_S24_LE = 6;
|
||||
{ Signed 24 bit Big Endian }
|
||||
SND_PCM_FORMAT_S24_BE = 7;
|
||||
{ Unsigned 24 bit Little Endian }
|
||||
SND_PCM_FORMAT_U24_LE = 8;
|
||||
{ Unsigned 24 bit Big Endian }
|
||||
SND_PCM_FORMAT_U24_BE = 9;
|
||||
{ Signed 32 bit Little Endian }
|
||||
SND_PCM_FORMAT_S32_LE = 10;
|
||||
{ Signed 32 bit Big Endian }
|
||||
SND_PCM_FORMAT_S32_BE = 11;
|
||||
{ Unsigned 32 bit Little Endian }
|
||||
SND_PCM_FORMAT_U32_LE = 12;
|
||||
{ Unsigned 32 bit Big Endian }
|
||||
SND_PCM_FORMAT_U32_BE = 13;
|
||||
{ Float 32 bit Little Endian, Range -1.0 to 1.0 }
|
||||
SND_PCM_FORMAT_FLOAT_LE = 14;
|
||||
{ Float 32 bit Big Endian, Range -1.0 to 1.0 }
|
||||
SND_PCM_FORMAT_FLOAT_BE = 15;
|
||||
{ Float 64 bit Little Endian, Range -1.0 to 1.0 }
|
||||
SND_PCM_FORMAT_FLOAT64_LE = 16;
|
||||
{ Float 64 bit Big Endian, Range -1.0 to 1.0 }
|
||||
SND_PCM_FORMAT_FLOAT64_BE = 17;
|
||||
{ IEC-958 Little Endian }
|
||||
SND_PCM_FORMAT_IEC958_SUBFRAME_LE = 18;
|
||||
{ IEC-958 Big Endian }
|
||||
SND_PCM_FORMAT_IEC958_SUBFRAME_BE = 19;
|
||||
{ Mu-Law }
|
||||
SND_PCM_FORMAT_MU_LAW = 20;
|
||||
{ A-Law }
|
||||
SND_PCM_FORMAT_A_LAW = 21;
|
||||
{ Ima-ADPCM }
|
||||
SND_PCM_FORMAT_IMA_ADPCM = 22;
|
||||
{ MPEG }
|
||||
SND_PCM_FORMAT_MPEG = 23;
|
||||
{ GSM }
|
||||
SND_PCM_FORMAT_GSM = 24;
|
||||
{ Special }
|
||||
SND_PCM_FORMAT_SPECIAL = 31;
|
||||
{ Signed 24bit Little Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_S24_3LE = 32;
|
||||
{ Signed 24bit Big Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_S24_3BE = 33;
|
||||
{ Unsigned 24bit Little Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_U24_3LE = 34;
|
||||
{ Unsigned 24bit Big Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_U24_3BE = 35;
|
||||
{ Signed 20bit Little Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_S20_3LE = 36;
|
||||
{ Signed 20bit Big Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_S20_3BE = 37;
|
||||
{ Unsigned 20bit Little Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_U20_3LE = 38;
|
||||
{ Unsigned 20bit Big Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_U20_3BE = 39;
|
||||
{ Signed 18bit Little Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_S18_3LE = 40;
|
||||
{ Signed 18bit Big Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_S18_3BE = 41;
|
||||
{ Unsigned 18bit Little Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_U18_3LE = 42;
|
||||
{ Unsigned 18bit Big Endian in 3bytes format }
|
||||
SND_PCM_FORMAT_U18_3BE = 43;
|
||||
SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE;
|
||||
|
||||
{$IFDEF ENDIAN_LITTLE}
|
||||
{ Signed 16 bit CPU endian }
|
||||
SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE;
|
||||
{ Unsigned 16 bit CPU endian }
|
||||
SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE;
|
||||
{ Signed 24 bit CPU endian }
|
||||
SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE;
|
||||
{ Unsigned 24 bit CPU endian }
|
||||
SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE;
|
||||
{ Signed 32 bit CPU endian }
|
||||
SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE;
|
||||
{ Unsigned 32 bit CPU endian }
|
||||
SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE;
|
||||
{ Float 32 bit CPU endian }
|
||||
SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE;
|
||||
{ Float 64 bit CPU endian }
|
||||
SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE;
|
||||
{ IEC-958 CPU Endian }
|
||||
SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF ENDIAN_BIG}
|
||||
{ Signed 16 bit CPU endian }
|
||||
SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE;
|
||||
{ Unsigned 16 bit CPU endian }
|
||||
SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE;
|
||||
{ Signed 24 bit CPU endian }
|
||||
SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE;
|
||||
{ Unsigned 24 bit CPU endian }
|
||||
SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE;
|
||||
{ Signed 32 bit CPU endian }
|
||||
SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE;
|
||||
{ Unsigned 32 bit CPU endian }
|
||||
SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE;
|
||||
{ Float 32 bit CPU endian }
|
||||
SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE;
|
||||
{ Float 64 bit CPU endian }
|
||||
SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE;
|
||||
{ IEC-958 CPU Endian }
|
||||
SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE;
|
||||
{$ENDIF}
|
||||
|
||||
type
|
||||
{ PCM sample subformat }
|
||||
_snd_pcm_subformat = Longint;
|
||||
snd_pcm_subformat_t = _snd_pcm_subformat;
|
||||
|
||||
const
|
||||
SND_PCM_SUBFORMAT_STD = 0; { Standard }
|
||||
SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD;
|
||||
|
||||
type
|
||||
{ PCM state }
|
||||
_snd_pcm_state = Longint;
|
||||
snd_pcm_state_t = _snd_pcm_state;
|
||||
const
|
||||
SND_PCM_STATE_OPEN = 0; { Open }
|
||||
SND_PCM_STATE_SETUP = 1; { Setup installed }
|
||||
SND_PCM_STATE_PREPARED = 2; { Ready to start }
|
||||
SND_PCM_STATE_RUNNING = 3; { Running }
|
||||
SND_PCM_STATE_XRUN = 4; { Stopped: underrun (playback) or overrun (capture) detected }
|
||||
SND_PCM_STATE_DRAINING = 5; { Draining: running (playback) or stopped (capture) }
|
||||
SND_PCM_STATE_PAUSED = 6; { Paused }
|
||||
SND_PCM_STATE_SUSPENDED = 7; { Hardware is suspended }
|
||||
SND_PCM_STATE_LAST = SND_PCM_STATE_SUSPENDED;
|
||||
|
||||
type
|
||||
{ PCM start mode }
|
||||
_snd_pcm_start = Longint;
|
||||
snd_pcm_start_t = _snd_pcm_start;
|
||||
const
|
||||
SND_PCM_START_DATA = 0; { Automatic start on data read/write }
|
||||
SND_PCM_START_EXPLICIT = 1; { Explicit start }
|
||||
SND_PCM_START_LAST = SND_PCM_START_EXPLICIT;
|
||||
|
||||
type
|
||||
{ PCM xrun mode }
|
||||
_snd_pcm_xrun = Longint;
|
||||
snd_pcm_xrun_t = _snd_pcm_xrun;
|
||||
const
|
||||
SND_PCM_XRUN_NONE = 0; { Xrun detection disabled }
|
||||
SND_PCM_XRUN_STOP = 1; { Stop on xrun detection }
|
||||
SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP;
|
||||
|
||||
type
|
||||
{ PCM timestamp mode }
|
||||
_snd_pcm_tstamp = Longint;
|
||||
snd_pcm_tstamp_t = _snd_pcm_tstamp;
|
||||
const
|
||||
SND_PCM_TSTAMP_NONE = 0; { No timestamp }
|
||||
SND_PCM_TSTAMP_MMAP = 1; { Update mmap'ed timestamp }
|
||||
SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP;
|
||||
|
||||
type
|
||||
{ Unsigned frames quantity }
|
||||
snd_pcm_uframes_t = LongWord;
|
||||
Psnd_pcm_uframes_t = ^snd_pcm_uframes_t;
|
||||
{ Signed frames quantity }
|
||||
snd_pcm_sframes_t = longint;
|
||||
Psnd_pcm_sframes_t = ^snd_pcm_sframes_t;
|
||||
{ Timestamp }
|
||||
snd_timestamp_t = timeval;
|
||||
Psnd_timestamp_t = ^snd_timestamp_t;
|
||||
|
||||
const
|
||||
{ Non blocking mode (flag for open mode) \hideinitializer }
|
||||
SND_PCM_NONBLOCK = $0001;
|
||||
{ Async notification (flag for open mode) \hideinitializer }
|
||||
SND_PCM_ASYNC = $0002;
|
||||
|
||||
type
|
||||
{ PCM handle }
|
||||
Psnd_pcm_t = pointer;
|
||||
|
||||
{ PCM type }
|
||||
_snd_pcm_type = Longint;
|
||||
snd_pcm_type_t = _snd_pcm_type;
|
||||
const
|
||||
{ PCM type }
|
||||
SND_PCM_TYPE_HW = 0; { Kernel level PCM }
|
||||
SND_PCM_TYPE_HOOKS = 1; { Hooked PCM }
|
||||
SND_PCM_TYPE_MULTI = 2; { One ore more linked PCM with exclusive access to selected channels }
|
||||
SND_PCM_TYPE_FILE = 3; { File writing plugin }
|
||||
SND_PCM_TYPE_NULL = 4; { Null endpoint PCM }
|
||||
SND_PCM_TYPE_SHM = 5; { Shared memory client PCM }
|
||||
SND_PCM_TYPE_INET = 6; { INET client PCM (not yet implemented) }
|
||||
SND_PCM_TYPE_COPY = 7; { Copying plugin }
|
||||
SND_PCM_TYPE_LINEAR = 8; { Linear format conversion PCM }
|
||||
SND_PCM_TYPE_ALAW = 9; { A-Law format conversion PCM }
|
||||
SND_PCM_TYPE_MULAW = 10; { Mu-Law format conversion PCM }
|
||||
SND_PCM_TYPE_ADPCM = 11; { IMA-ADPCM format conversion PCM }
|
||||
SND_PCM_TYPE_RATE = 12; { Rate conversion PCM }
|
||||
SND_PCM_TYPE_ROUTE = 13; { Attenuated static route PCM }
|
||||
SND_PCM_TYPE_PLUG = 14; { Format adjusted PCM }
|
||||
SND_PCM_TYPE_SHARE = 15; { Sharing PCM }
|
||||
SND_PCM_TYPE_METER = 16; { Meter plugin }
|
||||
SND_PCM_TYPE_MIX = 17; { Mixing PCM }
|
||||
SND_PCM_TYPE_DROUTE = 18; { Attenuated dynamic route PCM (not yet implemented) }
|
||||
SND_PCM_TYPE_LBSERVER = 19; { Loopback server plugin (not yet implemented) }
|
||||
SND_PCM_TYPE_LINEAR_FLOAT = 20; { Linear Integer <-> Linear Float format conversion PCM }
|
||||
SND_PCM_TYPE_LADSPA = 21; { LADSPA integration plugin }
|
||||
|
||||
|
||||
type
|
||||
|
||||
{ PCM area specification }
|
||||
_snd_pcm_channel_area = record
|
||||
addr : pointer; { base address of channel samples }
|
||||
first : LongWord; { offset to first sample in bits }
|
||||
step : LongWord; { samples distance in bits }
|
||||
end;
|
||||
snd_pcm_channel_area_t = _snd_pcm_channel_area;
|
||||
Psnd_pcm_channel_area_t = ^snd_pcm_channel_area_t;
|
||||
|
||||
{ PCM synchronization ID }
|
||||
_snd_pcm_sync_id = record
|
||||
case longint of
|
||||
0 : ( id : array[0..15] of byte ); { 8-bit ID }
|
||||
1 : ( id16 : array[0..7] of word ); { 16-bit ID }
|
||||
2 : ( id32 : array[0..3] of LongWord ); { 32-bit ID }
|
||||
end;
|
||||
snd_pcm_sync_id_t = _snd_pcm_sync_id;
|
||||
|
||||
{ #SND_PCM_TYPE_METER scope handle }
|
||||
Psnd_pcm_scope_t = pointer;
|
||||
|
||||
type
|
||||
snd_pcm_open_t = function(var pcm:Psnd_pcm_t; name:Pchar; stream:snd_pcm_stream_t; mode:longint):longint;cdecl;
|
||||
snd_pcm_open_lconf_t = function(var pcm:Psnd_pcm_t; name:Pchar; stream:snd_pcm_stream_t; mode:longint; lconf:Psnd_config_t):longint;cdecl;
|
||||
snd_pcm_close_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_name_t = function(pcm:Psnd_pcm_t):Pchar;cdecl;
|
||||
snd_pcm_type_t_t = function(pcm:Psnd_pcm_t):snd_pcm_type_t;cdecl;
|
||||
snd_pcm_stream_t_t = function(pcm:Psnd_pcm_t):snd_pcm_stream_t;cdecl;
|
||||
snd_pcm_poll_descriptors_count_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_poll_descriptors_t = function(pcm:Psnd_pcm_t; var pfds:pollfd; space:LongWord):longint;cdecl;
|
||||
snd_pcm_poll_descriptors_revents_t = function(pcm:Psnd_pcm_t; var pfds:pollfd; nfds:LongWord; revents:Pword):longint;cdecl;
|
||||
snd_pcm_set_nonblock_t = function(pcm:Psnd_pcm_t; nonblock:longint):longint;cdecl;
|
||||
// snd_async_add_pcm_handler_t = function(var handler:Psnd_async_handler_t; pcm:Psnd_pcm_t; callback:snd_async_callback_t; private_data:pointer):longint;cdecl;
|
||||
snd_async_handler_get_pcm_t = function(handler:Psnd_async_handler_t):Psnd_pcm_t;cdecl;
|
||||
snd_pcm_info_t = function(pcm:Psnd_pcm_t; info:Psnd_pcm_info_t):longint;cdecl;
|
||||
snd_pcm_hw_params_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_current_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_free_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_sw_params_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t):longint;cdecl;
|
||||
snd_pcm_sw_params_current_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t):longint;cdecl;
|
||||
snd_pcm_prepare_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_reset_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_status_t = function(pcm:Psnd_pcm_t; status:Psnd_pcm_status_t):longint;cdecl;
|
||||
snd_pcm_start_t_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_drop_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_drain_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_pause_t = function(pcm:Psnd_pcm_t; enable:longint):longint;cdecl;
|
||||
snd_pcm_state_t_t = function(pcm:Psnd_pcm_t):snd_pcm_state_t;cdecl;
|
||||
snd_pcm_hwsync_t = function(pcm: Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_delay_t = function(pcm:Psnd_pcm_t; delayp:Psnd_pcm_sframes_t):longint;cdecl;
|
||||
snd_pcm_resume_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_avail_update_t = function(pcm:Psnd_pcm_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_rewind_t = function(pcm:Psnd_pcm_t; frames:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_writei_t = function(pcm:Psnd_pcm_t; buffer:pointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_readi_t = function(pcm:Psnd_pcm_t; buffer:pointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_writen_t = function(pcm:Psnd_pcm_t; bufs:Ppointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_readn_t = function(pcm:Psnd_pcm_t; bufs:Ppointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_wait_t = function(pcm:Psnd_pcm_t; timeout:longint):longint;cdecl;
|
||||
snd_pcm_link_t = function(pcm1:Psnd_pcm_t; pcm2:Psnd_pcm_t):longint;cdecl;
|
||||
snd_pcm_unlink_t = function(pcm:Psnd_pcm_t):longint;cdecl;
|
||||
|
||||
snd_pcm_info_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_info_malloc_t = function(var obj:Psnd_pcm_info_t):LongInt;cdecl;
|
||||
snd_pcm_info_free_t = procedure(obj:Psnd_pcm_info_t);cdecl;
|
||||
snd_pcm_info_copy_t = procedure(dst:Psnd_pcm_info_t; src:Psnd_pcm_info_t);cdecl;
|
||||
snd_pcm_info_get_device_t = function(obj:Psnd_pcm_info_t):LongWord;cdecl;
|
||||
snd_pcm_info_get_subdevice_t = function(obj:Psnd_pcm_info_t):LongWord;cdecl;
|
||||
snd_pcm_info_get_stream_t = function(obj:Psnd_pcm_info_t):snd_pcm_stream_t;cdecl;
|
||||
snd_pcm_info_get_card_t = function(obj:Psnd_pcm_info_t):longint;cdecl;
|
||||
snd_pcm_info_get_id_t = function(obj:Psnd_pcm_info_t):Pchar;cdecl;
|
||||
snd_pcm_info_get_name_t = function(obj:Psnd_pcm_info_t):Pchar;cdecl;
|
||||
snd_pcm_info_get_subdevice_name_t = function(obj:Psnd_pcm_info_t):Pchar;cdecl;
|
||||
snd_pcm_info_get_class_t = function(obj:Psnd_pcm_info_t):snd_pcm_class_t;cdecl;
|
||||
snd_pcm_info_get_subclass_t = function(obj:Psnd_pcm_info_t):snd_pcm_subclass_t;cdecl;
|
||||
snd_pcm_info_get_subdevices_count_t = function(obj:Psnd_pcm_info_t):LongWord;cdecl;
|
||||
snd_pcm_info_get_subdevices_avail_t = function(obj:Psnd_pcm_info_t):LongWord;cdecl;
|
||||
snd_pcm_info_get_sync_t = function(obj:Psnd_pcm_info_t):snd_pcm_sync_id_t;cdecl;
|
||||
snd_pcm_info_set_device_t = procedure(obj:Psnd_pcm_info_t; val:LongWord);cdecl;
|
||||
snd_pcm_info_set_subdevice_t = procedure(obj:Psnd_pcm_info_t; val:LongWord);cdecl;
|
||||
snd_pcm_info_set_stream_t = procedure(obj:Psnd_pcm_info_t; val:snd_pcm_stream_t);cdecl;
|
||||
{
|
||||
Hardware Parameters
|
||||
See the \ref pcm page for more details.
|
||||
}
|
||||
snd_pcm_hw_params_any_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_can_mmap_sample_resolution_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_is_double_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_is_batch_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_is_block_transfer_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_can_overrange_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_can_pause_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_can_resume_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_is_half_duplex_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_is_joint_duplex_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_can_sync_start_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_rate_numden_t = function(params:Psnd_pcm_hw_params_t; rate_num:PLongWord; rate_den:PLongWord):longint;cdecl;
|
||||
snd_pcm_hw_params_get_sbits_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_fifo_size_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
|
||||
snd_pcm_hw_params_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_hw_params_malloc_t = function(var obj:Psnd_pcm_hw_params_t):LongInt;cdecl;
|
||||
snd_pcm_hw_params_free_t = procedure(obj:Psnd_pcm_hw_params_t);cdecl;
|
||||
snd_pcm_hw_params_copy_t = procedure(dst:Psnd_pcm_hw_params_t; src:Psnd_pcm_hw_params_t);cdecl;
|
||||
snd_pcm_hw_params_get_access_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_test_access_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_access_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_access_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_access_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_access_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_access_t;cdecl;
|
||||
snd_pcm_hw_params_set_access_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_access_t;cdecl;
|
||||
snd_pcm_hw_params_set_access_mask_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; mask:Psnd_pcm_access_mask_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_access_mask_t = procedure(params:Psnd_pcm_hw_params_t; mask:Psnd_pcm_access_mask_t);cdecl;
|
||||
snd_pcm_hw_params_get_format_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_test_format_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_format_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_format_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_format_t;cdecl;
|
||||
snd_pcm_hw_params_set_format_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_format_t;cdecl;
|
||||
snd_pcm_hw_params_set_format_mask_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; mask:Psnd_pcm_format_mask_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_format_mask_t = procedure(params:Psnd_pcm_hw_params_t; mask:Psnd_pcm_format_mask_t);cdecl;
|
||||
snd_pcm_hw_params_test_subformat_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_subformat_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_subformat_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_subformat_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_subformat_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_subformat_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_subformat_t;cdecl;
|
||||
snd_pcm_hw_params_set_subformat_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_subformat_t;cdecl;
|
||||
snd_pcm_hw_params_set_subformat_mask_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; mask:Psnd_pcm_subformat_mask_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_subformat_mask_t = procedure(params:Psnd_pcm_hw_params_t; mask:Psnd_pcm_subformat_mask_t);cdecl;
|
||||
snd_pcm_hw_params_get_channels_t = function(params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_channels_min_t = function(params:Psnd_pcm_hw_params_t):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_channels_max_t = function(params:Psnd_pcm_hw_params_t):LongWord;cdecl;
|
||||
snd_pcm_hw_params_test_channels_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord):longint;cdecl;
|
||||
snd_pcm_hw_params_set_channels_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord):longint;cdecl;
|
||||
snd_pcm_hw_params_set_channels_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord):longint;cdecl;
|
||||
snd_pcm_hw_params_set_channels_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord):longint;cdecl;
|
||||
snd_pcm_hw_params_set_channels_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:PLongWord; max:PLongWord):longint;cdecl;
|
||||
snd_pcm_hw_params_set_channels_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_channels_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_channels_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_rate_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_get_rate_min_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_rate_max_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_test_rate_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_rate_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_rate_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_rate_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_rate_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:PLongWord; mindir:Plongint; max:PLongWord;
|
||||
maxdir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_rate_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_rate_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_rate_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_period_time_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_get_period_time_min_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_period_time_max_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_test_period_time_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:PLongWord; mindir:Plongint; max:PLongWord;
|
||||
maxdir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_period_time_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_period_size_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_hw_params_get_period_size_min_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_get_period_size_max_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_test_period_size_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_uframes_t; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_uframes_t; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:Psnd_pcm_uframes_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:Psnd_pcm_uframes_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:Psnd_pcm_uframes_t; mindir:Plongint; max:Psnd_pcm_uframes_t;
|
||||
maxdir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_uframes_t; dir:Plongint):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_set_period_size_integer_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_periods_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_get_periods_min_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_periods_max_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_test_periods_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_periods_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_periods_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_periods_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_periods_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:PLongWord; mindir:Plongint; max:PLongWord;
|
||||
maxdir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_periods_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_periods_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_periods_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_periods_integer_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):longint;cdecl;
|
||||
snd_pcm_hw_params_get_buffer_time_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_get_buffer_time_min_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_buffer_time_max_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_test_buffer_time_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:PLongWord; mindir:Plongint; max:PLongWord;
|
||||
maxdir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_time_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_buffer_size_t = function(params:Psnd_pcm_hw_params_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_hw_params_get_buffer_size_min_t = function(params:Psnd_pcm_hw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_get_buffer_size_max_t = function(params:Psnd_pcm_hw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_test_buffer_size_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:Psnd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:Psnd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:Psnd_pcm_uframes_t; max:Psnd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:snd_pcm_uframes_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_set_buffer_size_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_hw_params_get_tick_time_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_get_tick_time_min_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_get_tick_time_max_t = function(params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_test_tick_time_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:longint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_max_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:PLongWord; dir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_minmax_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; min:PLongWord; mindir:Plongint; max:PLongWord;
|
||||
maxdir:Plongint):longint;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_near_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; val:LongWord; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_first_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
snd_pcm_hw_params_set_tick_time_last_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_hw_params_t; dir:Plongint):LongWord;cdecl;
|
||||
{ New function added in alsa-lib-0.9.0-rc5 }
|
||||
snd_pcm_hw_params_get_min_align_t = function(params: Psnd_pcm_hw_params_t; var val: snd_pcm_uframes_t):longint;cdecl;
|
||||
|
||||
{
|
||||
Software Parameters
|
||||
}
|
||||
// function snd_pcm_sw_params_current(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t):longint;cdecl;external asoundlib_name;
|
||||
snd_pcm_sw_params_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_sw_params_malloc_t = function(var obj:Psnd_pcm_sw_params_t):LongInt;cdecl;
|
||||
snd_pcm_sw_params_free_t = procedure(obj:Psnd_pcm_sw_params_t);cdecl;
|
||||
snd_pcm_sw_params_copy_t = procedure(dst:Psnd_pcm_sw_params_t; src:Psnd_pcm_sw_params_t);cdecl;
|
||||
snd_pcm_sw_params_set_tstamp_mode_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_tstamp_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_tstamp_mode_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_tstamp_t;cdecl;
|
||||
|
||||
snd_pcm_sw_params_set_sleep_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:LongWord):longint;cdecl;
|
||||
snd_pcm_sw_params_get_sleep_min_t = function(params:Psnd_pcm_sw_params_t):LongWord;cdecl;
|
||||
snd_pcm_sw_params_set_avail_min_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_avail_min_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_sw_params_set_xfer_align_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_xfer_align_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_sw_params_set_start_threshold_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_start_threshold_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_sw_params_set_stop_threshold_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_stop_threshold_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
|
||||
snd_pcm_sw_params_set_silence_threshold_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_silence_threshold_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_sw_params_set_silence_size_t = function(pcm:Psnd_pcm_t; params:Psnd_pcm_sw_params_t; val:snd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_sw_params_get_silence_size_t = function(params:Psnd_pcm_sw_params_t):snd_pcm_uframes_t;cdecl;
|
||||
|
||||
{
|
||||
Access Mask Functions
|
||||
}
|
||||
snd_pcm_access_mask_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_access_mask_malloc_t = function(var obj:Psnd_pcm_access_mask_t):LongInt;cdecl;
|
||||
snd_pcm_access_mask_free_t = procedure(obj:Psnd_pcm_access_mask_t);cdecl;
|
||||
snd_pcm_access_mask_copy_t = procedure(dst:Psnd_pcm_access_mask_t; src:Psnd_pcm_access_mask_t);cdecl;
|
||||
snd_pcm_access_mask_none_t = procedure(mask:Psnd_pcm_access_mask_t);cdecl;
|
||||
snd_pcm_access_mask_any_t = procedure(mask:Psnd_pcm_access_mask_t);cdecl;
|
||||
snd_pcm_access_mask_test_t = function(mask:Psnd_pcm_access_mask_t; val:snd_pcm_access_t):longint;cdecl;
|
||||
snd_pcm_access_mask_empty_t = function(mask:Psnd_pcm_access_mask_t):longint;cdecl;
|
||||
snd_pcm_access_mask_set_t = procedure(mask:Psnd_pcm_access_mask_t; val:snd_pcm_access_t);cdecl;
|
||||
snd_pcm_access_mask_reset_t = procedure(mask:Psnd_pcm_access_mask_t; val:snd_pcm_access_t);cdecl;
|
||||
{
|
||||
Format Mask Functions
|
||||
}
|
||||
snd_pcm_format_mask_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_format_mask_malloc_t = function(var obj:Psnd_pcm_format_mask_t):LongInt;cdecl;
|
||||
snd_pcm_format_mask_free_t = procedure(obj:Psnd_pcm_format_mask_t);cdecl;
|
||||
snd_pcm_format_mask_copy_t = procedure(dst:Psnd_pcm_format_mask_t; src:Psnd_pcm_format_mask_t);cdecl;
|
||||
snd_pcm_format_mask_none_t = procedure(mask:Psnd_pcm_format_mask_t);cdecl;
|
||||
snd_pcm_format_mask_any_t = procedure(mask:Psnd_pcm_format_mask_t);cdecl;
|
||||
snd_pcm_format_mask_test_t = function(mask:Psnd_pcm_format_mask_t; val:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_mask_empty_t = function(mask:Psnd_pcm_format_mask_t):longint;cdecl;
|
||||
snd_pcm_format_mask_set_t = procedure(mask:Psnd_pcm_format_mask_t; val:snd_pcm_format_t);cdecl;
|
||||
snd_pcm_format_mask_reset_t = procedure(mask:Psnd_pcm_format_mask_t; val:snd_pcm_format_t);cdecl;
|
||||
{
|
||||
Subformat Mask Functions
|
||||
}
|
||||
snd_pcm_subformat_mask_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_subformat_mask_malloc_t = function(var obj:Psnd_pcm_subformat_mask_t):LongInt;cdecl;
|
||||
snd_pcm_subformat_mask_free_t = procedure(obj:Psnd_pcm_subformat_mask_t);cdecl;
|
||||
snd_pcm_subformat_mask_copy_t = procedure(dst:Psnd_pcm_subformat_mask_t; src:Psnd_pcm_subformat_mask_t);cdecl;
|
||||
snd_pcm_subformat_mask_none_t = procedure(mask:Psnd_pcm_subformat_mask_t);cdecl;
|
||||
snd_pcm_subformat_mask_any_t = procedure(mask:Psnd_pcm_subformat_mask_t);cdecl;
|
||||
snd_pcm_subformat_mask_test_t = function(mask:Psnd_pcm_subformat_mask_t; val:snd_pcm_subformat_t):longint;cdecl;
|
||||
snd_pcm_subformat_mask_empty_t = function(mask:Psnd_pcm_subformat_mask_t):longint;cdecl;
|
||||
snd_pcm_subformat_mask_set_t = procedure(mask:Psnd_pcm_subformat_mask_t; val:snd_pcm_subformat_t);cdecl;
|
||||
snd_pcm_subformat_mask_reset_t = procedure(mask:Psnd_pcm_subformat_mask_t; val:snd_pcm_subformat_t);cdecl;
|
||||
{
|
||||
Status Functions
|
||||
}
|
||||
snd_pcm_status_sizeof_t = function:size_t;cdecl;
|
||||
snd_pcm_status_malloc_t = function(var obj:Psnd_pcm_status_t):LongInt;cdecl;
|
||||
snd_pcm_status_free_t = procedure(obj:Psnd_pcm_status_t);cdecl;
|
||||
snd_pcm_status_copy_t = procedure(dst:Psnd_pcm_status_t; src:Psnd_pcm_status_t);cdecl;
|
||||
snd_pcm_status_get_state_t = function(obj:Psnd_pcm_status_t):snd_pcm_state_t;cdecl;
|
||||
snd_pcm_status_get_trigger_tstamp_t = procedure(obj:Psnd_pcm_status_t; ptr:Psnd_timestamp_t);cdecl;
|
||||
snd_pcm_status_get_tstamp_t = procedure(obj:Psnd_pcm_status_t; ptr:Psnd_timestamp_t);cdecl;
|
||||
snd_pcm_status_get_delay_t = function(obj:Psnd_pcm_status_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_status_get_avail_t = function(obj:Psnd_pcm_status_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_status_get_avail_max_t = function(obj:Psnd_pcm_status_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_status_get_overrange_t = function(obj:Psnd_pcm_status_t):snd_pcm_uframes_t;cdecl;
|
||||
{
|
||||
Description Functions
|
||||
}
|
||||
snd_pcm_stream_name_t = function(stream:snd_pcm_stream_t):Pchar;cdecl;
|
||||
snd_pcm_access_name_t = function(_access:snd_pcm_access_t):Pchar;cdecl;
|
||||
snd_pcm_format_name_t = function(format:snd_pcm_format_t):Pchar;cdecl;
|
||||
snd_pcm_format_description_t = function(format:snd_pcm_format_t):Pchar;cdecl;
|
||||
snd_pcm_subformat_name_t = function(subformat:snd_pcm_subformat_t):Pchar;cdecl;
|
||||
snd_pcm_subformat_description_t = function(subformat:snd_pcm_subformat_t):Pchar;cdecl;
|
||||
snd_pcm_format_value_t = function(name:Pchar):snd_pcm_format_t;cdecl;
|
||||
snd_pcm_tstamp_mode_name_t = function(mode:snd_pcm_tstamp_t):Pchar;cdecl;
|
||||
snd_pcm_state_name_t = function(state:snd_pcm_state_t):Pchar;cdecl;
|
||||
{
|
||||
Debug Functions
|
||||
}
|
||||
snd_pcm_dump_t = function(pcm:Psnd_pcm_t; mout:Psnd_output_t):longint;cdecl;
|
||||
snd_pcm_dump_hw_setup_t = function(pcm:Psnd_pcm_t; mout:Psnd_output_t):longint;cdecl;
|
||||
snd_pcm_dump_sw_setup_t = function(pcm:Psnd_pcm_t; mout:Psnd_output_t):longint;cdecl;
|
||||
snd_pcm_dump_setup_t = function(pcm:Psnd_pcm_t; mout:Psnd_output_t):longint;cdecl;
|
||||
snd_pcm_hw_params_dump_t = function(params:Psnd_pcm_hw_params_t; mout:Psnd_output_t):longint;cdecl;
|
||||
snd_pcm_sw_params_dump_t = function(params:Psnd_pcm_sw_params_t; mout:Psnd_output_t):longint;cdecl;
|
||||
snd_pcm_status_dump_t = function(status:Psnd_pcm_status_t; mout:Psnd_output_t):longint;cdecl;
|
||||
{
|
||||
Direct Access (MMAP) Functions
|
||||
}
|
||||
snd_pcm_mmap_begin_t = function(pcm:Psnd_pcm_t; var areas:Psnd_pcm_channel_area_t; offset:Psnd_pcm_uframes_t; frames:Psnd_pcm_uframes_t):longint;cdecl;
|
||||
snd_pcm_mmap_commit_t = function(pcm:Psnd_pcm_t; offset:snd_pcm_uframes_t; frames:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_mmap_writei_t = function(pcm:Psnd_pcm_t; buffer:pointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_mmap_readi_t = function(pcm:Psnd_pcm_t; buffer:pointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_mmap_writen_t = function(pcm:Psnd_pcm_t; bufs:Ppointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_mmap_readn_t = function(pcm:Psnd_pcm_t; bufs:Ppointer; size:snd_pcm_uframes_t):snd_pcm_sframes_t;cdecl;
|
||||
{
|
||||
Helper Functions
|
||||
}
|
||||
snd_pcm_format_signed_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_unsigned_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_linear_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_is_float_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_little_endian_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_big_endian_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_cpu_endian_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_format_width_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
{ in bits }
|
||||
snd_pcm_format_physical_width_t = function(format:snd_pcm_format_t):longint;cdecl;
|
||||
{ in bits }
|
||||
snd_pcm_build_linear_format_t = function(width:longint; pwidth:longint; unsignd:longint; big_endian:longint):snd_pcm_format_t;cdecl;
|
||||
snd_pcm_format_size_t = function(format:snd_pcm_format_t; samples:size_t):ssize_t;cdecl;
|
||||
snd_pcm_format_silence_t = function(format:snd_pcm_format_t):u_int8_t;cdecl;
|
||||
snd_pcm_format_silence_16_t = function(format:snd_pcm_format_t):u_int16_t;cdecl;
|
||||
snd_pcm_format_silence_32_t = function(format:snd_pcm_format_t):u_int32_t;cdecl;
|
||||
// snd_pcm_format_silence_64_t = function(format:snd_pcm_format_t):u_int64_t;cdecl;
|
||||
snd_pcm_format_set_silence_t = function(format:snd_pcm_format_t; buf:pointer; samples:LongWord):longint;cdecl;
|
||||
snd_pcm_bytes_to_frames_t = function(pcm:Psnd_pcm_t; bytes:ssize_t):snd_pcm_sframes_t;cdecl;
|
||||
snd_pcm_frames_to_bytes_t = function(pcm:Psnd_pcm_t; frames:snd_pcm_sframes_t):ssize_t;cdecl;
|
||||
snd_pcm_bytes_to_samples_t = function(pcm:Psnd_pcm_t; bytes:ssize_t):longint;cdecl;
|
||||
snd_pcm_samples_to_bytes_t = function(pcm:Psnd_pcm_t; samples:longint):ssize_t;cdecl;
|
||||
snd_pcm_area_silence_t = function(dst_channel:Psnd_pcm_channel_area_t; dst_offset:snd_pcm_uframes_t; samples:LongWord; format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_areas_silence_t = function(dst_channels:Psnd_pcm_channel_area_t; dst_offset:snd_pcm_uframes_t; channels:LongWord; frames:snd_pcm_uframes_t; format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_area_copy_t = function(dst_channel:Psnd_pcm_channel_area_t; dst_offset:snd_pcm_uframes_t; src_channel:Psnd_pcm_channel_area_t; src_offset:snd_pcm_uframes_t; samples:LongWord;
|
||||
format:snd_pcm_format_t):longint;cdecl;
|
||||
snd_pcm_areas_copy_t = function(dst_channels:Psnd_pcm_channel_area_t; dst_offset:snd_pcm_uframes_t; src_channels:Psnd_pcm_channel_area_t; src_offset:snd_pcm_uframes_t; channels:LongWord;
|
||||
frames:snd_pcm_uframes_t; format:snd_pcm_format_t):longint;cdecl;
|
||||
{
|
||||
Hook Extension
|
||||
}
|
||||
type
|
||||
{ type of pcm hook }
|
||||
_snd_pcm_hook_type = Longint;
|
||||
snd_pcm_hook_type_t = _snd_pcm_hook_type;
|
||||
const
|
||||
SND_PCM_HOOK_TYPE_HW_PARAMS = 0;
|
||||
SND_PCM_HOOK_TYPE_HW_FREE = 1;
|
||||
SND_PCM_HOOK_TYPE_CLOSE = 2;
|
||||
SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE;
|
||||
|
||||
type
|
||||
{ PCM hook container }
|
||||
Psnd_pcm_hook_t = pointer;
|
||||
{ PCM hook callback function }
|
||||
snd_pcm_hook_func_t = function (hook:Psnd_pcm_hook_t):longint;cdecl;
|
||||
type
|
||||
|
||||
snd_pcm_hook_get_pcm_t = function(hook:Psnd_pcm_hook_t):Psnd_pcm_t;cdecl;
|
||||
snd_pcm_hook_get_private_t = function(hook:Psnd_pcm_hook_t):pointer;cdecl;
|
||||
snd_pcm_hook_set_private_t = procedure(hook:Psnd_pcm_hook_t; private_data:pointer);cdecl;
|
||||
snd_pcm_hook_add_t = function(var hookp:Psnd_pcm_hook_t; pcm:Psnd_pcm_t; _type:snd_pcm_hook_type_t; func:snd_pcm_hook_func_t; private_data:pointer):longint;cdecl;
|
||||
snd_pcm_hook_remove_t = function(hook:Psnd_pcm_hook_t):longint;cdecl;
|
||||
{
|
||||
Scope Plugin Extension
|
||||
}
|
||||
type
|
||||
{ #SND_PCM_TYPE_METER scope functions }
|
||||
_snd_pcm_scope_ops = record
|
||||
enable : function (scope:Psnd_pcm_scope_t):longint;cdecl; { Enable and prepare it using current params }
|
||||
disable : procedure (scope:Psnd_pcm_scope_t); { Disable }
|
||||
start : procedure (scope:Psnd_pcm_scope_t); { PCM has been started }
|
||||
stop : procedure (scope:Psnd_pcm_scope_t); { PCM has been stopped }
|
||||
update : procedure (scope:Psnd_pcm_scope_t); { New frames are present }
|
||||
reset : procedure (scope:Psnd_pcm_scope_t); { Reset status }
|
||||
close : procedure (scope:Psnd_pcm_scope_t); { PCM is closing }
|
||||
end;
|
||||
snd_pcm_scope_ops_t = _snd_pcm_scope_ops;
|
||||
Psnd_pcm_scope_ops_t = ^snd_pcm_scope_ops_t;
|
||||
|
||||
snd_pcm_meter_get_bufsize_t = function(pcm:Psnd_pcm_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_meter_get_channels_t = function(pcm:Psnd_pcm_t):LongWord;cdecl;
|
||||
snd_pcm_meter_get_rate_t = function(pcm:Psnd_pcm_t):LongWord;cdecl;
|
||||
snd_pcm_meter_get_now_t = function(pcm:Psnd_pcm_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_meter_get_boundary_t = function(pcm:Psnd_pcm_t):snd_pcm_uframes_t;cdecl;
|
||||
snd_pcm_meter_add_scope_t = function(pcm:Psnd_pcm_t; scope:Psnd_pcm_scope_t):longint;cdecl;
|
||||
snd_pcm_meter_search_scope_t = function(pcm:Psnd_pcm_t; name:Pchar):Psnd_pcm_scope_t;cdecl;
|
||||
snd_pcm_scope_malloc_t = function(var ptr:Psnd_pcm_scope_t):longint;cdecl;
|
||||
snd_pcm_scope_set_ops_t = procedure(scope:Psnd_pcm_scope_t; val:Psnd_pcm_scope_ops_t);cdecl;
|
||||
snd_pcm_scope_set_name_t = procedure(scope:Psnd_pcm_scope_t; val:Pchar);cdecl;
|
||||
snd_pcm_scope_get_name_t = function(scope:Psnd_pcm_scope_t):Pchar;cdecl;
|
||||
snd_pcm_scope_get_callback_private_t = function(scope:Psnd_pcm_scope_t):pointer;cdecl;
|
||||
snd_pcm_scope_set_callback_private_t = procedure(scope:Psnd_pcm_scope_t; val:pointer);cdecl;
|
||||
snd_pcm_scope_s16_open_t = function(pcm:Psnd_pcm_t; name:Pchar; var scopep:Psnd_pcm_scope_t):longint;cdecl;
|
||||
snd_pcm_scope_s16_get_channel_buffer_t = function(scope:Psnd_pcm_scope_t; channel:LongWord):Pint16_t;cdecl;
|
||||
|
||||
var
|
||||
|
||||
snd_pcm_close : snd_pcm_close_t;
|
||||
snd_pcm_drop : snd_pcm_drop_t;
|
||||
snd_pcm_drain : snd_pcm_drain_t;
|
||||
snd_pcm_hw_params_malloc : snd_pcm_hw_params_malloc_t;
|
||||
snd_pcm_hw_params_any : snd_pcm_hw_params_any_t;
|
||||
snd_pcm_hw_params_get_periods : snd_pcm_hw_params_get_periods_t;
|
||||
snd_pcm_hw_params_get_period_size : snd_pcm_hw_params_get_period_size_t;
|
||||
snd_pcm_hw_params_get_rate : snd_pcm_hw_params_get_rate_t;
|
||||
snd_pcm_hw_params_set_access : snd_pcm_hw_params_set_access_t;
|
||||
snd_pcm_hw_params_set_buffer_size : snd_pcm_hw_params_set_buffer_size_t;
|
||||
snd_pcm_hw_params_set_buffer_size_near : snd_pcm_hw_params_set_buffer_size_near_t;
|
||||
snd_pcm_hw_params_set_channels : snd_pcm_hw_params_set_channels_t;
|
||||
snd_pcm_hw_params_set_format : snd_pcm_hw_params_set_format_t;
|
||||
snd_pcm_hw_params_set_period_size_near : snd_pcm_hw_params_set_period_size_near_t;
|
||||
snd_pcm_hw_params_set_periods_near : snd_pcm_hw_params_set_periods_near_t;
|
||||
snd_pcm_hw_params_set_rate_near : snd_pcm_hw_params_set_rate_near_t;
|
||||
snd_pcm_hw_params : snd_pcm_hw_params_t;
|
||||
snd_pcm_hw_params_free : snd_pcm_hw_params_free_t;
|
||||
snd_pcm_info_get_device : snd_pcm_info_get_device_t;
|
||||
snd_pcm_info_get_name : snd_pcm_info_get_name_t;
|
||||
snd_pcm_info_set_device : snd_pcm_info_set_device_t;
|
||||
snd_pcm_mmap_readi : snd_pcm_mmap_readi_t;
|
||||
snd_pcm_mmap_writei : snd_pcm_mmap_writei_t;
|
||||
snd_pcm_open : snd_pcm_open_t;
|
||||
snd_pcm_pause : snd_pcm_pause_t;
|
||||
snd_pcm_prepare : snd_pcm_prepare_t;
|
||||
snd_pcm_readi : snd_pcm_readi_t;
|
||||
snd_pcm_reset : snd_pcm_reset_t;
|
||||
snd_pcm_resume : snd_pcm_resume_t;
|
||||
snd_pcm_state : snd_pcm_state_t_t;
|
||||
snd_pcm_stream : snd_pcm_stream_t_t;
|
||||
snd_pcm_writei : snd_pcm_writei_t;
|
||||
|
||||
// Mixer types
|
||||
|
||||
type
|
||||
|
||||
psnd_ctl_card_info_t = Pointer;
|
||||
ppsnd_ctl_card_info_t = ^psnd_ctl_card_info_t;
|
||||
psnd_ctl_t = Pointer;
|
||||
ppsnd_ctl_t = ^psnd_ctl_t;
|
||||
|
||||
|
||||
type
|
||||
|
||||
snd_ctl_card_info_sizeof_t = function : Integer; cdecl;
|
||||
snd_ctl_card_info_malloc_t = function(ptr : ppsnd_ctl_card_info_t) : Integer; cdecl;
|
||||
snd_ctl_card_info_free_t = procedure(obj : psnd_ctl_card_info_t); cdecl;
|
||||
snd_ctl_card_info_clear_t = procedure(obj : psnd_ctl_card_info_t); cdecl;
|
||||
snd_ctl_card_info_copy_t = procedure(dst, src : psnd_ctl_card_info_t); cdecl;
|
||||
snd_ctl_card_info_get_card_t = function(obj : psnd_ctl_card_info_t) : Integer; cdecl;
|
||||
snd_ctl_card_info_get_id_t = function(obj : psnd_ctl_card_info_t) : PChar; cdecl;
|
||||
snd_ctl_card_info_get_driver_t = function(obj : psnd_ctl_card_info_t) : PChar; cdecl;
|
||||
snd_ctl_card_info_get_name_t = function(obj : psnd_ctl_card_info_t) : PChar; cdecl;
|
||||
snd_ctl_card_info_get_longname_t = function(obj : psnd_ctl_card_info_t) : PChar; cdecl;
|
||||
snd_ctl_card_info_get_mixername_t = function(obj : psnd_ctl_card_info_t) : PChar; cdecl;
|
||||
snd_ctl_card_info_get_components_t = function(obj : psnd_ctl_card_info_t) : PChar; cdecl;
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
Path : string;
|
||||
Libhandle : Pointer;
|
||||
|
||||
initialization
|
||||
|
||||
Path := FindLibs(asoundlib_path);
|
||||
if Path <> '' then Libhandle := dlopen(@Path[1], RTLD_NOW or RTLD_GLOBAL);
|
||||
if Libhandle <> nil then
|
||||
begin
|
||||
AsoundlibLoaded := True;
|
||||
snd_pcm_close := dlsym(Libhandle, 'snd_pcm_close');
|
||||
snd_pcm_drop := dlsym(Libhandle, 'snd_pcm_drop');
|
||||
snd_pcm_drain := dlsym(Libhandle, 'snd_pcm_drain');
|
||||
snd_pcm_hw_params_malloc := dlsym(Libhandle, 'snd_pcm_hw_params_malloc');
|
||||
snd_pcm_hw_params_any := dlsym(Libhandle, 'snd_pcm_hw_params_any');
|
||||
snd_pcm_hw_params_get_periods := dlsym(Libhandle, 'snd_pcm_hw_params_get_periods');
|
||||
snd_pcm_hw_params_get_period_size := dlsym(Libhandle, 'snd_pcm_hw_params_get_period_size');
|
||||
snd_pcm_hw_params_get_rate := dlsym(Libhandle, 'snd_pcm_hw_params_get_rate');
|
||||
snd_pcm_hw_params_set_access := dlsym(Libhandle, 'snd_pcm_hw_params_set_access');
|
||||
snd_pcm_hw_params_set_buffer_size := dlsym(Libhandle, 'snd_pcm_hw_params_set_buffer_size');
|
||||
snd_pcm_hw_params_set_buffer_size_near := dlsym(Libhandle, 'snd_pcm_hw_params_set_buffer_size_near');
|
||||
snd_pcm_hw_params_set_channels := dlsym(Libhandle, 'snd_pcm_hw_params_set_channels');
|
||||
snd_pcm_hw_params_set_format := dlsym(Libhandle, 'snd_pcm_hw_params_set_format');
|
||||
snd_pcm_hw_params_set_period_size_near := dlsym(Libhandle, 'snd_pcm_hw_params_set_period_size_near');
|
||||
snd_pcm_hw_params_set_periods_near := dlsym(Libhandle, 'snd_pcm_hw_params_set_periods_near');
|
||||
snd_pcm_hw_params_set_rate_near := dlsym(Libhandle, 'snd_pcm_hw_params_set_rate_near');
|
||||
snd_pcm_hw_params := dlsym(Libhandle, 'snd_pcm_hw_params');
|
||||
snd_pcm_hw_params_free := dlsym(Libhandle, 'snd_pcm_hw_params_free');
|
||||
snd_pcm_info_get_device := dlsym(Libhandle, 'snd_pcm_info_get_device');
|
||||
snd_pcm_info_get_name := dlsym(Libhandle, 'snd_pcm_info_get_name');
|
||||
snd_pcm_info_set_device := dlsym(Libhandle, 'snd_pcm_info_set_device');
|
||||
snd_pcm_mmap_readi := dlsym(Libhandle, 'snd_pcm_mmap_readi');
|
||||
snd_pcm_mmap_writei := dlsym(Libhandle, 'snd_pcm_mmap_writei');
|
||||
snd_pcm_open := dlsym(Libhandle, 'snd_pcm_open');
|
||||
snd_pcm_pause := dlsym(Libhandle, 'snd_pcm_pause');
|
||||
snd_pcm_prepare := dlsym(Libhandle, 'snd_pcm_prepare');
|
||||
snd_pcm_readi := dlsym(Libhandle, 'snd_pcm_readi');
|
||||
snd_pcm_reset := dlsym(Libhandle, 'snd_pcm_reset');
|
||||
snd_pcm_resume := dlsym(Libhandle, 'snd_pcm_resume');
|
||||
snd_pcm_state := dlsym(Libhandle, 'snd_pcm_state');
|
||||
snd_pcm_stream := dlsym(Libhandle, 'snd_pcm_stream');
|
||||
snd_pcm_writei := dlsym(Libhandle, 'snd_pcm_writei');
|
||||
end;
|
||||
|
||||
finalization
|
||||
|
||||
if Libhandle <> nil then dlclose(Libhandle);
|
||||
|
||||
|
||||
end.
|
256
acs/Src/drivers/linux/libao.pas
Normal file
256
acs/Src/drivers/linux/libao.pas
Normal file
@@ -0,0 +1,256 @@
|
||||
(*
|
||||
kylix header for libao library.
|
||||
translated from ao.h header file
|
||||
by andrei borovsky, aborovsky@mtu-net.ru
|
||||
the original header is
|
||||
original copyright (c) aaron holtzman - may 1999
|
||||
modifications copyright (c) stan seibert - july 2000, july 2001
|
||||
more modifications copyright (c) jack moffitt - october 2000
|
||||
*)
|
||||
|
||||
{
|
||||
$Log: libao.pas,v $
|
||||
Revision 1.2 2006/01/01 18:46:40 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.1 2005/12/19 18:36:16 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.1 2005/09/14 21:19:37 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 libao;
|
||||
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}
|
||||
{$endif}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
baseunix,dl, ACS_Procs;
|
||||
|
||||
var
|
||||
LibaoLoaded : Boolean = False;
|
||||
|
||||
const
|
||||
|
||||
LibaoPath = 'libao.so*'; // '/usr/lib/libao.so';
|
||||
{$DEFINE SEARCH_LIBS}
|
||||
|
||||
AO_TYPE_LIVE = 1;
|
||||
AO_TYPE_FILE = 2;
|
||||
AO_ENODRIVER = 1;
|
||||
AO_ENOTFILE = 2;
|
||||
AO_ENOTLIVE = 3;
|
||||
AO_EBADOPTION = 4;
|
||||
AO_EOPENDEVICE = 5;
|
||||
AO_EOPENFILE = 6;
|
||||
AO_EFILEEXISTS = 7;
|
||||
|
||||
AO_EFAIL = 100;
|
||||
|
||||
AO_FMT_LITTLE = 1;
|
||||
AO_FMT_BIG = 2;
|
||||
AO_FMT_NATIVE = 4;
|
||||
|
||||
type
|
||||
|
||||
PPChar = array[0..0] of PChar;
|
||||
|
||||
PAOInfo = ^ao_info;
|
||||
PPAOInfo = ^PAOInfo;
|
||||
ao_info = record
|
||||
_type : Integer; // live output or file output?
|
||||
name : PChar; // full name of driver
|
||||
short_name : PChar; // short name of driver */
|
||||
author : PChar; // driver author
|
||||
comment : PChar; // driver comment
|
||||
preferred_byte_format : Integer;
|
||||
priority : Integer;
|
||||
options : PPChar;
|
||||
option_count : Integer;
|
||||
end;
|
||||
|
||||
PAOFunctions = ^ao_functions;
|
||||
|
||||
PAODevice = ^ao_device;
|
||||
ao_device = packed record
|
||||
_type : Integer; // live output or file output?
|
||||
driver_id : Integer;
|
||||
funcs : PAOFunctions;
|
||||
_file : Pointer; // File for output if this is a file driver
|
||||
client_byte_format : Integer;
|
||||
machine_byte_format : Integer;
|
||||
driver_byte_format : Integer;
|
||||
swap_buffer : PChar;
|
||||
swap_buffer_size : Integer; // Bytes allocated to swap_buffer
|
||||
internal : Pointer; // Pointer to driver-specific data
|
||||
end;
|
||||
|
||||
PAOSampleFormat = ^ao_sample_format;
|
||||
ao_sample_format = record
|
||||
bits : Integer; // bits per sample
|
||||
rate : Integer; // samples per second (in a single channel)
|
||||
channels : Integer; // number of audio channels
|
||||
byte_format : Integer; // Byte ordering in sample, see constants below
|
||||
end;
|
||||
|
||||
f_test = function : Integer; cdecl;
|
||||
f_driver_info = function : PAOInfo; cdecl;
|
||||
f_device_init = function(device : PAODevice) : Integer; cdecl;
|
||||
f_set_option = function(device : PAODevice; const key, value : PChar) : Integer; cdecl;
|
||||
f_open = function(device : PAODevice) : Integer; cdecl;
|
||||
f_play = function(device : PAODevice; const output_samples : PChar; num_bytes : LongWord) : Integer; cdecl;
|
||||
f_close = function(device : PAODevice) : Integer; cdecl;
|
||||
f_device_clear = procedure(device : PAODevice); cdecl;
|
||||
f_file_extension = function : PChar; cdecl;
|
||||
|
||||
ao_functions = packed record
|
||||
test : f_test;
|
||||
driver_info : f_driver_info;
|
||||
device_init : f_device_init;
|
||||
set_option : f_set_option;
|
||||
open : f_open;
|
||||
play : f_play;
|
||||
close : f_close;
|
||||
device_clear : f_device_clear;
|
||||
file_extension : f_file_extension;
|
||||
end;
|
||||
|
||||
PPAOOption = ^PAOOption;
|
||||
PAOOption = ^ao_option;
|
||||
ao_option = record
|
||||
key : PChar;
|
||||
value : PChar;
|
||||
next : PAOOption;
|
||||
end;
|
||||
|
||||
(* --- Functions --- *)
|
||||
|
||||
(* library setup/teardown *)
|
||||
|
||||
ao_initialize_t = procedure; cdecl;
|
||||
ao_shutdown_t = procedure; cdecl;
|
||||
|
||||
(* device setup/playback/teardown *)
|
||||
ao_append_option_t = function(options : PPAOOption; const key, value : PChar) : Integer; cdecl;
|
||||
ao_free_options_t = procedure(options : PAOOption); cdecl;
|
||||
ao_open_live_t = function(driver_id : Integer; format : PAOSampleFormat; option : PAOOption) : PAODevice; cdecl;
|
||||
ao_open_file_t = function(driver_id : Integer; const filename : PChar; overwrite : Integer; format : PAOSampleFormat; option : PAOOption) : PAODevice; cdecl;
|
||||
|
||||
ao_play_t = function(device : PAODevice; output_samples : PChar; num_bytes : LongWord) : Integer; cdecl;
|
||||
ao_close_t = function(device : PAODevice) : Integer; cdecl;
|
||||
|
||||
(* driver information *)
|
||||
ao_driver_id_t = function(const short_name : PChar) : Integer; cdecl;
|
||||
ao_default_driver_id_t = function : Integer; cdecl;
|
||||
ao_driver_info_t = function(driver_id : Integer) : PAOInfo; cdecl;
|
||||
ao_driver_info_list_t = function(var driver_count : Integer) : PPAOInfo; cdecl;
|
||||
// The following function is declared in ao.h but not exported by libao.
|
||||
//ao_file_extension_t = function(driver_id : Integer) : PChar; cdecl;
|
||||
|
||||
(* miscellaneous *)
|
||||
ao_is_big_endian_t = function : Integer; cdecl;
|
||||
|
||||
var
|
||||
|
||||
ao_initialize : ao_initialize_t;
|
||||
ao_shutdown : ao_shutdown_t;
|
||||
ao_append_option : ao_append_option_t;
|
||||
ao_free_options : ao_free_options_t;
|
||||
ao_open_live : ao_open_live_t;
|
||||
ao_open_file : ao_open_file_t;
|
||||
ao_play : ao_play_t;
|
||||
ao_close : ao_close_t;
|
||||
ao_driver_id : ao_driver_id_t;
|
||||
ao_default_driver_id : ao_default_driver_id_t;
|
||||
ao_driver_info : ao_driver_info_t;
|
||||
ao_driver_info_list : ao_driver_info_list_t;
|
||||
//ao_file_extension : ao_file_extension_t;
|
||||
ao_is_big_endian : ao_is_big_endian_t;
|
||||
|
||||
AOInitialized : Integer = 0;
|
||||
|
||||
procedure FreeOptionsList(var OL : PAOOption);
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
Libhandle : Pointer;
|
||||
|
||||
{$IFDEF SEARCH_LIBS}
|
||||
Path : String;
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
procedure FreeOptionsList(var OL : PAOOption);
|
||||
var
|
||||
NextOpt, tmp : PAOOption;
|
||||
begin
|
||||
if OL = nil then Exit;
|
||||
NextOpt := OL;
|
||||
repeat
|
||||
tmp := NextOpt;
|
||||
NextOpt := NextOpt.next;
|
||||
FreeMem(tmp);
|
||||
until NextOpt = nil;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
{$IFDEF SEARCH_LIBS}
|
||||
|
||||
Libhandle := nil;
|
||||
Path := FindLibs(LibaoPath);
|
||||
if Path <> '' then Libhandle := dlopen(@Path[1], RTLD_NOW or RTLD_GLOBAL);
|
||||
|
||||
{$ELSE}
|
||||
|
||||
Libhandle := dlopen(LibaoPath, RTLD_NOW or RTLD_GLOBAL);
|
||||
|
||||
{$ENDIF}
|
||||
|
||||
if Libhandle <> nil then
|
||||
begin
|
||||
LibaoLoaded := True;
|
||||
ao_initialize := dlsym(Libhandle, 'ao_initialize');
|
||||
ao_shutdown := dlsym(Libhandle, 'ao_shutdown');
|
||||
ao_append_option := dlsym(Libhandle, 'ao_append_option');
|
||||
ao_free_options := dlsym(Libhandle, 'ao_free_options');
|
||||
ao_open_live := dlsym(Libhandle, 'ao_open_live');
|
||||
ao_open_file := dlsym(Libhandle, 'ao_open_file');
|
||||
ao_play := dlsym(Libhandle, 'ao_play');
|
||||
ao_close := dlsym(Libhandle, 'ao_close');
|
||||
ao_driver_id := dlsym(Libhandle, 'ao_driver_id');
|
||||
ao_default_driver_id := dlsym(Libhandle, 'ao_default_driver_id');
|
||||
ao_driver_info := dlsym(Libhandle, 'ao_driver_info');
|
||||
ao_driver_info_list := dlsym(Libhandle, 'ao_driver_info_list');
|
||||
//ao_file_extension := dlsym(Libhandle, 'ao_file_extension');
|
||||
ao_is_big_endian := dlsym(Libhandle, 'ao_is_big_endian');
|
||||
end;
|
||||
|
||||
finalization
|
||||
|
||||
if Libhandle <> nil then
|
||||
begin
|
||||
dlclose(Libhandle);
|
||||
end;
|
||||
|
||||
end.
|
515
acs/Src/drivers/linux/soundcard.pas
Normal file
515
acs/Src/drivers/linux/soundcard.pas
Normal file
@@ -0,0 +1,515 @@
|
||||
(*
|
||||
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: soundcard.pas,v $
|
||||
Revision 1.1 2005/12/19 18:36:16 z0m3ie
|
||||
*** empty log message ***
|
||||
|
||||
Revision 1.1 2005/09/14 21:19:37 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 soundcard;
|
||||
|
||||
interface
|
||||
|
||||
|
||||
// Supported card ID numbers (OBSOLETE. NOT USED ANY MORE)
|
||||
|
||||
const
|
||||
|
||||
SNDCARD_ADLIB = 1;
|
||||
SNDCARD_SB = 2;
|
||||
SNDCARD_PAS = 3;
|
||||
SNDCARD_GUS = 4;
|
||||
SNDCARD_MPU401 = 5;
|
||||
SNDCARD_SB16 = 6;
|
||||
SNDCARD_SB16MIDI = 7;
|
||||
SNDCARD_UART6850 = 8;
|
||||
SNDCARD_GUS16 = 9;
|
||||
SNDCARD_MSS = 10;
|
||||
SNDCARD_PSS = 11;
|
||||
SNDCARD_SSCAPE = 12;
|
||||
SNDCARD_PSS_MPU = 13;
|
||||
SNDCARD_PSS_MSS = 14;
|
||||
SNDCARD_SSCAPE_MSS = 15;
|
||||
SNDCARD_TRXPRO = 16;
|
||||
SNDCARD_TRXPRO_SB = 17;
|
||||
SNDCARD_TRXPRO_MPU = 18;
|
||||
SNDCARD_MAD16 = 19;
|
||||
SNDCARD_MAD16_MPU = 20;
|
||||
SNDCARD_CS4232 = 21;
|
||||
SNDCARD_CS4232_MPU = 22;
|
||||
SNDCARD_MAUI = 23;
|
||||
SNDCARD_PSEUDO_MSS = 24;
|
||||
SNDCARD_GUSPNP = 25;
|
||||
SNDCARD_UART401 = 26;
|
||||
|
||||
// Sound card numbers 27 to N are reserved. Don't add more numbers here
|
||||
|
||||
//**********************************
|
||||
|
||||
// IOCTL commands for /dev/dsp and /dev/audio
|
||||
|
||||
const
|
||||
|
||||
SNDCTL_DSP_RESET = $5000;
|
||||
SNDCTL_DSP_SPEED = $c0045002;
|
||||
SNDCTL_DSP_STEREO = $c0045003;
|
||||
SNDCTL_DSP_GETBLKSIZE = $c0045004;
|
||||
SNDCTL_DSP_SAMPLESIZE = $c0045005;
|
||||
SNDCTL_DSP_CHANNELS = $c0045006;
|
||||
SOUND_PCM_WRITE_CHANNELS = $c0045006;
|
||||
SOUND_PCM_WRITE_FILTER = $c0045007;
|
||||
SNDCTL_DSP_POST = $5008;
|
||||
SNDCTL_DSP_SUBDIVIDE = $c0045009;
|
||||
SNDCTL_DSP_SETFRAGMENT = $c004500a;
|
||||
|
||||
// Audio data formats (Note! U8=8 and S16_LE=16 for compatibility)*/ }
|
||||
|
||||
SNDCTL_DSP_GETFMTS = $8004500b;
|
||||
SNDCTL_DSP_SETFMT = $c0045005;
|
||||
|
||||
AFMT_QUERY = 0;
|
||||
AFMT_MU_LAW = 1;
|
||||
AFMT_A_LAW = 2;
|
||||
AFMT_IMA_ADPCM = 4;
|
||||
AFMT_U8 = 8;
|
||||
AFMT_S16_LE = $10;
|
||||
AFMT_S16_BE = $20;
|
||||
AFMT_S8 = $40;
|
||||
AFMT_U16_LE = $80;
|
||||
AFMT_U16_BE = $100;
|
||||
AFMT_MPEG = $200;
|
||||
|
||||
// 32 bit formats (MSB aligned) formats
|
||||
|
||||
AFMT_S32_LE = $1000;
|
||||
AFMT_S32_BE = $2000;
|
||||
|
||||
// AC3 _compressed_ bitstreams (See Programmer's Guide for details).
|
||||
|
||||
AFMT_AC3 = $4000;
|
||||
|
||||
// 24 bit formats (LSB aligned in 32 bit word) formats*/ }
|
||||
AFMT_S24_LE = $8000;
|
||||
AFMT_S24_BE = $10000;
|
||||
|
||||
(* S/PDIF raw format. In this format the S/PDIF frames (including all
|
||||
control and user bits) are included in the data stream. Each sample
|
||||
is stored in a 32 bit frame (see IEC-958 for more info). This format
|
||||
is supported by very few devices and it's only usable for purposes
|
||||
where full access to the control/user bits is required (real time control).
|
||||
*)
|
||||
|
||||
AFMT_SPDIF_RAW = $20000;
|
||||
|
||||
type
|
||||
audio_buf_info = record
|
||||
fragments: Integer; // of available fragments (partially usend ones not counted)
|
||||
fragstotal: Integer; // Total # of fragments allocated
|
||||
fragsize: Integer; // Size of a fragment in bytes
|
||||
bytes: Integer; // Available space in bytes (includes partially used fragments)
|
||||
// Note! 'bytes' could be more than fragments*fragsize*/
|
||||
end;
|
||||
|
||||
const
|
||||
|
||||
SNDCTL_DSP_GETOSPACE = $8010500c;
|
||||
SNDCTL_DSP_GETISPACE = $8010500d;
|
||||
SNDCTL_DSP_NONBLOCK = $500e;
|
||||
SNDCTL_DSP_GETCAPS = $8004500f;
|
||||
|
||||
DSP_CAP_REVISION = $ff; // Bits for revision level (0 to 255)
|
||||
DSP_CAP_DUPLEX = $100; // Full duplex record/playback
|
||||
DSP_CAP_REALTIME = $200; // Not in use
|
||||
DSP_CAP_BATCH = $400; (* Device has some kind of
|
||||
internal buffers which may
|
||||
cause some delays and
|
||||
decrease precision of timing *)
|
||||
|
||||
DSP_CAP_COPROC = $800; // Has a coprocessor
|
||||
(* Sometimes it's a DSP
|
||||
but usually not *)
|
||||
|
||||
DSP_CAP_TRIGGER = $1000; // Supports SETTRIGGER
|
||||
DSP_CAP_MMAP = $2000; // Supports mmap()
|
||||
DSP_CAP_MULTI = $4000; // Supports multiple open
|
||||
DSP_CAP_BIND = $8000; // Supports binding to front/rear/center/lfe
|
||||
DSP_CAP_INPUT = $10000; // Supports recording
|
||||
DSP_CAP_OUTPUT = $20000; // Supports playback
|
||||
DSP_CAP_VIRTUAL = $40000; // Virtuial device
|
||||
// Analog/digital control capabilities
|
||||
DSP_CAP_ANALOGOUT = $100000;
|
||||
DSP_CAP_ANALOGIN = $200000;
|
||||
DSP_CAP_DIGITALOUT = $400000;
|
||||
DSP_CAP_DIGITALIN = $800000;
|
||||
DSP_CAP_ADMASK = $f00000;
|
||||
(* NOTE! (capabilities & DSP_CAP_ADMASK)==0 means just that the
|
||||
digital/analog interface control features are not supported by the
|
||||
device/driver. However the device still supports analog, digital or
|
||||
both inputs/outputs (depending on the device). See the OSS Programmer's
|
||||
Guide for full details. *)
|
||||
|
||||
SNDCTL_DSP_GETTRIGGER = $80045010;
|
||||
SNDCTL_DSP_SETTRIGGER = $40045010;
|
||||
|
||||
PCM_ENABLE_INPUT = 1;
|
||||
PCM_ENABLE_OUTPUT = 2;
|
||||
|
||||
type
|
||||
count_info = record
|
||||
bytes: Integer; // Total # of bytes processed
|
||||
blocks : Integer; // # of fragment transitions since last time
|
||||
ptr: Integer; // Current DMA pointer value }
|
||||
end;
|
||||
|
||||
const
|
||||
SNDCTL_DSP_GETIPTR = $800c5011;
|
||||
SNDCTL_DSP_GETOPTR = $800c5012;
|
||||
|
||||
type
|
||||
buffmem_desc = record
|
||||
buffer: PWord;
|
||||
size: Integer;
|
||||
end;
|
||||
|
||||
const
|
||||
SNDCTL_DSP_MAPINBUF = $80085013;
|
||||
SNDCTL_DSP_MAPOUTBUF = $80085014;
|
||||
SNDCTL_DSP_SETSYNCRO = $5015;
|
||||
SNDCTL_DSP_SETDUPLEX = $5016;
|
||||
|
||||
// Application's profile defines the way how playback underrun situations should be handled.
|
||||
|
||||
(* APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
|
||||
playback buffer whenever an underrun occurs. This consumes some time
|
||||
prevents looping the existing buffer.
|
||||
APF_CPUINTENS is intended to be set by CPU intensive applications which
|
||||
are likely to run out of time occasionally. In this mode the buffer cleanup is
|
||||
disabled which saves CPU time but also let's the previous buffer content to
|
||||
be played during the "pause" after the underrun. *)
|
||||
|
||||
const
|
||||
SNDCTL_DSP_PROFILE = $40045017;
|
||||
|
||||
APF_NORMAL = 0; // Normal applications
|
||||
APF_NETWORK = 1; // Underruns probably caused by an 'external' delay
|
||||
APF_CPUINTENS = 2; // Underruns probably caused by 'overheating' the CPU
|
||||
|
||||
SNDCTL_DSP_GETODELAY = $80045017;
|
||||
|
||||
|
||||
type
|
||||
audio_errinfo = record
|
||||
play_underruns: Integer;
|
||||
rec_overruns: Integer;
|
||||
play_ptradjust: Word;
|
||||
rec_ptradjust: Word;
|
||||
play_errorcount: Integer;
|
||||
rec_errorcount: Integer;
|
||||
play_lasterror: Integer;
|
||||
rec_lasterror: Integer;
|
||||
play_errorparm: LongInt;
|
||||
rec_errorparm: LongInt;
|
||||
filler: array[0..15] of Integer;
|
||||
end;
|
||||
|
||||
|
||||
type
|
||||
oss_digital_control = record
|
||||
caps: LongWord; // To be defined }
|
||||
valid : LongWord;
|
||||
cbitin: array[0..23] of Byte;
|
||||
ubitin: array[0..23] of Byte;
|
||||
cbitout: array[0..23] of Byte;
|
||||
ubitout: array[0..23] of Byte;
|
||||
outsel: LongWord;
|
||||
in_data: Integer; // Audio/data if autodetectable by the receiver
|
||||
in_locked: Integer; // Receiver locked
|
||||
in_quality: Integer; // Input signal quality
|
||||
in_vbit, out_vbit: Integer; // V bits
|
||||
in_errors: LongWord; // Various input errro conditions
|
||||
end;
|
||||
|
||||
const
|
||||
|
||||
DIG_CBITIN_LIMITED = $00000001;
|
||||
DIG_CBITIN_DATA = $00000002;
|
||||
DIG_CBITIN_BYTE0 = $00000004;
|
||||
DIG_CBITIN_FULL = $00000008;
|
||||
DIG_CBITIN_MASK = $0000000;
|
||||
DIG_CBITOUT_LIMITED = $00000010;
|
||||
DIG_CBITOUT_BYTE0 = $00000020;
|
||||
DIG_CBITOUT_FULL = $00000040;
|
||||
DIG_CBITOUT_DATA = $00000080;
|
||||
DIG_CBITOUT_MASK = $000000f0;
|
||||
DIG_UBITIN = $00000100;
|
||||
DIG_UBITOUT = $00000200;
|
||||
|
||||
VAL_CBITIN = $01;
|
||||
VAL_UBITIN = $02;
|
||||
VAL_CBITOUT = $04;
|
||||
VAL_UBITOUT = $08;
|
||||
VAL_ISTATUS = $10;
|
||||
|
||||
OUTSEL_DIGITAL = 1;
|
||||
OUTSEL_ANALOG = 2;
|
||||
OUTSEL_BOTH = (OUTSEL_DIGITAL or OUTSEL_ANALOG);
|
||||
|
||||
IND_UNKNOWN = 0;
|
||||
IND_AUDIO = 1;
|
||||
IND_DATA = 2;
|
||||
|
||||
LOCK_NOT_INDICATED = 0;
|
||||
LOCK_UNLOCKED = 1;
|
||||
LOCK_LOCKED = 2;
|
||||
IN_QUAL_NOT_INDICATED = 0;
|
||||
IN_QUAL_POOR = 1;
|
||||
IN_QUAL_GOOD = 2;
|
||||
|
||||
VBIT_NOT_INDICATED = 0;
|
||||
VBIT_OFF = 1;
|
||||
VBIT_ON = 2;
|
||||
|
||||
INERR_CRC = $0001;
|
||||
INERR_QCODE_CRC = $0002;
|
||||
INERR_PARITY = $0004;
|
||||
INERR_BIPHASE = $0008;
|
||||
|
||||
type
|
||||
oss_syncgroup = record
|
||||
id: Integer;
|
||||
mode: Integer;
|
||||
end;
|
||||
|
||||
const
|
||||
|
||||
SNDCTL_DSP_GETCHANNELMASK = $c0045040;
|
||||
SNDCTL_DSP_BIND_CHANNEL = $c0045041;
|
||||
|
||||
DSP_BIND_QUERY = 0;
|
||||
DSP_BIND_FRONT = 1;
|
||||
DSP_BIND_SURR = 2;
|
||||
DSP_BIND_CENTER_LFE = 4;
|
||||
DSP_BIND_HANDSET = 8;
|
||||
DSP_BIND_MIC = $10;
|
||||
DSP_BIND_MODEM1 = $20;
|
||||
DSP_BIND_MODEM2 = $40;
|
||||
DSP_BIND_I2S = $80;
|
||||
DSP_BIND_SPDIF = $100;
|
||||
|
||||
// Mixer devices
|
||||
|
||||
(* There can be up to 20 different analog mixer channels. The }
|
||||
SOUND_MIXER_NRDEVICES gives the currently supported maximum.
|
||||
The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
|
||||
the devices supported by the particular mixer.
|
||||
*)
|
||||
|
||||
const
|
||||
|
||||
SOUND_MIXER_NRDEVICES = 28;
|
||||
SOUND_MIXER_VOLUME = 0;
|
||||
SOUND_MIXER_BASS = 1;
|
||||
SOUND_MIXER_TREBLE = 2;
|
||||
SOUND_MIXER_SYNTH = 3;
|
||||
SOUND_MIXER_PCM = 4;
|
||||
SOUND_MIXER_SPEAKER = 5;
|
||||
SOUND_MIXER_LINE = 6;
|
||||
SOUND_MIXER_MIC = 7;
|
||||
SOUND_MIXER_CD = 8;
|
||||
SOUND_MIXER_IMIX = 9; // Recording monitor
|
||||
SOUND_MIXER_ALTPCM = 10;
|
||||
SOUND_MIXER_RECLEV = 11; // Recording level
|
||||
SOUND_MIXER_IGAIN = 12; // Input gain
|
||||
SOUND_MIXER_OGAIN = 13; // Output gain
|
||||
|
||||
(* The AD1848 codec and compatibles have three line level inputs
|
||||
(line, aux1 and aux2). Since each card manufacturer have assigned
|
||||
different meanings to these inputs, it's inpractical to assign
|
||||
specific meanings (line, cd, synth etc.) to them. *)
|
||||
|
||||
SOUND_MIXER_LINE1 = 14; // Input source 1 (aux1)
|
||||
SOUND_MIXER_LINE2 = 15; // Input source 2 (aux2)
|
||||
SOUND_MIXER_LINE3 = 16; // Input source 3 (line)
|
||||
SOUND_MIXER_DIGITAL1 = 17; // Digital (input)
|
||||
SOUND_MIXER_DIGITAL2 = 18; // Digital (input) 2
|
||||
SOUND_MIXER_DIGITAL3 = 19; // Digital (input) 3
|
||||
SOUND_MIXER_PHONEIN = 20; // Phone input
|
||||
SOUND_MIXER_PHONEOUT = 21; // Phone output
|
||||
SOUND_MIXER_VIDEO = 22; // Video/TV (audio) in
|
||||
SOUND_MIXER_RADIO = 23; // Radio in
|
||||
SOUND_MIXER_MONITOR = 24; // Monitor (usually mic) volume
|
||||
SOUND_MIXER_DEPTH = 25; // 3D 'depth'/'space' parameter
|
||||
SOUND_MIXER_CENTER = 26; // 3D 'center' parameter
|
||||
SOUND_MIXER_MIDI = 27; // Alternative for 'synth'
|
||||
|
||||
(* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX)
|
||||
Not counted to SOUND_MIXER_NRDEVICES, but use the same number space *)
|
||||
|
||||
SOUND_ONOFF_MIN = 28;
|
||||
SOUND_ONOFF_MAX = 30;
|
||||
|
||||
// Note! Number 31 cannot be used since the sign bit is reserved
|
||||
|
||||
SOUND_MIXER_NONE = 31;
|
||||
|
||||
(* The following unsupported macros are no longer functional.
|
||||
Use SOUND_MIXER_PRIVATE# macros in future. *)
|
||||
|
||||
SOUND_MIXER_ENHANCE = SOUND_MIXER_NONE;
|
||||
SOUND_MIXER_MUTE = SOUND_MIXER_NONE;
|
||||
SOUND_MIXER_LOUD = SOUND_MIXER_NONE;
|
||||
|
||||
|
||||
|
||||
SOUND_DEVICE_LABELS : array[0..27] of PChar = ('Vol ', 'Bass ', 'Trebl', 'Synth', 'Pcm ', 'Spkr ', 'Line ',
|
||||
'Mic ', 'CD ', 'Mix ', 'Pcm2 ', 'Rec ', 'IGain', 'OGain',
|
||||
'Line1', 'Line2', 'Line3', 'Digital1', 'Digital2', 'Digital3',
|
||||
'PhoneIn', 'PhoneOut', 'Video', 'Radio', 'Monitor',
|
||||
'Depth', 'Center', 'MIDI');
|
||||
|
||||
|
||||
SOUND_DEVICE_NAMES : array[0..27] of PChar = ('vol', 'bass', 'treble', 'synth', 'pcm', 'speaker', 'line',
|
||||
'mic', 'cd', 'mix', 'pcm2', 'rec', 'igain', 'ogain',
|
||||
'line1', 'line2', 'line3', 'dig1', 'dig2', 'dig3',
|
||||
'phin', 'phout', 'video', 'radio', 'monitor',
|
||||
'depth', 'center', 'midi');
|
||||
|
||||
// Device bitmask identifiers
|
||||
|
||||
SOUND_MIXER_RECSRC = $ff; // Arg contains a bit for each recording source
|
||||
SOUND_MIXER_DEVMASK = $fe; // Arg contains a bit for each supported device
|
||||
SOUND_MIXER_RECMASK = $fd; // Arg contains a bit for each supported recording source
|
||||
SOUND_MIXER_CAPS = $fc;
|
||||
SOUND_CAP_EXCL_INPUT = $1; // Only one recording source at a time
|
||||
|
||||
SOUND_MIXER_STEREODEVS = $fb; // Mixer channels supporting stereo
|
||||
|
||||
// OSS/Free ONLY
|
||||
SOUND_MIXER_OUTSRC = $fa; // Arg contains a bit for each input source to output
|
||||
SOUND_MIXER_OUTMASK = $f9; // Arg contains a bit for each supported input source to output
|
||||
// OSS/Free ONLY
|
||||
|
||||
// Device mask bits
|
||||
|
||||
SOUND_MASK_VOLUME = 1 shl SOUND_MIXER_VOLUME;
|
||||
SOUND_MASK_BASS = 1 shl SOUND_MIXER_BASS;
|
||||
SOUND_MASK_TREBLE = 1 shl SOUND_MIXER_TREBLE;
|
||||
SOUND_MASK_SYNTH = 1 shl SOUND_MIXER_SYNTH;
|
||||
SOUND_MASK_PCM = 1 shl SOUND_MIXER_PCM;
|
||||
SOUND_MASK_SPEAKER = 1 shl SOUND_MIXER_SPEAKER;
|
||||
SOUND_MASK_LINE = 1 shl SOUND_MIXER_LINE;
|
||||
SOUND_MASK_MIC = 1 shl SOUND_MIXER_MIC;
|
||||
SOUND_MASK_CD = 1 shl SOUND_MIXER_CD;
|
||||
SOUND_MASK_IMIX = 1 shl SOUND_MIXER_IMIX;
|
||||
SOUND_MASK_ALTPCM = 1 shl SOUND_MIXER_ALTPCM;
|
||||
SOUND_MASK_RECLEV = 1 shl SOUND_MIXER_RECLEV;
|
||||
SOUND_MASK_IGAIN = 1 shl SOUND_MIXER_IGAIN;
|
||||
SOUND_MASK_OGAIN = 1 shl SOUND_MIXER_OGAIN;
|
||||
SOUND_MASK_LINE1 = 1 shl SOUND_MIXER_LINE1;
|
||||
SOUND_MASK_LINE2 = 1 shl SOUND_MIXER_LINE2;
|
||||
SOUND_MASK_LINE3 = 1 shl SOUND_MIXER_LINE3;
|
||||
SOUND_MASK_DIGITAL1 = 1 shl SOUND_MIXER_DIGITAL1;
|
||||
SOUND_MASK_DIGITAL2 = 1 shl SOUND_MIXER_DIGITAL2;
|
||||
SOUND_MASK_DIGITAL3 = 1 shl SOUND_MIXER_DIGITAL3;
|
||||
SOUND_MASK_PHONEIN = 1 shl SOUND_MIXER_PHONEIN;
|
||||
SOUND_MASK_PHONEOUT = 1 shl SOUND_MIXER_PHONEOUT;
|
||||
SOUND_MASK_RADIO = 1 shl SOUND_MIXER_RADIO;
|
||||
SOUND_MASK_VIDEO = 1 shl SOUND_MIXER_VIDEO;
|
||||
SOUND_MASK_MONITOR = 1 shl SOUND_MIXER_MONITOR;
|
||||
SOUND_MASK_DEPTH = 1 shl SOUND_MIXER_DEPTH;
|
||||
SOUND_MASK_CENTER = 1 shl SOUND_MIXER_CENTER;
|
||||
SOUND_MASK_MIDI = 1 shl SOUND_MIXER_MIDI;
|
||||
|
||||
SOUND_MIXER_READ_VOLUME = $80044d00;
|
||||
SOUND_MIXER_READ_BASS = $80044d01;
|
||||
SOUND_MIXER_READ_TREBLE = $80044d02;
|
||||
SOUND_MIXER_READ_SYNTH = $80044d03;
|
||||
SOUND_MIXER_READ_PCM = $80044d04;
|
||||
SOUND_MIXER_READ_SPEAKER = $80044d05;
|
||||
SOUND_MIXER_READ_LINE = $80044d06;
|
||||
SOUND_MIXER_READ_MIC = $80044d07;
|
||||
SOUND_MIXER_READ_CD = $80044d08;
|
||||
SOUND_MIXER_READ_IMIX = $80044d09;
|
||||
SOUND_MIXER_READ_ALTPCM = $80044d0a;
|
||||
SOUND_MIXER_READ_RECLEV = $80044d0b;
|
||||
SOUND_MIXER_READ_IGAIN = $80044d0c;
|
||||
SOUND_MIXER_READ_OGAIN = $80044d0d;
|
||||
SOUND_MIXER_READ_LINE1 = $80044d0e;
|
||||
SOUND_MIXER_READ_LINE2 = $80044d0f;
|
||||
SOUND_MIXER_READ_LINE3 = $80044d10;
|
||||
SOUND_MIXER_READ_RECSRC = $80044dff;
|
||||
SOUND_MIXER_READ_RECMASK = $80044dfd;
|
||||
SOUND_MIXER_READ_DEVMASK = $80044dfe;
|
||||
SOUND_MIXER_READ_STEREODEVS = $80044dfb;
|
||||
SOUND_MIXER_READ_CAPS = $80044dfc;
|
||||
|
||||
SOUND_MIXER_WRITE_VOLUME = $c0044d00;
|
||||
SOUND_MIXER_WRITE_BASS = $c0044d01;
|
||||
SOUND_MIXER_WRITE_TREBLE = $c0044d02;
|
||||
SOUND_MIXER_WRITE_SYNTH = $c0044d03;
|
||||
SOUND_MIXER_WRITE_PCM = $c0044d04;
|
||||
SOUND_MIXER_WRITE_SPEAKER = $c0044d05;
|
||||
SOUND_MIXER_WRITE_LINE = $c0044d06;
|
||||
SOUND_MIXER_WRITE_MIC = $c0044d07;
|
||||
SOUND_MIXER_WRITE_CD = $c0044d08;
|
||||
SOUND_MIXER_WRITE_IMIX = $c0044d09;
|
||||
SOUND_MIXER_WRITE_ALTPCM = $c0044d0a;
|
||||
SOUND_MIXER_WRITE_RECLEV = $c0044d0b;
|
||||
SOUND_MIXER_WRITE_IGAIN = $c0044d0c;
|
||||
SOUND_MIXER_WRITE_OGAIN = $c0044d0d;
|
||||
SOUND_MIXER_WRITE_LINE1 = $c0044d0e;
|
||||
SOUND_MIXER_WRITE_LINE2 = $c0044d0f;
|
||||
SOUND_MIXER_WRITE_LINE3 = $c0044d10;
|
||||
SOUND_MIXER_WRITE_RECSRC = $c0044dff;
|
||||
SOUND_MIXER_INFO = $805c4d65;
|
||||
|
||||
type
|
||||
mixer_info = record
|
||||
id: array[0..15] of Char;
|
||||
name: array[0..31] of Char;
|
||||
modify_counter: Integer;
|
||||
fillers: array[0..9] of Integer;
|
||||
end;
|
||||
|
||||
const
|
||||
SOUND_MIXER_ACCESS = $c0804d66;
|
||||
SOUND_MIXER_GETLEVELS = $c0a44d74;
|
||||
SOUND_MIXER_SETLEVELS = $c0a44d75;
|
||||
|
||||
(* SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
|
||||
for querying current mixer settings from the driver and for loading
|
||||
default volume settings _prior_ activating the mixer (loading
|
||||
doesn't affect current state of the mixer hardware). These calls
|
||||
are for internal use only. *)
|
||||
|
||||
type
|
||||
mixer_vol_table = record
|
||||
num: Integer; // Index to volume table
|
||||
name: array[0..31] of Char;
|
||||
levels: array[0..31] of Integer;
|
||||
end;
|
||||
|
||||
implementation
|
||||
end.
|
Reference in New Issue
Block a user