Einzelnen Beitrag anzeigen

Benutzerbild von Poseidon
Poseidon

Registriert seit: 8. Jul 2008
113 Beiträge
 
Delphi 2005 Personal
 
#1

Mediaplayer Length und Position werden falsch dargestellt

  Alt 4. Aug 2008, 19:38
Hallo Delphianer,
in meinem Media soll dei Position und Length dargestellt werden. Ihrgendwie kommen aber seltsame Ergebnisse heraus, z.B. 2(min) 214(sek) oder 4576(sek).
Weder
Delphi-Quellcode:
type
  HMSRec = packed record
  Hours: byte;
  Minutes: byte;
  Seconds: byte;
  NotUsed: byte;
   end;

{...}

procedure TForm1.Timer12Timer(Sender: TObject);
var
TheLength: LongInt; ThePos2:LOngint;
begin

 If Mediaplayer1.Mode = mpplaying then
 begin


MediaPlayer1.TimeFormat := tfHMS;

TheLength := Mediaplayer1.Length;
with HMSRec(TheLength) do
begin
Label21.Caption := IntToStr(minutes);
Label22.Caption := IntToStr(Seconds);
end;
  
 ThePos2 := Mediaplayer1.Position;
with HMSRec(ThePos2) do
begin

Label24.Caption := IntToStr(minutes);
Label26.Caption := IntToStr(Seconds);
end;
  end;
   end;
noch
Delphi-Quellcode:
type
  HMSRec = record
  Hours: byte;
  Minutes: byte;
  Seconds: byte;
  NotUsed: byte;
   end;

{...}

procedure TForm1.Timer12Timer(Sender: TObject);
var
TheLength: LongInt; ThePos2:LOngint;
begin

 If Mediaplayer1.Mode = mpplaying then
 begin


Mediaplayer1.TimeFormat := tfmilliseconds;

TheLength := Mediaplayer1.Length;
with HMSRec(TheLength) do
begin

Label21.Caption := IntToStr(thelength div 60000);
Label22.Caption := IntToStr(thelength mod 60000);
end;
   
 ThePos2 := Mediaplayer1.Position;
with HMSRec(ThePos2) do
begin
 
Label24.Caption := IntToStr(thepos2 div 60000);
Label26.Caption := IntToStr(thepos2 mod 60000);
end;
  end;
 end;
Futz. Was mach ich falsch? Vielen dank im voraus.

mfg Poseidon
Im Zweifelsfall immer das Richtige tun
  Mit Zitat antworten Zitat