1 // fg_fx.hxx -- Sound effect management class
3 // Started by David Megginson, October 2001
4 // (Reuses some code from main.cxx, probably by Curtis Olson)
6 // Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
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.
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.
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.
27 #include <simgear/compiler.h>
32 #include <simgear/sound/sample_openal.hxx>
33 #include <simgear/structure/subsystem_mgr.hxx>
41 * Generator for FlightGear sound effects.
43 * This module uses FGSoundMgr to generate sound effects based
44 * on current flight conditions. The sound manager must be initialized
45 * before this object is.
47 * Note: this module supports two separate sound mechanisms concurrently.
49 * 1. This module will load and play a set of sound effects defined in an
50 * xml file and tie them to various property states.
51 * 2. This modules also maintains a queue of 'message' audio files. These
52 * are played sequentially with no overlap until the queue is finished.
53 * This second mechanims is useful for things like tutorial messages or
54 * background atc chatter.
56 class FGFX : public SGSubsystem
65 virtual void reinit ();
67 virtual void unbind ();
68 virtual void update (double dt);
71 * add a sound sample to the message queue which is played sequentially
74 void play_message( SGSoundSample *_sample );
75 void play_message( const string path, const string fname );
79 vector<SGXmlSound *> _sound;
80 queue<SGSoundSample *> _samplequeue;
85 SGPropertyNode_ptr _pause;
86 SGPropertyNode_ptr _volume;