- // process mesage queue
- const string msgid = "Sequential Audio Message";
- bool now_playing = false;
- if ( exists( msgid ) ) {
- if ( is_playing( msgid ) ) {
- // still playing, do nothing
- now_playing = true;
- } else {
- // current message finished, stop and remove
- stop( msgid ); // removes source
- remove( msgid ); // removes buffer
- }
- }
- if ( !now_playing ) {
- // message queue idle, add next sound if we have one
- if ( _samplequeue.size() > 0 ) {
- add( _samplequeue.front(), msgid );
- _samplequeue.pop();
- play_once( msgid );