unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, shellapi, mmsystem;
type
TForm1 = class(TForm)
Button1: TButton;
ComboBox1: TComboBox;
Button2: TButton;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
myvolume: array[0..10] of longint;
end;
function capGetDriverDescriptionA(wDriverIndex : UINT;
lpszName : pchar;
cbName : integer;
lpszVer : pchar;
cbVer : integer): bool;
STDCALL EXTERNAL 'AVICAP32.DLL';
var
Form1: TForm1;
implementation
{$R *.dfm}
//获取视频输入设备
procedure TForm1.Button1Click(Sender: TObject);
var
szDeviceName :array [0..160-1] of Char;
szDeviceVersion :array [0.. 80-1] of Char;
i : integer;
begin
szDeviceName:='';
szDeviceVersion:='';
for i:=0 to 10do
begin
if capGetDriverDescriptionA(i,szDeviceName,sizeof(szDeviceName),szDeviceVersion,sizeof(szDeviceVersion)) then
begin
if (ComboBox1.Items.IndexOf(szDeviceName)<0) then
ComboBox1.Items.Add(szDeviceName);
end;
end;
end;
//获取音频输入设备
procedure TForm1.Button2Click(Sender: TObject);
var
Count, i: integer;
FWaveInCaps:TWaveInCaps;
begin
Count:=waveInGetNumDevs;
for i:=0 to Count-1do
begin
waveInGetDevCaps(i,@FWaveInCaps,SizeOf (TWaveInCaps));
if (ComboBox2.Items.IndexOf(FWaveInCaps.szPname)<0) then
ComboBox2.Items.Add(FWaveInCaps.szPname);
end;
end;
//获取音频输出设备
procedure TForm1.Button3Click(Sender: TObject);
var
Count, i: integer;
FWaveOutCaps:TWaveOutCaps;
begin
Count:=waveOutGetNumDevs;
for i:=0 to Count-1do
begin
waveOutGetDevCaps(i,@FWaveOutCaps,SizeOf (FWaveOutCaps));
if (ComboBox3.Items.IndexOf(FWaveOutCaps.szPname)<0) then
ComboBox3.Items.Add(FWaveOutCaps.szPname);
end;
end;
end.