|
While testing UOS on the Mac (Lazarus 2.0, fpc 3.0.4) a point came up about tracking the position of an audio file over time.
Not knowing any better, initially I used a TTimer.OnTimer event, in which I read the current position with uos_InputPositionSeconds(...) and then update my position bar accordingly.
That was working fine, but then I learned that the proper way to do that is to use uos_LoopProcInt(...) with the callback procedure of object. So I started using that.
However now I discovered an issue with that:
When the audio is playing, if I grab the program's window by the title bar to move it around, the playing stops, and only continues after I let go of the window with the mouse.
So it looks like the callback procedure registered by uos_LoopProcInt(...) is blocking the playing thread.
On the other hand, if I read the current position using OnTimer events, the playing continues, and the position is updated even while I am dragging the program windows around.
I don't know if the same thing happens on Windows, Linux, etc. but it should be easy to try: open a demo app like SimplePlayer, start playing an audio file, and while it plays, move the program window -- on my Mac, the sound stops.
All the best!
Manny
|