#include <Aircraft/aircraft.hxx>
#include <Navaids/mkrbeacons.hxx>
-#include <Time/FGEventMgr.hxx>
#include "marker_beacon.hxx"
bus_power(fgGetNode("/systems/electrical/outputs/navcom[0]", true)),
power_btn(fgGetNode("/radios/marker-beacon/power-btn", true)),
audio_btn(fgGetNode("/radios/marker-beacon/audio-btn", true)),
- servicable(fgGetNode("/instrumentation/marker-beacons/servicable", true)),
+ serviceable(fgGetNode("/instrumentation/marker-beacons/serviceable", true)),
need_update(true),
outer_blink(false),
power_btn->setBoolValue( true );
audio_btn->setBoolValue( true );
- servicable->setBoolValue( true );
+ serviceable->setBoolValue( true );
}
{
need_update = false;
- if ( has_power() && servicable->getBoolValue() ) {
+ if ( has_power() && serviceable->getBoolValue() ) {
// marker beacon blinking
bool light_on = ( outer_blink || middle_blink || inner_blink );
SGTimeStamp current;
outer_marker = middle_marker = inner_marker = false;
if ( beacon_type == FGMkrBeacon::NOBEACON
- || !has_power() || !servicable->getBoolValue() )
+ || !has_power() || !serviceable->getBoolValue() )
{
// cout << "no marker" << endl;
beacon_type = FGMkrBeacon::NOBEACON;
// cout << "OUTER MARKER" << endl;
if ( last_beacon != FGMkrBeacon::OUTER ) {
if ( ! globals->get_soundmgr()->exists( "outer-marker" ) ) {
- FGSimpleSound *sound = beacon.get_outer();
+ SGSimpleSound *sound = beacon.get_outer();
sound->set_volume( 0.3 );
globals->get_soundmgr()->add( sound, "outer-marker" );
}
}
- if ( audio_btn->getBoolValue()
- && !globals->get_soundmgr()->is_playing("outer-marker") )
- {
- globals->get_soundmgr()->play_looped( "outer-marker" );
+ if ( audio_btn->getBoolValue() ) {
+ if ( !globals->get_soundmgr()->is_playing("outer-marker") ) {
+ globals->get_soundmgr()->play_looped( "outer-marker" );
+ }
} else {
globals->get_soundmgr()->stop( "outer-marker" );
}
// cout << "MIDDLE MARKER" << endl;
if ( last_beacon != FGMkrBeacon::MIDDLE ) {
if ( ! globals->get_soundmgr()->exists( "middle-marker" ) ) {
- FGSimpleSound *sound = beacon.get_middle();
+ SGSimpleSound *sound = beacon.get_middle();
sound->set_volume( 0.3 );
globals->get_soundmgr()->add( sound, "middle-marker" );
}
}
- if ( audio_btn->getBoolValue()
- && !globals->get_soundmgr()->is_playing("middle-marker") )
- {
- globals->get_soundmgr()->play_looped( "middle-marker" );
+ if ( audio_btn->getBoolValue() ) {
+ if ( !globals->get_soundmgr()->is_playing("middle-marker") ) {
+ globals->get_soundmgr()->play_looped( "middle-marker" );
+ }
} else {
globals->get_soundmgr()->stop( "middle-marker" );
}
// cout << "INNER MARKER" << endl;
if ( last_beacon != FGMkrBeacon::INNER ) {
if ( ! globals->get_soundmgr()->exists( "inner-marker" ) ) {
- FGSimpleSound *sound = beacon.get_inner();
+ SGSimpleSound *sound = beacon.get_inner();
sound->set_volume( 0.3 );
globals->get_soundmgr()->add( sound, "inner-marker" );
}
}
- if ( audio_btn->getBoolValue()
- && !globals->get_soundmgr()->is_playing("inner-marker") )
- {
- globals->get_soundmgr()->play_looped( "inner-marker" );
+ if ( audio_btn->getBoolValue() ) {
+ if ( !globals->get_soundmgr()->is_playing("inner-marker") ) {
+ globals->get_soundmgr()->play_looped( "inner-marker" );
+ }
} else {
globals->get_soundmgr()->stop( "inner-marker" );
}