X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fmarker_beacon.cxx;h=5fa56fadef3d3379887e87baee19ba4857f78947;hb=5a05e30abd3542b288c09e401a8aee3c5097bf57;hp=ccb8499e109631b5bb52790f76557d076bb9ae4a;hpb=86f462933d0d7130e4e688183976620ed2ddb5ae;p=flightgear.git diff --git a/src/Instrumentation/marker_beacon.cxx b/src/Instrumentation/marker_beacon.cxx index ccb8499e1..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,11 +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; @@ -175,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 ); @@ -317,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 ); } @@ -336,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 ); } @@ -355,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 ); }