关于delphi中的realAudio ActiveX控件的使用(50分)

  • 主题发起人 主题发起人 sins324
  • 开始时间 开始时间
S

sins324

Unregistered / Unconfirmed
GUEST, unregistred user!
近日小弟在做一个realplayer的播放工具,在delphi中使用了realAudio ActiveX控件,简单的文件播放容易处理,但如果想实现播放中的片段选择/保存及回放等功能,则需要详细了解该控件各属性与方法的说明文档.在网上搜索了一番,没有找到相关资料.不知各位有没有这方面的相关资料?

迫切需要之.
 
{=====================打开=========================}
procedure TRealOneFrm.OpenBtnClick(Sender: TObject);
begin
if OpenRMDlg.Execute then
begin
RealAudio1.SetSource(RealOneFrm.OpenRMDlg.FileName);
RealAudio1.DoPlay;
EndPosition := RealAudio1.GetLength;
RealAudio1.DoStop;
PlayBtn.Enabled := True;
PauseBtn.Enabled := False;
StopBtn.Enabled := False;
FullBtn.Enabled := False;
TrackBar1.Enabled := False;
Timer1.Enabled := False;
end;
end;
{=====================播放=========================}
procedure TRealOneFrm.PlayBtnClick(Sender: TObject);
begin
{设置图像窗口显示}
RealAudio1.SetControls('ImageWindow');
{显示图像窗口}
RealAudio1.Visible := True;
RealAudio1.DoPlay;
PlayBtn.Enabled := False;
OpenBtn.Enabled := False;
PauseBtn.Enabled := True;
StopBtn.Enabled := True;
FullBtn.Enabled := True;
Trackbar1.Enabled := True;
Timer1.Enabled := True;
PauseFlag := False;
RealAudio1.SetEnableContextMenu(False);
end;
{=====================暂停=========================}
procedure TRealOneFrm.PauseBtnClick(Sender: TObject);
begin
RealAudio1.DoPause;
PauseFlag := True;
PauseBtn.Enabled := False;
PlayBtn.Enabled := True;
FullBtn.Enabled := False;
end;

procedure TRealOneFrm.StopBtnClick(Sender: TObject);
begin
RealAudio1.DoStop;
PlayBtn.Enabled := True;
OpenBtn.Enabled := True;
PauseBtn.Enabled := False;
StopBtn.Enabled := False;
FullBtn.Enabled := False;
DontSeek := True;
TrackBar1.Position:=0;
DontSeek := False;
TrackBar1.Enabled := False;
Timer1.Enabled := False;
end
//停止

procedure TRealOneFrm.FullBtnClick(Sender: TObject);
begin
RealOneFrm.RealAudio1.SetFullScreen;
end
//设置全屏

procedure TRealOneFrm.MuteCheckClick(Sender: TObject);
begin
if MuteCheck.checked=true then
RealOneFrm.RealAudio1.SetMute(True)
else
RealOneFrm.RealAudio1.SetMute(False);
end;

procedure TRealOneFrm.FormCreate(Sender: TObject);
begin
PlayBtn.Enabled := False;
PauseBtn.Enabled := False;
StopBtn.Enabled := False;
OpenBtn.Enabled := True;
FullBtn.Enabled := False;
RealAudio1.SetMute(False);

Timer1.Enabled := False;
TrackBar1.Enabled := False;
OpenRMDlg.Filter := 'RealPlay Files(*.rm)|*.rm';
OpenRMDlg.Filter := RealOneFrm.OpenRMDlg.Filter + '|' + 'All Files(*.*)|*.*';
RealOneFrm.Caption := 'RealOne 播放器 -- KingLong Studio';
DontSeek := False;
PauseFlag := False;
end;

procedure TRealOneFrm.Timer1Timer(Sender: TObject);
begin
if TrackBar1.Enabled then
begin
DontSeek := True;
TrackBar1.Min := 0;
TrackBar1.Max := RealAudio1.GetLength;
TrackBar1.Position := RealAudio1.GetPosition;
DontSeek := False;
if (RealAudio1.GetPosition) = (Endposition) then
begin
StopBtnClick(Sender);
if Repeatcheck.Checked then
PlayBtnClick(Sender);
end;
end;
end;

procedure TRealOneFrm.FormClose(Sender: TObject
var Action: TCloseAction);
begin
try
RealAudio1.DoStop;
except
RealOneFrm.Free;
end;
end;

procedure TRealOneFrm.TrackBar1Change(Sender: TObject);
begin
if not(DontSeek) then
begin
if not(PauseFlag) then
RealAudio1.Dopause;
RealAudio1.SetPosition(TrackBar1.Position);
if not(PauseFlag) then
RealAudio1.DoPlay;
end;
end;
 
收到,比较全面,非常感谢!
 
后退
顶部