Главная страница
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.012 c
4-61858
9999
2002-11-05 17:42
2002.12.19
Убить процесс при помощи Delphi


3-61410
SiJack
2002-11-29 09:33
2002.12.19
Referential Integrity


1-61561
Виталик
2002-12-09 18:51
2002.12.19
TDriveComboBox или как там его


8-61716
Spielmann
2002-09-05 01:11
2002.12.19
Как вырезать кусок из фильма?


1-61679
baryjul
2002-12-08 15:15
2002.12.19
Как на панели StatusBar отобразить объект TGaude ?