FlightGear next
marker_beacon.hxx
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0+
3 * SPDX-FileCopyrightText: 2000 (C) Curtis L. Olson - http://www.flightgear.org/~curt
4 *
5 * marker_beacon.hxx -- class to manage the marker beacons
6 * Written by Curtis Olson, started April 2000.
7 *
8 * Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 *
24 * $Id$
25*/
26
27#pragma once
28
29#include <simgear/compiler.h>
30
32#include <Sound/beacon.hxx>
33#include <simgear/timing/timestamp.hxx>
34
35class SGSampleGroup;
36
38 public SGPropertyChangeListener
39{
40public:
47
48 FGMarkerBeacon(SGPropertyNode *node);
50
51 // Subsystem API.
52 void bind() override;
53 void init() override;
54 void reinit() override;
55 void unbind() override;
56 void update(double dt) override;
57
58 // Subsystem identification.
59 static const char* staticSubsystemClassId() { return "marker-beacon"; }
60
61 void search ();
62
63 void valueChanged(SGPropertyNode* val) override;
64
65private:
66 // Inputs
67 SGPropertyNode_ptr audio_btn;
68 SGPropertyNode_ptr audio_vol;
69 SGPropertyNode_ptr sound_working;
70
71 SGPropertyNode_ptr _innerBlinkNode;
72 SGPropertyNode_ptr _middleBlinkNode;
73 SGPropertyNode_ptr _outerBlinkNode;
74
75 bool _audioPropertiesChanged = true;
76
77 // internal periodic station search timer
78 double _time_before_search_sec = 0.0;
79
80 SGTimeStamp _audioStartTime;
81 SGSharedPtr<SGSampleGroup> _audioSampleGroup;
82
83 enum class BlinkMode {
84 BackwardsCompatible,
85 Standard,
87 };
88
89 BlinkMode _blinkMode = BlinkMode::BackwardsCompatible;
90
91 void changeBeaconType(fgMkrBeacType newType);
92
93 void updateAudio();
94 void stopAudio();
95 void updateOutputProperties(bool on);
96
97 fgMkrBeacType _lastBeacon;
98
99 FGBeacon::BeaconTiming _beaconTiming;
100};
-- Provides marker beacon audio generation.
FGMarkerBeacon(SGPropertyNode *node)
void init() override
void unbind() override
void reinit() override
void valueChanged(SGPropertyNode *val) override
void update(double dt) override
void bind() override
static const char * staticSubsystemClassId()