X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSound%2Ffg_fx.hxx;h=26c802f34a8f56953b26f5e5b7bbf0e488ea9c7a;hb=d39841d2dfdf82e1d590ab331888e3a392d199c6;hp=1f7138bc1bb56abd71b682273eb1e76e4169e4f6;hpb=e503591af4f16814d78ded49c5979e273d81a0be;p=flightgear.git diff --git a/src/Sound/fg_fx.hxx b/src/Sound/fg_fx.hxx index 1f7138bc1..26c802f34 100644 --- a/src/Sound/fg_fx.hxx +++ b/src/Sound/fg_fx.hxx @@ -26,73 +26,46 @@ #include -#include #include #include -#include +#include class SGXmlSound; -class SGSoundSample; -class SGSoundMgr; /** * 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 ( SGSoundMgr *smgr, const string &refname ); 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 std::string& path, const std::string& fname, double volume ); - - /** - * Explicit late update hook, to avoid problems which occur if done during - * normal SGSubsytem updating. - */ - void update_fx_late(double dt); - private: - void update_pos_and_orientation(SGSoundMgr *smgr, double dt); - SGVec3d last_visitor_pos; - SGVec3d last_model_pos; - + SGSharedPtr _avionics; std::vector _sound; - std::queue _samplequeue; - - bool last_pause; - double last_volume; - SGPropertyNode_ptr _pause; + SGPropertyNode_ptr _enabled; SGPropertyNode_ptr _volume; + SGPropertyNode_ptr _avionics_enabled; + SGPropertyNode_ptr _avionics_volume; + SGPropertyNode_ptr _avionics_external; + SGPropertyNode_ptr _internal; };