X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fmarker_beacon.cxx;h=5fa56fadef3d3379887e87baee19ba4857f78947;hb=9effb060470785b770a68088453d833766f52c80;hp=3a0d33819d24e28bc3607e73e571c6e7e2141f90;hpb=c56113d0dd0bba31bf1788a79694c966e5a1c477;p=flightgear.git diff --git a/src/Instrumentation/marker_beacon.cxx b/src/Instrumentation/marker_beacon.cxx index 3a0d33819..5fa56fade 100644 --- a/src/Instrumentation/marker_beacon.cxx +++ b/src/Instrumentation/marker_beacon.cxx @@ -31,10 +31,10 @@ #include #include -#include #include #include "marker_beacon.hxx" +#include #include using std::string; @@ -100,7 +100,7 @@ FGMarkerBeacon::init () SGPropertyNode *node = fgGetNode(branch.c_str(), num, true ); // Inputs - sound_pause = fgGetNode("/sim/sound/pause", false); + sound_working = fgGetNode("/sim/sound/working", true); lon_node = fgGetNode("/position/longitude-deg", true); lat_node = fgGetNode("/position/latitude-deg", true); alt_node = fgGetNode("/position/altitude-ft", true); @@ -117,12 +117,10 @@ FGMarkerBeacon::init () if (serviceable->getType() == simgear::props::NONE) serviceable->setBoolValue( true ); - SGSoundMgr *smgr = (SGSoundMgr *)globals->get_subsystem("soundmgr"); + SGSoundMgr *smgr = globals->get_soundmgr(); _sgr = smgr->find("avionics", true); _sgr->tie_to_listener(); - morse.init(); - beacon.init(); blink.stamp(); outer_marker = middle_marker = inner_marker = false; @@ -176,7 +174,7 @@ FGMarkerBeacon::update(double dt) } if ( has_power() && serviceable->getBoolValue() - && !sound_pause->getBoolValue()) { + && sound_working->getBoolValue()) { // marker beacon blinking bool light_on = ( outer_blink || middle_blink || inner_blink ); @@ -318,7 +316,7 @@ void FGMarkerBeacon::search() // cout << "OUTER MARKER" << endl; if ( last_beacon != OUTER ) { if ( ! _sgr->exists( current_sound_name ) ) { - SGSoundSample *sound = beacon.get_outer(); + SGSoundSample *sound = FGBeacon::instance()->get_outer(); if ( sound ) { _sgr->add( sound, current_sound_name ); } @@ -337,7 +335,7 @@ void FGMarkerBeacon::search() // cout << "MIDDLE MARKER" << endl; if ( last_beacon != MIDDLE ) { if ( ! _sgr->exists( current_sound_name ) ) { - SGSoundSample *sound = beacon.get_middle(); + SGSoundSample *sound = FGBeacon::instance()->get_middle(); if ( sound ) { _sgr->add( sound, current_sound_name ); } @@ -356,7 +354,7 @@ void FGMarkerBeacon::search() // cout << "INNER MARKER" << endl; if ( last_beacon != INNER ) { if ( ! _sgr->exists( current_sound_name ) ) { - SGSoundSample *sound = beacon.get_inner(); + SGSoundSample *sound = FGBeacon::instance()->get_inner(); if ( sound ) { _sgr->add( sound, current_sound_name ); }