- alcSuspendContext( context );
- if ( alGetError() != AL_NO_ERROR) {
- SG_LOG( SG_GENERAL, SG_ALERT,
- "Oops AL error after soundmgr pause()!" );
+ // nothing to do in the regular update,e verything is done on the following
+ // function
+}
+
+
+// run the audio scheduler
+void SGSoundMgr::update_late( double dt ) {
+ if (_working) {
+ // alcSuspendContext(_context);
+
+ sample_group_map_iterator sample_grp_current = _sample_groups.begin();
+ sample_group_map_iterator sample_grp_end = _sample_groups.end();
+ for ( ; sample_grp_current != sample_grp_end; ++sample_grp_current ) {
+ SGSampleGroup *sgrp = sample_grp_current->second;
+ sgrp->update(dt);
+ }
+
+ if (_changed) {
+ alListenerf( AL_GAIN, _volume );
+ alListenerfv( AL_VELOCITY, _listener_vel.data() );
+ alListenerfv( AL_ORIENTATION, _listener_ori );
+ alListenerfv( AL_POSITION, toVec3f(_listener_pos).data() );
+ // alDopplerVelocity(340.3); // TODO: altitude dependent
+ testForALError("update");
+ _changed = false;
+ }
+ // alcProcessContext(_context);