middle_blink(false),
inner_blink(false),
name("marker-beacon"),
- num(0)
+ num(0),
+ _time_before_search_sec(0.0)
{
SGPath path( globals->get_fg_root() );
SGPath term = path;
SGPropertyNode *node = fgGetNode(branch.c_str(), num, true );
// Inputs
+ sound_pause = fgGetNode("/sim/sound/pause", false);
lon_node = fgGetNode("/position/longitude-deg", true);
lat_node = fgGetNode("/position/latitude-deg", true);
alt_node = fgGetNode("/position/altitude-ft", true);
{
need_update = false;
- if ( has_power() && serviceable->getBoolValue() ) {
+ if ( has_power() && serviceable->getBoolValue()
+ && !sound_pause->getBoolValue()) {
// On timeout, scan again
_time_before_search_sec -= dt;
if ( last_beacon != OUTER ) {
if ( ! globals->get_soundmgr()->exists( "outer-marker" ) ) {
SGSoundSample *sound = beacon.get_outer();
- sound->set_volume( 0.3 );
- globals->get_soundmgr()->add( sound, "outer-marker" );
+ if ( sound ) {
+ sound->set_volume( 0.3 );
+ globals->get_soundmgr()->add( sound, "outer-marker" );
+ }
}
}
if ( audio_btn->getBoolValue() ) {
if ( last_beacon != MIDDLE ) {
if ( ! globals->get_soundmgr()->exists( "middle-marker" ) ) {
SGSoundSample *sound = beacon.get_middle();
- sound->set_volume( 0.3 );
- globals->get_soundmgr()->add( sound, "middle-marker" );
+ if ( sound ) {
+ sound->set_volume( 0.3 );
+ globals->get_soundmgr()->add( sound, "middle-marker" );
+ }
}
}
if ( audio_btn->getBoolValue() ) {
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 ( sound ) {
+ sound->set_volume( 0.3 );
+ globals->get_soundmgr()->add( sound, "inner-marker" );
+ }
}
}
if ( audio_btn->getBoolValue() ) {