]> git.mxchange.org Git - flightgear.git/blob - src/ATCDCL/ATISmgr.hxx
Fix an (unlikely) startup crash
[flightgear.git] / src / ATCDCL / ATISmgr.hxx
1 // ATISmgr.hxx - definition of FGATISMgr
2 // - a global management class for FlightGear generated ATIS
3 //
4 // Written by David Luff, started February 2002.
5 //
6 // Copyright (C) 2002  David C Luff - david.luff@nottingham.ac.uk
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21
22 #ifndef _FG_ATISMGR_HXX
23 #define _FG_ATISMGR_HXX
24
25 #include <vector>
26
27 #include <simgear/structure/subsystem_mgr.hxx>
28
29 #include "ATC.hxx"
30
31 class FGATISMgr : public SGSubsystem
32 {
33 private:
34     // A vector containing all comm radios
35     std::vector<FGATC*> radios;
36
37     unsigned int _currentUnit;
38     unsigned int _maxCommRadios;
39
40 #ifdef ENABLE_AUDIO_SUPPORT
41     bool useVoice;  // Flag - true if we are using voice
42     FGATCVoice* voice;
43     std::string voiceName; // currently loaded voice name
44 #endif
45
46 public:
47     FGATISMgr();
48     ~FGATISMgr();
49
50     void init();
51     void reinit();
52     void update(double dt);
53
54     // Return a pointer to an appropriate voice for a given type of ATC
55     // creating the voice if necessary - i.e. make sure exactly one copy
56     // of every voice in use exists in memory.
57     //
58     // TODO - in the future this will get more complex and dole out country/airport
59     // specific voices, and possible make sure that the same voice doesn't get used
60     // at different airports in quick succession if a large enough selection are available.
61     FGATCVoice* GetVoicePointer(const atc_type& type);
62
63 private:
64 };
65
66 #endif  // _FG_ATISMGR_HXX