📄 unamsacmapi.pas
字号:
function acm_driverOpen(var phad: HACMDRIVER; hadid: HACMDRIVERID; fdwOpen: DWORD): MMRESULT; stdcall;
{$EXTERNALSYM acm_DriverClose }
function acm_driverClose(had: HACMDRIVER; fdwClose: DWORD): MMRESULT; stdcall;
{$EXTERNALSYM acm_DriverMessage }
function acm_driverMessage(had: HACMDRIVER; uMsg: UINT; lParam1: LPARAM; lParam2: LPARAM): LRESULT; stdcall;
const
{$EXTERNALSYM ACMDM_USER }
ACMDM_USER = (DRV_USER + $0000);
{$EXTERNALSYM ACMDM_RESERVED_LOW }
ACMDM_RESERVED_LOW = (DRV_USER + $2000);
{$EXTERNALSYM ACMDM_RESERVED_HIGH }
ACMDM_RESERVED_HIGH = (DRV_USER + $2FFF);
{$EXTERNALSYM ACMDM_BASE }
ACMDM_BASE = ACMDM_RESERVED_LOW;
{$EXTERNALSYM ACMDM_DRIVER_ABOUT }
ACMDM_DRIVER_ABOUT = (ACMDM_BASE + 11);
// -- MSACMDRV.H --
type
//
//
ACMDRVSTREAMINSTANCE = packed record
cbStruct : DWORD;
pwfxSrc : PWAVEFORMATEX;
pwfxDst : PWAVEFORMATEX;
pwfltr : PWAVEFILTER;
dwCallback: DWORD;
dwInstance: DWORD;
fdwOpen : DWORD;
fdwDriver : DWORD;
dwDriver : DWORD;
has : HACMSTREAM;
end;
//
// structure for ACMDM_STREAM_SIZE message
//
//
ACMDRVSTREAMSIZE = packed record
cbStruct: DWORD;
fdwSize: DWORD;
cbSrcLength: DWORD;
cbDstLength: DWORD;
end;
//
// NOTE! this structure must match the ACMSTREAMHEADER in msacm.h but
// defines more information for the driver writing convenience
//
PACMDRVSTREAMHEADER = ^ACMDRVSTREAMHEADER;
ACMDRVSTREAMHEADER = packed record
cbStruct: DWORD;
fdwStatus: DWORD;
dwUser: DWORD;
pbSrc: PBYTE;
cbSrcLength: DWORD;
cbSrcLengthUsed: DWORD;
dwSrcUser: DWORD;
pbDst: PBYTE;
cbDstLength: DWORD;
cbDstLengthUsed: DWORD;
dwDstUser: DWORD;
fdwConvert: DWORD; // flags passed from convert func
padshNext: PACMDRVSTREAMHEADER; // for async driver queueing
fdwDriver: DWORD; // driver instance flags
dwDriver: DWORD; // driver instance data
//
// all remaining fields are used by the ACM for bookkeeping purposes.
// an ACM driver should never use these fields (though than can be
// helpful for debugging)--note that the meaning of these fields
// may change, so do NOT rely on them in shipping code.
//
fdwPrepared: DWORD;
dwPrepared: DWORD;
pbPreparedSrc: PBYTE;
cbPreparedSrcLength: DWORD;
pbPreparedDst: PBYTE;
cbPreparedDstLength: DWORD;
end;
//
// structure containing the information for the ACMDM_FORMAT_SUGGEST message
//
//
ACMDRVFORMATSUGGEST = packed record
cbStruct: DWORD; // sizeof(ACMDRVFORMATSUGGEST)
fdwSuggest: DWORD; // Suggest flags
pwfxSrc: PWAVEFORMATEX; // Source Format
cbwfxSrc: DWORD; // Source Size
pwfxDst: PWAVEFORMATEX; // Dest format
cbwfxDst: DWORD; // Dest Size
end;
const
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
//
// ACM Driver Messages
//
//
//
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
ACMDM_DRIVER_NOTIFY = (ACMDM_BASE + 1);
ACMDM_DRIVER_DETAILS = (ACMDM_BASE + 10);
ACMDM_HARDWARE_WAVE_CAPS_INPUT = (ACMDM_BASE + 20);
ACMDM_HARDWARE_WAVE_CAPS_OUTPUT = (ACMDM_BASE + 21);
ACMDM_FORMATTAG_DETAILS = (ACMDM_BASE + 25);
ACMDM_FORMAT_DETAILS = (ACMDM_BASE + 26);
ACMDM_FORMAT_SUGGEST = (ACMDM_BASE + 27);
ACMDM_FILTERTAG_DETAILS = (ACMDM_BASE + 50);
ACMDM_FILTER_DETAILS = (ACMDM_BASE + 51);
ACMDM_STREAM_OPEN = (ACMDM_BASE + 76);
ACMDM_STREAM_CLOSE = (ACMDM_BASE + 77);
ACMDM_STREAM_SIZE = (ACMDM_BASE + 78);
ACMDM_STREAM_CONVERT = (ACMDM_BASE + 79);
ACMDM_STREAM_RESET = (ACMDM_BASE + 80);
ACMDM_STREAM_PREPARE = (ACMDM_BASE + 81);
ACMDM_STREAM_UNPREPARE = (ACMDM_BASE + 82);
{$EXTERNALSYM acm_DriverPriority }
function acm_driverPriority(hadid: HACMDRIVERID; dwPriority: DWORD; fdwPriority: DWORD): MMRESULT; stdcall;
const
{$EXTERNALSYM ACM_DRIVERPRIORITYF_ENABLE }
ACM_DRIVERPRIORITYF_ENABLE = $00000001;
{$EXTERNALSYM ACM_DRIVERPRIORITYF_DISABLE }
ACM_DRIVERPRIORITYF_DISABLE = $00000002;
{$EXTERNALSYM ACM_DRIVERPRIORITYF_ABLEMASK }
ACM_DRIVERPRIORITYF_ABLEMASK = $00000003;
{$EXTERNALSYM ACM_DRIVERPRIORITYF_BEGIN }
ACM_DRIVERPRIORITYF_BEGIN = $00010000;
{$EXTERNALSYM ACM_DRIVERPRIORITYF_END }
ACM_DRIVERPRIORITYF_END = $00020000;
{$EXTERNALSYM ACM_DRIVERPRIORITYF_DEFERMASK }
ACM_DRIVERPRIORITYF_DEFERMASK = $00030000;
{
ACMDRIVERDETAILS
the ACMDRIVERDETAILS structure is used to get various capabilities from
an ACM driver (codec, converter, filter).
}
{$EXTERNALSYM ACMDRIVERDETAILS_SHORTNAME_CHARS }
ACMDRIVERDETAILS_SHORTNAME_CHARS = 32;
{$EXTERNALSYM ACMDRIVERDETAILS_LONGNAME_CHARS }
ACMDRIVERDETAILS_LONGNAME_CHARS = 128;
{$EXTERNALSYM ACMDRIVERDETAILS_COPYRIGHT_CHARS }
ACMDRIVERDETAILS_COPYRIGHT_CHARS = 80;
{$EXTERNALSYM ACMDRIVERDETAILS_LICENSING_CHARS }
ACMDRIVERDETAILS_LICENSING_CHARS = 128;
{$EXTERNALSYM ACMDRIVERDETAILS_FEATURES_CHARS }
ACMDRIVERDETAILS_FEATURES_CHARS = 512;
type
pACMDRIVERDETAILSA = ^ACMDRIVERDETAILSA;
{$EXTERNALSYM ACMDRIVERDETAILSA }
ACMDRIVERDETAILSA = packed record
cbStruct : DWORD; // number of valid bytes in structure
fccType : FOURCC; // compressor type 'audc'
fccComp : FOURCC; // sub-type (not used; reserved)
wMid : WORD; // manufacturer id
wPid : WORD; // product id
vdwACM : DWORD; // version of the ACM *compiled* for
vdwDriver : DWORD; // version of the driver
fdwSupport : DWORD; // misc. support flags
cFormatTags : DWORD; // total unique format tags supported
cFilterTags : DWORD; // total unique filter tags supported
hicon : HICON; // handle to custom icon
szShortName : array[0..ACMDRIVERDETAILS_SHORTNAME_CHARS - 1] of char;
szLongName : array[0..ACMDRIVERDETAILS_LONGNAME_CHARS - 1] of char;
szCopyright : array[0..ACMDRIVERDETAILS_COPYRIGHT_CHARS - 1] of char;
szLicensing : array[0..ACMDRIVERDETAILS_LICENSING_CHARS - 1] of char;
szFeatures : array[0..ACMDRIVERDETAILS_FEATURES_CHARS - 1] of char;
end;
pACMDRIVERDETAILSW = ^ACMDRIVERDETAILSW;
{$EXTERNALSYM ACMDRIVERDETAILSW }
ACMDRIVERDETAILSW = packed record
cbStruct : DWORD; // number of valid bytes in structure
fccType : FOURCC; // compressor type 'audc'
fccComp : FOURCC; // sub-type (not used; reserved)
wMid : WORD; // manufacturer id
wPid : WORD; // product id
vdwACM : DWORD; // version of the ACM *compiled* for
vdwDriver : DWORD; // version of the driver
fdwSupport : DWORD; // misc. support flags
cFormatTags : DWORD; // total unique format tags supported
cFilterTags : DWORD; // total unique filter tags supported
hicon : HICON; // handle to custom icon
szShortName : array[0..ACMDRIVERDETAILS_SHORTNAME_CHARS - 1] of WChar;
szLongName : array[0..ACMDRIVERDETAILS_LONGNAME_CHARS - 1] of WChar;
szCopyright : array[0..ACMDRIVERDETAILS_COPYRIGHT_CHARS - 1] of WChar;
szLicensing : array[0..ACMDRIVERDETAILS_LICENSING_CHARS - 1] of WChar;
szFeatures : array[0..ACMDRIVERDETAILS_FEATURES_CHARS - 1] of WChar;
end;
{$EXTERNALSYM ACMDRIVERDETAILS }
ACMDRIVERDETAILS = ACMDRIVERDETAILSA;
pACMDRIVERDETAILS = pACMDRIVERDETAILSA;
// ACMDRIVERDETAILS.fccType
//
// ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC: the FOURCC used in the fccType
// field of the ACMDRIVERDETAILS structure to specify that this is an ACM
// codec designed for audio.
// ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC = mmioFOURCC('a', 'u', 'd', 'c');
{$EXTERNALSYM ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC }
function ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC(): FOURCC;
const
// ACMDRIVERDETAILS.fccComp
//
// ACMDRIVERDETAILS_FCCCOMP_UNDEFINED: the FOURCC used in the fccComp
// field of the ACMDRIVERDETAILS structure. this is currently an unused
// field.
//
{$EXTERNALSYM ACMDRIVERDETAILS_FCCCOMP_UNDEFINED }
ACMDRIVERDETAILS_FCCCOMP_UNDEFINED = 0;
const
//
// the following flags are used to specify the type of conversion(s) that
// the converter/codec/filter supports. these are placed in the fdwSupport
// field of the ACMDRIVERDETAILS structure. note that a converter can
// support one or more of these flags in any combination.
//
// ACMDRIVERDETAILS_SUPPORTF_CODEC: this flag is set if the driver supports
// conversions from one format tag to another format tag. for example, if a
// converter compresses WAVE_FORMAT_PCM to WAVE_FORMAT_ADPCM, then this bit
// should be set.
//
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_CODEC }
ACMDRIVERDETAILS_SUPPORTF_CODEC = $00000001;
// ACMDRIVERDETAILS_SUPPORTF_CONVERTER: this flags is set if the driver
// supports conversions on the same format tag. as an example, the PCM
// converter that is built into the ACM sets this bit (and only this bit)
// because it converts only PCM formats (bits, sample rate).
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_CONVERTER }
ACMDRIVERDETAILS_SUPPORTF_CONVERTER = $00000002;
// ACMDRIVERDETAILS_SUPPORTF_FILTER: this flag is set if the driver supports
// transformations on a single format. for example, a converter that changed
// the 'volume' of PCM data would set this bit. 'echo' and 'reverb' are
// also filter types.
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_FILTER }
ACMDRIVERDETAILS_SUPPORTF_FILTER = $00000004;
// ACMDRIVERDETAILS_SUPPORTF_HARDWARE: this flag is set if the driver supports
// hardware input and/or output through a waveform device.
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_HARDWARE }
ACMDRIVERDETAILS_SUPPORTF_HARDWARE = $00000008;
// ACMDRIVERDETAILS_SUPPORTF_ASYNC: this flag is set if the driver supports
// async conversions.
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_ASYNC }
ACMDRIVERDETAILS_SUPPORTF_ASYNC = $00000010;
//
// ACMDRIVERDETAILS_SUPPORTF_LOCAL: this flag is set _by the ACM_ if a
// driver has been installed local to the current task. this flag is also
// set in the fdwSupport argument to the enumeration callback function
// for drivers.
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_LOCAL }
ACMDRIVERDETAILS_SUPPORTF_LOCAL = $40000000;
// ACMDRIVERDETAILS_SUPPORTF_DISABLED: this flag is set _by the ACM_ if a
// driver has been disabled. this flag is also passed set in the fdwSupport
// argument to the enumeration callback function for drivers.
{$EXTERNALSYM ACMDRIVERDETAILS_SUPPORTF_DISABLED }
ACMDRIVERDETAILS_SUPPORTF_DISABLED = $80000000;
{$EXTERNALSYM acm_DriverDetailsA }
function acm_driverDetailsA(hadid: hACMDRIVERID; var padd: ACMDRIVERDETAILSA; fdwDetails: DWORD): MMRESULT; stdcall;
{$EXTERNALSYM acm_DriverDetailsW }
function acm_driverDetailsW(hadid: hACMDRIVERID; var padd: ACMDRIVERDETAILSW; fdwDetails: DWORD): MMRESULT; stdcall;
{$EXTERNALSYM acm_DriverDetails }
function acm_driverDetails (hadid: hACMDRIVERID; var padd: ACMDRIVERDETAILS; fdwDetails: DWORD): MMRESULT; stdcall;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -