Is it possible to sync the progress indicator on a spring board screen to a playing audio player automatically?
If not, I assume that in the while loop that waits for events, the wait command needs to wait for a period of time, not 0. On each loop, calculate the time played and adjust the progress indicator accordingly.
So i tried that, but I am not sure of a good way to calculate time. I tried this:
playstart = uptime(0)
maxplay = 190
while true
msg = wait(1000,port)
....
playtime = uptime(0) - playstart
screen.setprogressindicator(int(playtime),maxplay)
end while
but uptime does not seem to count in seconds even though the documentation says it does. it seems to count 1/10 second for every real second, but it is not consistent.
So is my calculation wrong? Is there a better way to calculate time or am I going about this wrong? I did not see any progress indicators in any of the sample code.