?? acmdialog.pas
字號:
unit ACMDialog;
interface
uses
msacm,mmsystem,Windows, SysUtils, Classes, Controls, Dialogs;
type
TACMDialog = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
public
function OpenDialog:pointer;
{ Public declarations }
published
{ Published declarations }
end;
var
fc:TACMFORMATCHOOSEA;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Milos', [TACMDialog]);
end;
function TACMDialog.OpenDialog:Pointer;
var maxsizeformat,res:longint;
begin
if fc.pwfx = nil then
begin
acmMetrics(0, ACM_METRIC_MAX_SIZE_FORMAT, MaxSizeFormat);
fc.cbStruct := sizeof(fc);
fc.cbWfx := MaxSizeFormat;
getmem(fc.pwfx, MaxSizeFormat);
fc.pwfx.wFormatTag :=$31; //WAVE_FORMAT_GSM610; set default format to GSM6.10
fc.pwfx.nChannels := 1; //mono
fc.pwfx.nSamplesPerSec := 8000;
fc.pwfx.nAvgBytesPerSec:= 8000; { for buffer estimation }
fc.pwfx.nBlockAlign:=1; { block size of data }
fc.pwfx.wbitspersample := 8;
end;
fc.fdwStyle:=ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT; //use the pwfx(waveformatex structure) as default
res:=acmFormatChoose(fc); //display the ACM dialog box
result:=nil;
if res=MMSYSERR_NOERROR then result:=fc.pwfx; //return the pointer to waveformatex structure
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -