unit func;
interface
uses mmsystem,mplayer,Windows,Classes,Sysutils,Graphics,Jpeg,Registry,
winsock;
const
MCI_SETAUDIO= $873;
MCI_DGV_SETAUDIO_SOURCE_LEFT=1;
MCI_DGV_SETAUDIO_SOURCE_STEREO=0;
MCI_DGV_SETAUDIO_SOURCE_RIGHT=2;
MCI_DGV_SETAUDIO_SOURCE=$4004;
MCI_DGV_SETAUDIO_VALUE=$01000000;
MCI_DGV_SETAUDIO_ITEM=$00800000;
type MCI_DGV_SETAUDIO_PARMS=record
dwCallback
WORD;
dwItem
WORD;
dwValue
WORD;
dwOver
WORD;
lpstrAlgorithm
Char;
lpstrQuality
Char;
end;
TChannels=(Ch_Left,Ch_Right,Ch_Stereo,Ch_Mono);
procedure SwitchChinnel(MPlayer:TMediaplayer;ChSet:TChannels);
function FileLength(FileName:String):Extended;
function FreeSpaceOnTargetDrive(Drive:string):Extended;
function GetCdromDrive: char;
procedure SaveToSpJpeg(var sbitmap: Tbitmap;const DJpegFile: string;
SRect: trect);
procedure SetIP(ipdata:string);
function GetIp:string;
implementation
procedure SwitchChinnel(MPlayer:TMediaplayer;ChSet:TChannels);
var
s: MCI_DGV_SETAUDIO_PARMS
begin
mciSendCommand(MPlayer.DeviceID,MCI_SETAUDIO,MCI_SET_OFF,integer(@s));
case ChSet of
ch_stereo:
s.dwValue:=MCI_DGV_SETAUDIO_SOURCE_STEREO;
//立体声用这句
ch_left:
s.dwValue:=MCI_DGV_SETAUDIO_SOURCE_LEFT;
//右声道源
ch_right:
s.dwValue:=MCI_DGV_SETAUDIO_SOURCE_RIGHT;
//右声道源
end;
s.dwItem:=MCI_DGV_SETAUDIO_SOURCE;
mciSendCommand(MPlayer.DeviceID,MCI_SETAUDIO, MCI_DGV_SETAUDIO_VALUE or MCI_DGV_SETAUDIO_ITEM ,integer(@s));
mciSendCommand(MPlayer.DeviceID,MCI_SETAUDIO, MCI_SET_ON,integer(@s));
end;
end.
快点,拿分来!!!