-
-void FGNavRadio::audioNavidChanged()
-{
- if (_sgr->exists(nav_fx_name)) {
- _sgr->remove(nav_fx_name);
- }
-
- try {
- string trans_ident(_navaid->get_trans_ident());
- SGSoundSample* sound = morse.make_ident(trans_ident, LO_FREQUENCY);
- sound->set_volume( 0.3 );
- if (!_sgr->add( sound, nav_fx_name )) {
- SG_LOG(SG_COCKPIT, SG_WARN, "Failed to add v1-vor-ident sound");
- }
-
- if ( _sgr->exists( dme_fx_name ) ) {
- _sgr->remove( dme_fx_name );
- }
-
- sound = morse.make_ident( trans_ident, HI_FREQUENCY );
- sound->set_volume( 0.3 );
- _sgr->add( sound, dme_fx_name );
-
- int offset = (int)(sg_random() * 30.0);
- play_count = offset / 4;
- last_time = globals->get_time_params()->get_cur_time() - offset;
- } catch (sg_io_exception& e) {
- SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
- }
-}