Вниз
Скачать: CL | DM;

Как узнать длинну трека или клипа проигрываемого в TMediaPlayer ?   Найти похожие ветки 

← →
DeMoN-777 ©   (2002-09-03 16:47) [0]

Делаю так


procedure TForm1.Button1Click(Sender: TObject);
type HMSRec = record
Hours: byte;
Minutes: byte;
Seconds: byte;
NotUsed: byte;
end;
var TheLength: LongInt;
begin
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;


А получается какая-то херня =(

Или так, но вторым способом только для Мр3, а мне надо для видео

procedure TForm1.Button1Click(Sender: TObject);
var
i: LongInt;
hours,min:integer;
begin
i:=round(mp1.Length/1000);
hours := i div 3600;
i := i - hours*3600;
min := i div 60;
i := i - min*60;
showmessage(IntToStr(hours)+":"+IntToStr(min)+":"+IntToStr(i));
end;



Ещё один отрывок


type HMSRec = record
Hours: byte;
Minutes: byte;
Seconds: byte;
NotUsed: byte;
end;
procedure TInfoForm.FormCreate(Sender: TObject);
var TheLength: Longint;
begin
TheLength := MPlayer.Length;
with HMSRec(TheLength) do begin
LabelTime.Caption := IntToStr(Hours) + "" Hours, "" +
IntToStr(Minutes) + ""
Minutes, "" + IntToStr(Seconds)+ "" Sec."";
end;



Отображается нечто типа - ""191 Hours, 60 Minutes, 0 Sec.""

Я уже замучался..........


← →
DeMoN-777 ©   (2002-09-05 14:53) [1]

NEED HELP



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
1-61554
Tik
2002-12-09 13:35
2002.12.19
treeView


3-61492
sndanil
2002-12-02 14:56
2002.12.19
API InterBase/FireBird


1-61661
Balu
2002-12-06 17:35
2002.12.19
Разное поведение Variant в D5 и D6


3-61398
SZap
2002-12-02 16:48
2002.12.19
Защищенная БД


1-61657
Dmitry_K
2002-12-07 19:52
2002.12.19
Как изменить атрибут файла




   Наверх