- Moderator
- #21
@BassFan @hwahrmann I still fighting an issue with the Mixer in shared mode. While in all other cases the stream end is handled correctly (DirectSound, WASAPI exclusive), the shared mode doesn't seem stop playback.
I tried to attach handlers for Stream end like:
Bass.BASS_ChannelSetSync(stream.Handle, BASSSync.BASS_SYNC_FREE | BASSSync.BASS_SYNC_MIXTIME, 0, OnPlaybackEnd,...
But this doesn't work in current code: no callback happens and mixer will be read after finish. How do I get noticed of playback end in this case?
A Mixer stream is always active, unless you initalize it to stop, when nothing is fed into it.
So when you add a song to the mixer you need to set a SyncPos to "current mixer position + length of song just added".
This will then signal and you know that the song has ended, and you can add the next siong from the playlistz or stop playback, if it was the last song.
THat's the SetSyncPos in MP1 MixerStream.cs line 385