| 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 | using SGXmlSoundRef = SGSharedPtr<SGXmlSound>; |
| 37 | |
| 38 | /** |
| 39 | * Generator for FlightGear model sound effects. |
| 40 | * |
| 41 | * This module uses a FGSampleGroup class to generate sound effects based |
| 42 | * on current flight conditions. The sound manager must be initialized |
| 43 | * before this object is. |
| 44 | * |
| 45 | * This module will load and play a set of sound effects defined in an |
| 46 | * xml file and tie them to various property states. |
| 47 | */ |
| 48 | class FGFX : public SGSampleGroup |
| 49 | { |
| 50 | |
| 51 | public: |
| 52 | |
| 53 | FGFX ( const std::string &refname, SGPropertyNode *props = 0 ); |
| 54 | virtual ~FGFX (); |
| 55 | |
| 56 | void init(); |
| 57 | void update (double dt) override; |
| 58 | void shutdown(); |
| 59 | |
| 60 | private: |
| 61 | |
| 62 | bool _active; |
| 63 | bool _is_aimodel; |
| 64 | SGSharedPtr<SGSampleGroup> _avionics; |
| 65 | SGSharedPtr<SGSampleGroup> _atc; |
| 66 | |
| 67 | std::vector<SGXmlSoundRef> _xmlSounds; |
| 68 | |
| 69 | SGPropertyNode_ptr _props; |
| 70 | SGPropertyNode_ptr _enabled; |
| 71 | SGPropertyNode_ptr _volume; |
| 72 | SGPropertyNode_ptr _avionics_enabled; |
| 73 | SGPropertyNode_ptr _avionics_volume; |
| 74 | SGPropertyNode_ptr _avionics_ext; |
| 75 | SGPropertyNode_ptr _internal; |
| 76 | SGPropertyNode_ptr _atc_enabled; |
| 77 | SGPropertyNode_ptr _atc_volume; |
| 78 | SGPropertyNode_ptr _atc_ext; |
| 79 | SGPropertyNode_ptr _machwave_active; |
| 80 | SGPropertyNode_ptr _machwave_volume; |
| 81 | }; |
| 82 | |
| 83 | |
| 84 | #endif |
| 85 | |
| 86 | // end of fg_fx.hxx |