Главная страница
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.022 c
14-61813
sen
2002-11-29 08:24
2002.12.19
Авторский след в программе


3-61416
Sirus
2002-11-29 12:42
2002.12.19
Можно ли перехватить сообщение об ошибке


1-61694
Пользователь
2002-12-04 20:41
2002.12.19
Ребята нужна помощь с RichEdit Срочно!


4-61878
Damage
2002-11-07 00:08
2002.12.19
Есть ли StgOpenStorageEx в реализации WinAPI Delphi?


3-61449
basile
2002-11-30 15:56
2002.12.19
Aggragete