Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.12.19;
Скачать: 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 вся ветка

Текущий архив: 2002.12.19;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.036 c
8-61708
Ptr
2002-08-13 16:10
2002.12.19
Срвнение картинок


4-61868
dumb
2002-11-01 12:10
2002.12.19
CoCreateInstance проблема


14-61754
AL2002
2002-11-27 12:22
2002.12.19
Канал РТР-планета


1-61643
Виталик
2002-12-07 16:40
2002.12.19
MessageBox по центру моего окна (или в произвольном месте экрана)


1-61642
dkDimon
2002-12-06 23:04
2002.12.19
Звуковой регулятор