Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Rhytmus (https://www.delphipraxis.net/40768-rhytmus.html)

gmarts 24. Feb 2005 10:57

Re: Rhytmus
 
Hallo Herr Orhan.
Und wie hast du es jetzt gelöst?

Orhan 24. Feb 2005 16:48

Re: Rhytmus
 
Hallo

So habe ich es ausprobiert, es funktioniert wunderbar.

Danke!

var mmsystem;
procedure Warten(ms: Cardinal);
var zeit: Cardinal;
begin
zeit:= GetTickCount;
while ((GetTickCount-zeit)< ms) do
Application.ProcessMessages;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
const
x:integer=0;
begin
x:=x+1;
panel1.caption:=inttostr(x);
If panel1.caption= '1' then
PlaySound('\1.wav',0,snd_Async);
If panel1.caption='2' then
PlaySound('\2.wav',0,snd_Async);
If panel1.caption='3' then
PlaySound('\3.wav',0,snd_Async);
If panel1.caption='4' then
PlaySound('\4.wav',0,snd_Async);
If panel1.caption='5' then
PlaySound('\5.wav',0,snd_Async);
Warten(1500);//1500 Millisekunden=1,5 Sekunden lang warten
end;

Nikolas 24. Feb 2005 17:00

Re: Rhytmus
 
kleiner Tip für die Lesbarkeit:

Delphi-Quellcode:
x:=x+1;
panel1.caption:=inttostr(x);
If panel1.caption= '1' then
PlaySound('\1.wav',0,snd_Async);
If panel1.caption='2' then
PlaySound('\2.wav',0,snd_Async);
If panel1.caption='3' then
PlaySound('\3.wav',0,snd_Async);
If panel1.caption='4' then
PlaySound('\4.wav',0,snd_Async);
If panel1.caption='5' then
PlaySound('\5.wav',0,snd_Async);

-->
// str: string;

inc(x);
pane11.caption:= inttostr(x);
str:='\'+inttostr(x)+'.wav'
Playsound(str,0,snd_Async);


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:54 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz