Dsys
asked on
Mediaplayer set time format.
I use this mediaplayer and try and set the time into normal minutes : seconds format but the results look really odd... like 153:940. Plus I was curious how I can make this refresh to show the time count down not just display the length one time.
type
MSFRec = record
Minutes: byte;
Seconds: byte;
Frames: byte;
NotUsed: byte;
end;
procedure TfrmMain.Song;
var
TheLength: LongInt;
begin
MediaPlayer1.TimeFormat := tfMSF;
TheLength := MediaPlayer1.Length;
with MSFRec(TheLength) do
begin
len := IntToStr(Minutes); {Display Minutes }
len := len + ':' + IntToStr(Seconds); {Display Seconds}
end;
lblLen.Caption := len;
type
MSFRec = record
Minutes: byte;
Seconds: byte;
Frames: byte;
NotUsed: byte;
end;
procedure TfrmMain.Song;
var
TheLength: LongInt;
begin
MediaPlayer1.TimeFormat := tfMSF;
TheLength := MediaPlayer1.Length;
with MSFRec(TheLength) do
begin
len := IntToStr(Minutes); {Display Minutes }
len := len + ':' + IntToStr(Seconds); {Display Seconds}
end;
lblLen.Caption := len;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This did not work. The data is still showing up in an odd format. 234:240 and so forth...
I do not know what will work to make it show real minutes and real seconds?
geobul what do you propose?
I do not know what will work to make it show real minutes and real seconds?
geobul what do you propose?
ASKER
Oh wait a second here I was too quick to judge. Your idea might work and I did something wrong... let me try something else.
ASKER
ok so your idea was great and I had goofed up. Sorry. Thanks for the help.
The problem obviously is that tfMilliseconds format is supported by your device and the others are not.
Regards, Geo