Главная страница
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.015 c
3-61473
nick-from
2002-12-02 00:59
2002.12.19
Exception


1-61655
msdn1
2002-12-07 17:07
2002.12.19
Webbrowser Очень надо


7-61850
nickolayLI
2002-10-16 16:34
2002.12.19
Блокировка экрана


1-61690
Armageddon
2002-12-08 17:33
2002.12.19
Проблемы с массивом


1-61667
Le!
2002-12-08 11:20
2002.12.19
Скажите!