在大富翁上找了一下,大致是这样,先设notify:=true;再在OnNotify里加入下面(Mp1.NotifyValue = nvSuccessful) and (Mp1.Mode =mpStopped) 来判断,但我的还不行,不知是不是写错了,大家帮忙看一下,或者提供一种其它的方法,先行谢谢:
经跟踪:Mp1.Mode正常播放完时还是mpPlaying,只有执行Mp1.Stop时,Mp1.Mode才会得到mpStopped;以下是我的代码://Mp1=MediaPlay1 , PubIds: 已播放次数 , PriPlayTimes:总播放次数 PubIds,PriPlayTimes均为公共整型
procedure TForm1.Btn_PlayClick(Sender: TObject);
begin
Mp1.notify:=true;
Mp1.FileName:=(.....);
Mp1.open;
Mp1.Play;
PubIds:=1;
PriPlayTimes:=5;
end;
//------------------------------
procedure TForm1.Mp1Notify(Sender: TObject);
begin
if (Mp1.NotifyValue = nvSuccessful) and (Mp1.Mode =mpStopped) then
begin
if (PubIds<PriPlayTimes) then
begin
Mp1.open;
Mp1.Play;
inc(PubIds);
end;
end;
end;
经跟踪:Mp1.Mode正常播放完时还是mpPlaying,只有执行Mp1.Stop时,Mp1.Mode才会得到mpStopped;以下是我的代码://Mp1=MediaPlay1 , PubIds: 已播放次数 , PriPlayTimes:总播放次数 PubIds,PriPlayTimes均为公共整型
procedure TForm1.Btn_PlayClick(Sender: TObject);
begin
Mp1.notify:=true;
Mp1.FileName:=(.....);
Mp1.open;
Mp1.Play;
PubIds:=1;
PriPlayTimes:=5;
end;
//------------------------------
procedure TForm1.Mp1Notify(Sender: TObject);
begin
if (Mp1.NotifyValue = nvSuccessful) and (Mp1.Mode =mpStopped) then
begin
if (PubIds<PriPlayTimes) then
begin
Mp1.open;
Mp1.Play;
inc(PubIds);
end;
end;
end;
解决方案 »
- AdvStringGrid中的CheckBox的选中状态怎么保存
- 可以将EXCEL文件直接作为数据库吗?如何在DELPHI中使用?
- 谁知道工具栏菜单栏上的小图片才什么网站上能下载????
- 得已肝三年了,也许在临死前我能做一个全国最优秀的动态构造系统.
- ACtiveFrom好像不支持菜单?
- 四舍五入,保存小数点后三位的函数是什么?
- 请帮一个忙,答者有分!
- 哪位兄弟用过WISE INSTALL SYSTEM? 急:3T
- 请教不同form之间传递数值的问题
- 请教大虾,关于关闭程序的问题.
- 关于动态库中应用DBGrid中Column的PickList属性的问题
- 按主键删除重复记录问题,在线请教,在线等,不吃饭?
------------
那你将
if (Mp1.NotifyValue = nvSuccessful) and (Mp1.Mode =mpStopped) then
改成
if (Mp1.NotifyValue = nvSuccessful) then