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