- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
procedure tplayext.play(iname:string);
begin
cd:=false;
try
form1.MediaPlayer1.Close;
form1.MediaPlayer1.filename:=iname;
form1.label10.Caption:=iname;
form1.MediaPlayer1.Open;
form1.MediaPlayer1.play;
except
next;
cd:=true;
end;
end;
procedure tplayext.init(iext:string);
begin
name:='';
paused:=false;
allplayed:=false;
ext:=iext;
TRY
io:=findfirst(ext,faanyfile,f);
EXCEPT
END;
if io<>0 then
begin
done;
exit;
end;
name:=f.Name;
play(name);
end;
procedure tplayext.playplease;
begin
if stoped then next;
end;
procedure tplayext.next;
begin
TRY
io:=findnext(f);
EXCEPT
END;
if io <>0 then
begin
done;
exit;
end;
name:=f.Name;
play(name);
end;
procedure tplayext.done;
begin
TRY
form1.MediaPlayer1.close;
findclose(f);
EXCEPT
END;
allplayed:=true;
end;
Особенно прикалывает вызов метода play в методе next и вызов метода next в методе play.
Рекурсия!!!!!1111
uncle Lem 14.03.2010 01:59 # 0