X
xnwang
Unregistered / Unconfirmed
GUEST, unregistred user!
偶正在做一编辑器,需要静态知道某些媒体的播放时间长度(hours:minutes:seconds:msec)。例如:avi,midi,mpeg,ra,rm,wav 等
偶想知道delphi 中有没有这样的控件及如何用.
当偶用 mediaplayer.length 时,将
其转化为 HMSRec = record
Hours: byte;
Minutes: byte;
Seconds: byte;
NotUsed: byte;
end;
procedure TForm1.Button4Click(Sender: TObject);
var TheLength: LongInt;
begin
With MediaPlayer1do
begin
Filename := 'D:/Microsoft/VisualStudio/Common/Tools/VCM/search.avi';
DeviceType := dtAVIVideo;
Display := Panel1;
Open;
play;
end;
MediaPlayer1.TimeFormat := tfHMS;
TheLength := MediaPlayer1.Length;
with HMSRec(TheLength)do
begin
Label1.Caption := IntToStr(Hours);
Label2.Caption := IntToStr(Minutes);
Label3.Caption := IntToStr(Seconds);
end;
end;
偶每次取的时长都不一样, 而且数值也不对。常是几十hours.
谢谢哪位大虾解答。(以上代码基本是其help 文件中copy 来得)。
偶想知道delphi 中有没有这样的控件及如何用.
当偶用 mediaplayer.length 时,将
其转化为 HMSRec = record
Hours: byte;
Minutes: byte;
Seconds: byte;
NotUsed: byte;
end;
procedure TForm1.Button4Click(Sender: TObject);
var TheLength: LongInt;
begin
With MediaPlayer1do
begin
Filename := 'D:/Microsoft/VisualStudio/Common/Tools/VCM/search.avi';
DeviceType := dtAVIVideo;
Display := Panel1;
Open;
play;
end;
MediaPlayer1.TimeFormat := tfHMS;
TheLength := MediaPlayer1.Length;
with HMSRec(TheLength)do
begin
Label1.Caption := IntToStr(Hours);
Label2.Caption := IntToStr(Minutes);
Label3.Caption := IntToStr(Seconds);
end;
end;
偶每次取的时长都不一样, 而且数值也不对。常是几十hours.
谢谢哪位大虾解答。(以上代码基本是其help 文件中copy 来得)。