BASS - End of Stream

BlitzMax Forums/Brucey's Modules/BASS - End of Stream

degac(Posted 2009) [#1]
Maybe this is a stupid question, but I have a problem to check if a 'stream' is still playing or not.
The idea is to play the 'next' song in the queue when the current one has finished...but I get only a 'forever' loop.


You can skip the current song pressing SPACE key; ENTER key will move to 95% of the song to check the 'skipping'.

Where is the error?


Brucey(Posted 2009) [#2]
Sorry for the late reply... I was away for a few days.

Here's a tweaked version of your example which detects the end of a track :


Note the use of the TBassSyncData object, and the call to SetSync() when the stream is created.
The reason we use this object is to get around the issue of having a callback into BlitzMax code from a separate thread - which breaks BlitzMax using the default GC.
You simply call syncData.IsSet(), which will return True whenever the sync is triggered. So you should check it often. Checking for the value is thread-safe :-)

HTH


degac(Posted 2009) [#3]
Oh thank you very much!
I'll never found the solution!

SetSync() & TBassSyncData dont' seem to have any useful informations in the help...Is there somewhere a 'manual/help' about BASS, because the BASS's forum is not useful: too many threads.

In any case, thank you very much!


Brucey(Posted 2009) [#4]
Is there somewhere a 'manual/help' about BASS, because the BASS's forum is not useful

Nothing that will have this specific information about the Type, but the docs on BASS_ChannelSetSync should help a bit.
Obviously, I need to improve the module documentation here, as it is sorely lacking.