Hi Guys,
I've been getting sfx and music implemented into our game and have a question regarding looping.
The play function takes a second parameter which indicates if the sound/music is to loop once complete. I've seen documentation (and even a post here on the forums) that say this parameter can be a numeric value to indicate the number of loops to perform, although that is not what I'm seeing while testing. True, 1 or 2, 3, 4 (and so on) will make it loop forever (which matches other documentation I've read).
Basically I want to be able to set some music tracks to loop 2 or 3 times, before I perform a cross fade to the next track. I've implemented cross fading (which works nicely), but I obviously don't want to cross fade if there is a still 1 or more loops to play on the track.
I don't mind if I have to internally keep track of the number of times the sound/music has looped, but I'm not sure how to go about this, or if there is actually support implemented in Gideros to determine how many times it has looped.
Is there an event that is fired when the sound loops? or a Gideros function I can call on the soundChannel to detect how many loops it has performed?
Thanks
Comments
previously it allowed specific amount of loops, but it was harder to provide endless loop, now it only provides an endless loop or single play and does not provide loop count, it was a quite difficult implementation and really rarely used.
But well that is the reason why you saw such examples, they are outdated.
For now something like this is used to create specific amount of loops and have a callback when all loops end:
http://www.giderosmobile.com/forum/discussion/comment/16619#Comment_16619
That should give me the desired effect. It's a shame there is no LOOP event fired as it would be really useful and I think less prone to possible maintenance issues when cross fading between playlists.