J
jacq
Unregistered / Unconfirmed
GUEST, unregistred user!
我StatusBar上画了一个TTrackBar,让它同步MPEGPlayer.dll播放的mp3。
下面是画了TTrackBar的代码:
begin
MPEGPlayer1.streamname:=StringGrid3.Cells[1,ARow];
MPEGPlayer1.open;
MPEGPlayer1.Play;
progress:=TTrackBar.create(form1);
StatusBar1.repaint;
with progress do
begin
top:=StatusDrawRect.top;
left:=StatusDrawRect.left;
width:=StatusDrawRect.right-StatusDrawRect.left;
height:=StatusDrawRect.bottom-StatusDrawRect.top;//设定进程条的宽和高
visible:=true;
Parent := StatusBar1; //该进程条的拥有者为状态条status
progress.Position:=0;
Min := 0; Max := MPEGPlayer1.length; //进程条的最大和最小值
timer1.Enabled :=true;
end; //with
end;//play
end;
--------------我已经实现了TTrackBar同步MPEGPlayer1:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
progress.Position:=MPEGPlayer1.CurrentPosition;
end;
---------------------------------------
请问如何实现了MPEGPlayer1同步TTrackBar?
下面是画了TTrackBar的代码:
begin
MPEGPlayer1.streamname:=StringGrid3.Cells[1,ARow];
MPEGPlayer1.open;
MPEGPlayer1.Play;
progress:=TTrackBar.create(form1);
StatusBar1.repaint;
with progress do
begin
top:=StatusDrawRect.top;
left:=StatusDrawRect.left;
width:=StatusDrawRect.right-StatusDrawRect.left;
height:=StatusDrawRect.bottom-StatusDrawRect.top;//设定进程条的宽和高
visible:=true;
Parent := StatusBar1; //该进程条的拥有者为状态条status
progress.Position:=0;
Min := 0; Max := MPEGPlayer1.length; //进程条的最大和最小值
timer1.Enabled :=true;
end; //with
end;//play
end;
--------------我已经实现了TTrackBar同步MPEGPlayer1:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
progress.Position:=MPEGPlayer1.CurrentPosition;
end;
---------------------------------------
请问如何实现了MPEGPlayer1同步TTrackBar?