27
27
#include <simgear/compiler.h>
32
#include <simgear/sound/sample_openal.hxx>
33
31
#include <simgear/structure/subsystem_mgr.hxx>
32
#include <simgear/sound/sample_group.hxx>
41
37
* 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
39
* This module uses a FGSampleGroup class to generate sound effects based
40
* on current flight conditions. The sound manager must be initialized
45
41
* 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
43
* This module will load and play a set of sound effects defined in an
50
44
* 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
46
class FGFX : public SGSampleGroup
51
FGFX ( SGSoundMgr *smgr, const string &refname );
64
54
virtual void init ();
65
55
virtual void reinit ();
67
virtual void unbind ();
68
56
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, double volume );
79
void update_pos_and_orientation(SGSoundMgr *smgr, double dt);
80
sgdVec3 last_visitor_pos;
81
sgdVec3 last_model_pos;
83
vector<SGXmlSound *> _sound;
84
queue<SGSoundSample *> _samplequeue;
89
SGPropertyNode_ptr _pause;
60
SGSharedPtr<SGSampleGroup> _avionics;
61
std::vector<SGXmlSound *> _sound;
63
SGPropertyNode_ptr _enabled;
90
64
SGPropertyNode_ptr _volume;
65
SGPropertyNode_ptr _avionics_enabled;
66
SGPropertyNode_ptr _avionics_volume;
67
SGPropertyNode_ptr _avionics_external;
68
SGPropertyNode_ptr _internal;