function setmidivolume(volume:DWord):Dword;
var vol:integer;
MyMidiOutCaps: TMidiOutCaps;
begin
vol:=(volume)*65537*257;
if MidiOutGetDevCaps(MIDI_MAPPER,@MyMidiOutCaps,sizeof(MyMidiOutCaps))=MMSYSERR_NOERROR then
//Just make sure your midi device is not error,you can set midi volume without use MidiOutGetDevCaps
begin
MidiOutSetVolume(Midi_MAPPER, MakeLong(vol, vol));//Main code to set midi volume
end;end;
//Function to get wave volume
function getwavevolume:byte;
var
Volume: DWord;
MyWaveOutCaps: TWaveOutCaps;
vol:real;
s:string;
begin
if WaveOutGetDevCaps(WAVE_MAPPER,@MyWaveOutCaps,sizeof(MyWaveOutCaps))=MMSYSERR_NOERROR then
//Just make sure your wave device is not error,you can get wave volume without use WaveOutGetDevCaps
begin
WaveOutGetVolume(WAVE_MAPPER, @Volume);//Main code to get wave volume
vol:=(Volume div 65537 div 257);
s:=floattostr(int(vol));
getwavevolume:=strtoint(s);
end;
end;
//Function to set wave volume
function setwavevolume(volume:DWord):Dword;
var vol:integer;
MyWaveOutCaps: TWaveOutCaps;
begin
vol:=(volume)*65537*257;
if WaveOutGetDevCaps(WAVE_MAPPER,@MyWaveOutCaps,sizeof(MyWaveOutCaps))=MMSYSERR_NOERROR then
//Just make sure your wave device is not error,you can set wave volume without use WaveOutGetDevCaps
begin
WaveOutSetVolume(WAVE_MAPPER, MakeLong(vol, vol));//Main code to set wave volume
end;
end;
UYGULAMA
SES ACIP KAPAMA->SetMediaAudioOn(MediaPlayer1.DeviceId);
CALISTIR-> MediaPlayer1.Open;mediaplayer1.Play;
STOP-> mediaplayer1.PauseOnly;....gibi
2 Nisan 2010 Cuma
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder