1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| unit horloge;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, MPlayer;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Timer1: TTimer;
MediaPlayer1: TMediaPlayer;
Button1: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var h, min, sec : string ;
begin
edit1.text:=timetostr(time) ;
h:=copy(edit1.Text,0,2) ;
label1.Caption:=h ;
min:=copy(edit1.Text,4,2) ;
label2.Caption:=min ;
sec:=copy(edit1.Text,7,2) ;
label3.Caption:=sec ;
end;
procedure TForm1.Button1Click(Sender: TObject);
var hs, hs2, hs3, mins, secs : string ;
begin
case strtoint(label1.Caption) of
1 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\1.wav' ;
2 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\2.wav' ;
3 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\3.wav' ;
4 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\4.wav' ;
5 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\5.wav' ;
6 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\6.wav' ;
7 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\7.wav' ;
8 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\8.wav' ;
9 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\9.wav' ;
10 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\10.wav' ;
11 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\11.wav' ;
12 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\12.wav' ;
13 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\13.wav' ;
14 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\14.wav' ;
15 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\15.wav' ;
16 : hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\16.wav' ;
17 : begin
hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\10.wav';
hs2:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\7.wav' ;
end;
18 : begin
hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\10.wav' ;
hs2:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\8.wav' ;
end;
19 : begin
hs:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\10.wav' ;
hs2:='C:\Documents and Settings\Jeannot Alpin\Mes documents\Ma musique\SON HORLOGE LE VRAI\9.wav' ;
end;
end ;
mediaplayer1.wait:=true ;
mediaplayer1.FileName:=hs ;
mediaplayer1.open ;
mediaplayer1.Play ;
end;
end. |
Partager