]> git.mxchange.org Git - flightgear.git/blob - src/Sound/environment_fx.hxx
Add Nasal bindings
[flightgear.git] / src / Sound / environment_fx.hxx
1 // fg_environmentfx.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 __FGENVIRONMENTFX_HXX
25 #define __FGENVIRONMENTFX_HXX 1
26
27 #include <simgear/compiler.h>
28
29 #include <simgear/structure/subsystem_mgr.hxx>
30 #include <simgear/props/props.hxx>
31 #include <simgear/sound/sample_group.hxx>
32 #include <simgear/math/SGMathFwd.hxx>
33
34
35
36 /**
37  * Container for FlightGear envirnonmetal sound effects.
38  */
39 class FGEnvironmentFX : public SGSampleGroup
40 {
41
42 public:
43
44     FGEnvironmentFX();
45     virtual ~FGEnvironmentFX();
46
47     void init ();
48     void reinit();
49     void update (double dt);
50     void unbind();
51
52     bool add(const std::string& path_str, const std::string& refname);
53     void position(const std::string& refname, double lon, double lat, double elevation = 0.0);
54     void pitch(const std::string& refname, float pitch);
55     void volume(const std::string& refname, float volume);
56     void properties(const std::string& refname, float reference_dist, float max_dist = -1 );
57     void play(const std::string& refname, bool looping = false);
58     void stop(const std::string& refname);
59
60 private:
61     SGPropertyNode_ptr _enabled;
62     SGPropertyNode_ptr _volume;
63 };
64
65
66 #endif
67
68 // end of fg_environmentfx.hxx