]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_fx.hxx
Make the sound-manager optional in a few places.
[flightgear.git] / src / Sound / fg_fx.hxx
index 8822806803f55fe45c733b30813a093ca155dc76..7d5132dd9e2a9c85a80fc4ba97f423b03ddab104 100644 (file)
 
 #include <simgear/compiler.h>
 
-#include <queue>
 #include <vector>
 
-#include <simgear/sound/sample_openal.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
-
-using std::queue;
-using std::vector;
+#include <simgear/props/props.hxx>
+#include <simgear/sound/sample_group.hxx>
 
 class SGXmlSound;
 
 /**
  * Generator for FlightGear sound effects.
  *
- * This module uses FGSoundMgr to generate sound effects based
- * on current flight conditions.  The sound manager must be initialized
+ * This module uses a FGSampleGroup class to generate sound effects based
+ * on current flight conditions. The sound manager must be initialized
  * before this object is.
  *
- * Note: this module supports two separate sound mechanisms concurrently.
- *
- * 1. This module will load and play a set of sound effects defined in an
+ *    This module will load and play a set of sound effects defined in an
  *    xml file and tie them to various property states.
- * 2. This modules also maintains a queue of 'message' audio files.  These
- *    are played sequentially with no overlap until the queue is finished.
- *    This second mechanims is useful for things like tutorial messages or
- *    background atc chatter.
  */
-class FGFX : public SGSubsystem
+class FGFX : public SGSampleGroup
 {
 
 public:
 
-    FGFX ();
+    FGFX ( const std::string &refname, SGPropertyNode *props = 0 );
     virtual ~FGFX ();
 
     virtual void init ();
     virtual void reinit ();
-    virtual void bind ();
-    virtual void unbind ();
     virtual void update (double dt);
 
-    /**
-     * add a sound sample to the message queue which is played sequentially
-     * in order.
-     */
-    void play_message( SGSoundSample *_sample );
-    void play_message( const string path, const string fname, double volume );
-
 private:
 
-    vector<SGXmlSound *> _sound;
-    queue<SGSoundSample *> _samplequeue;
+    bool _is_aimodel;
+    SGSharedPtr<SGSampleGroup> _avionics;
+    std::vector<SGXmlSound *> _sound;
 
-    bool last_pause;
-    double last_volume;
-
-    SGPropertyNode_ptr _pause;
+    SGPropertyNode_ptr _props;
+    SGPropertyNode_ptr _enabled;
     SGPropertyNode_ptr _volume;
-
+    SGPropertyNode_ptr _avionics_enabled;
+    SGPropertyNode_ptr _avionics_volume;
+    SGPropertyNode_ptr _avionics_ext;
+    SGPropertyNode_ptr _internal;
 };