unit maincolock;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, MPlayer, AHMClasses, AHMTTimeTrigger, AHMClasses2,
Buttons, lmdctrl, Lmdclock, lmdclass, lmdformA;
type
TYybs = class(TForm)
MediaPlayer1: TMediaPlayer;
AHMTimeTrigger1: TAHMTimeTrigger;
SpeedButton1: TSpeedButton;
LMDClock1: TLMDClock;
LMDFormShadow1: TLMDFormShadow;
procedure AHMTimeTrigger1Trigger(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
//procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Yybs: TYybs;
procedure Playposmdi(strtp,endp:longint);
procedure baoshi;
implementation
{$R *.DFM}
procedure Playposmdi(strtp,endp:longint);
begin
with yybs.MediaPlayer1 do
begin
startpos:=strtp;
endpos:=endp;
try
wait:=true;
play;
finally
end;
end;
end;
procedure baoshi;
var
baoshi:array[0..14,0..2]of longint;
h,m,se,bse:word;
x1:longint;
begin
baoshi[0,1]:=2100; baoshi[0,2]:=2500
baoshi[1,1]:=2600 baoshi[1,2]:=3000
baoshi[2,1]:=3200 baoshi[2,2]:=3600
baoshi[3,1]:=4000 baoshi[3,2]:=4700
baoshi[4,1]:=4700 baoshi[4,2]:=5200
baoshi[5,1]:=5200 baoshi[5,2]:=5600
baoshi[6,1]:=5900; baoshi[6,2]:=6300
baoshi[7,1]:=6700 baoshi[7,2]:=6990
baoshi[8,1]:=7400 baoshi[8,2]:=7600
baoshi[9,1]:=8007 baoshi[9,2]:=8500
baoshi[10,1]:=8700 baoshi[10,2]:=9000;
baoshi[11,1]:=9300 baoshi[11,2]:=9600
baoshi[13,1]:=9790 baoshi[13,2]:=10400
baoshi[12,1]:=10500 baoshi[12,2]:=10900
baoshi[14,1]:=10999 baoshi[14,2]:=11475
decodeTime(now,h,m,se,bse);
if h>=20 then playposmdi(baoshi[2,1],baoshi[2,2]);
if h>=10 then Playposmdi(baoshi[10,1],baoshi[10,2]);
x1:=h-trunc(h/10)*10;
if x1<>0then
if h<10then playposmdi(baoshi[x1,1],baoshi[x1,2])
else
if x1=2then
playposmdi(baoshi[12,1],baoshi[12,2])
else playposmdi(baoshi[x1,1],baoshi[x1,2]);
x1:=11;
playposmdi(baoshi[x1,1],baoshi[x1,2]);
if m>0 then
begin
x1:=Trunc(m/10);
if x1<>1then
playposmdi(baoshi[x1,1],baoshi[x1,2]);
if x1<>0then
begin
x1:=10;
playposmdi(baoshi[x1,1],baoshi[x1,2]);
end;
x1:=m-trunc(m/10)*10;
if x1<>0then
playposmdi(baoshi[x1,1],baoshi[x1,2]);
x1:=13;
playposmdi(baoshi[x1,1],baoshi[x1,2]);
end
else
begin
x1:=14;
playposmdi(baoshi[x1,1],baoshi[x1,2]);
end;
end;
procedure TYybs.AHMTimeTrigger1Trigger(Sender: TObject);
var
newtime:string;
begin
newtime:=AHMTimeTrigger1.CurrentTime;
if copy(newtime,4,5)='00:00' then
AHMTimeTrigger1.TriggerTime:=AHMTimeTrigger1.CurrentTime;
end;
procedure TYybs.SpeedButton1Click(Sender: TObject);
begin
baoshi;
// Playposmdi(strtoint(Edit1.text),strtoint(Edit2.text));
end;
end.