是否一定要用POSITION进行判断? 以下举例用POSITION进行判断,但有不足! 实例,用REALPLAY播放RM文件,播放完毕跳转到别的界面! procedure Tmain.Timer1Timer(Sender: TObject); begin if (main.Realstart.GetPosition>0) then begin if (main.Realstart.GetPosition>=main.Realstart.GetLength-1500) then begin realstop(); end; end; end; 这样写法有两大缺点:1,每秒都要判断 2还要提前结束! (1秒=1000)有什么更好办法吗?
procedure TMainForm.MediaPlayer1Notify(Sender: TObject); begin if mediaplayer1.Mode=mpstopped then mediaplayer1.Play; end;
以下举例用POSITION进行判断,但有不足!
实例,用REALPLAY播放RM文件,播放完毕跳转到别的界面!
procedure Tmain.Timer1Timer(Sender: TObject);
begin
if (main.Realstart.GetPosition>0) then
begin
if (main.Realstart.GetPosition>=main.Realstart.GetLength-1500) then
begin
realstop();
end;
end;
end;
这样写法有两大缺点:1,每秒都要判断 2还要提前结束! (1秒=1000)有什么更好办法吗?
begin
if mediaplayer1.Mode=mpstopped then mediaplayer1.Play;
end;