frdonath
08-27-2008, 04:44 PM
Hello, i used the following code to display elapsed time of the song, it is working, but i have a problem - on select song in listbox (without playing it), the paragraph displays this: 0-1:59 ..... Well, once i play the song, it dissapears and the right timing is starting.
current = Audio.GetCurrentPos(CHANNEL_BACKGROUND);
length = Audio.GetLength(CHANNEL_BACKGROUND);
current_minutes = Math.Floor(current / 60);
current_seconds = Math.Floor(current - (current_minutes*60));
length_minutes = Math.Floor(length/60);
length_seconds = Math.Floor(length - (length_minutes*60));
if current_minutes < 10 then
current_minutes = "0" .. current_minutes;
end
if current_seconds < 10 then
current_seconds = "0" .. current_seconds;
end
if length_minutes < 10 then
length_minutes = "0" .. length_minutes;
end
if length_seconds < 10 then
length_seconds = "0" .. length_seconds;
end
sTime = current_minutes .. ":" .. current_seconds ;
Paragraph.SetText("Paragraph2", sTime);
Can anyone please help me with this? I'm just an amateur :)
Thanks a lot
current = Audio.GetCurrentPos(CHANNEL_BACKGROUND);
length = Audio.GetLength(CHANNEL_BACKGROUND);
current_minutes = Math.Floor(current / 60);
current_seconds = Math.Floor(current - (current_minutes*60));
length_minutes = Math.Floor(length/60);
length_seconds = Math.Floor(length - (length_minutes*60));
if current_minutes < 10 then
current_minutes = "0" .. current_minutes;
end
if current_seconds < 10 then
current_seconds = "0" .. current_seconds;
end
if length_minutes < 10 then
length_minutes = "0" .. length_minutes;
end
if length_seconds < 10 then
length_seconds = "0" .. length_seconds;
end
sTime = current_minutes .. ":" .. current_seconds ;
Paragraph.SetText("Paragraph2", sTime);
Can anyone please help me with this? I'm just an amateur :)
Thanks a lot