)
{
- if (_sample->is_playing()) {
+ if ((_mode != FGSound::IN_TRANSIT) || (_stopping < MAX_TRANSIT_TIME)) {
- if ((_mode != FGSound::IN_TRANSIT) || (_stopping < MAX_TRANSIT_TIME)) {
+ if (_sample->is_playing()) {
+ SG_LOG(SG_GENERAL, SG_INFO, "Stopping audio after " << _dt_play
+ << " sec: " << _name );
- _active = false;
_sample->stop( _mgr->get_scheduler() );
+ }
- SG_LOG(SG_GENERAL, SG_INFO, "Stopping audio after " << _dt_play
- << " sec: " << _name );
+ _active = false;
+ _dt_stop += dt;
+ _dt_play = 0.0;
- } else
- _stopping += dt;
- }
- _dt_stop += dt;
- _dt_play = 0.0;
+ } else
+ _stopping += dt;
return;
}
//
- // Update playing time and cache the current value.
+ // Update the playing time, cache the current value and
+ // clear the delay timer.
//
- _dt_play += dt;
+ _dt_play += dt;
_prev_value = curr_value;
+ _stopping = 0.0;
//
// Update the volume