- } else {
- globals->get_soundmgr()->stop( "middle-marker" );
- }
- } else if ( beacon_type == INNER ) {
- inner_marker = true;
- // cout << "INNER MARKER" << endl;
- if ( last_beacon != INNER ) {
- if ( ! globals->get_soundmgr()->exists( "inner-marker" ) ) {
- SGSoundSample *sound = beacon.get_inner();
- sound->set_volume( 0.3 );
- globals->get_soundmgr()->add( sound, "inner-marker" );
- }
- }
- if ( audio_btn->getBoolValue() ) {
- if ( !globals->get_soundmgr()->is_playing("inner-marker") ) {
- globals->get_soundmgr()->play_looped( "inner-marker" );
+ if ( audio_btn->getBoolValue() ) {
+ if ( !_sgr->is_playing(current_sound_name) ) {
+ _sgr->play_looped( current_sound_name );
+ }
+ } else {
+ _sgr->stop( current_sound_name );
+ }
+ } else if ( beacon_type == INNER ) {
+ inner_marker = true;
+ current_sound_name = "inner-marker";
+ // cout << "INNER MARKER" << endl;
+ if ( last_beacon != INNER ) {
+ if ( ! _sgr->exists( current_sound_name ) ) {
+ SGSoundSample *sound = FGBeacon::instance()->get_inner();
+ if ( sound ) {
+ _sgr->add( sound, current_sound_name );
+ }
+ }
+ }
+ if ( audio_btn->getBoolValue() ) {
+ if ( !_sgr->is_playing(current_sound_name) ) {
+ _sgr->play_looped( current_sound_name );
+ }
+ } else {
+ _sgr->stop( current_sound_name );