const
MCI_SETAUDIO= $873;
MCI_SETVIDEO=$0876;
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;
MCI_DGV_SETAUDIO_STREAM=$4003;
MCI_DGV_SETAUDIO_VOLUME=$4002;
MCI_DGV_SETVIDEO_SOURCE=$4009;
MCI_DGV_SETVIDEO_SRC_NTSC=$4000;
MCI_DGV_SETVIDEO_SRC_SVIDEO=4002;
MCI_DGV_SETVIDEO_SRC_PAL=4003;
MCI_DGV_SETAUDIO_LEFT=$200000;
MCI_DGV_SETAUDIO_RIGHT=$400000;
MAX_VOLUME=1000;
MIN_VOLUME=0;
VOLUME_STEP=100;
type MCI_DGV_SETAUDIO_PARMS=record
dwCallback
WORD;
dwItem
WORD;
dwValue
WORD;
dwOver
WORD;
lpstrAlgorithm
Char;
lpstrQuality
Char;
end
procedure tplay_form.volumechange(f:boolean);
var
s: MCI_DGV_SETAUDIO_PARMS
begin
mciSendCommand(MediaPlayer1.DeviceID,MCI_SETAUDIO, MCI_SET_OFF ,integer(@s));
if f then
volume_value:=volume_value+VOLUME_STEP
else
volume_value:=volume_value-VOLUME_STEP;
if volume_value>MAX_VOLUME then
volume_value:=MAX_VOLUME;
if volume_value<MIN_VOLUME then
volume_value:=MIN_VOLUME;
savevolume:=volume_value;
s.dwValue:=savevolume;
s.dwItem:=MCI_DGV_SETAUDIO_VOLUME;
mciSendCommand(MediaPlayer1.DeviceID,MCI_SETAUDIO, MCI_DGV_SETAUDIO_VALUE or MCI_DGV_SETAUDIO_ITEM ,integer(@s));
mciSendCommand(MediaPlayer1.DeviceID,MCI_SETAUDIO, MCI_SET_ON ,integer(@s));
end;