]> git.mxchange.org Git - flightgear.git/blob - src/Sound/fg_fx.hxx
Flight-history men usage cap.
[flightgear.git] / src / Sound / fg_fx.hxx
1 // fg_fx.hxx -- Sound effect management class
2 //
3 // Started by David Megginson, October 2001
4 // (Reuses some code from main.cxx, probably by Curtis Olson)
5 //
6 // Copyright (C) 2001  Curtis L. Olson - http://www.flightgear.org/~curt
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 // $Id$
23
24 #ifndef __FGFX_HXX
25 #define __FGFX_HXX 1
26
27 #include <simgear/compiler.h>
28
29 #include <vector>
30
31 #include <simgear/structure/subsystem_mgr.hxx>
32 #include <simgear/props/props.hxx>
33 #include <simgear/sound/sample_group.hxx>
34
35 class SGXmlSound;
36
37 /**
38  * Generator for FlightGear sound effects.
39  *
40  * This module uses a FGSampleGroup class to generate sound effects based
41  * on current flight conditions. The sound manager must be initialized
42  * before this object is.
43  *
44  *    This module will load and play a set of sound effects defined in an
45  *    xml file and tie them to various property states.
46  */
47 class FGFX : public SGSampleGroup
48 {
49
50 public:
51
52     FGFX ( const std::string &refname, SGPropertyNode *props = 0 );
53     virtual ~FGFX ();
54
55     virtual void init ();
56     virtual void reinit ();
57     virtual void update (double dt);
58             void unbind();
59
60 private:
61
62     bool _is_aimodel;
63     SGSharedPtr<SGSampleGroup> _avionics;
64     std::vector<SGXmlSound *> _sound;
65
66     SGPropertyNode_ptr _props;
67     SGPropertyNode_ptr _enabled;
68     SGPropertyNode_ptr _volume;
69     SGPropertyNode_ptr _avionics_enabled;
70     SGPropertyNode_ptr _avionics_volume;
71     SGPropertyNode_ptr _avionics_ext;
72     SGPropertyNode_ptr _internal;
73 };
74
75
76 #endif
77
78 // end of fg_fx.hxx