]> git.mxchange.org Git - flightgear.git/commitdiff
Syd Adams:
authorcurt <curt>
Fri, 20 Apr 2007 18:32:42 +0000 (18:32 +0000)
committercurt <curt>
Fri, 20 Apr 2007 18:32:42 +0000 (18:32 +0000)
Patch to enable atc chatter (and any other arbitrary "message" audio file)
to be played at any specified volume.  (Previously these messages were always
played at a hardcoded volume of 1.0)

src/Main/fg_commands.cxx
src/Sound/fg_fx.cxx
src/Sound/fg_fx.hxx

index e07295dde94397f830e767eec4d67527289d814c..21b86efbc29e93e50ed5e9be5ce0557665c7e724 100644 (file)
@@ -1157,8 +1157,9 @@ do_play_audio_message (const SGPropertyNode * arg)
     FGFX *fx = (FGFX *)globals->get_subsystem("fx");
     string path = arg->getStringValue("path");
     string file = arg->getStringValue("file");
+    double volume = arg->getDoubleValue("volume");
     // cout << "playing " << path << " / " << file << endl;
-    fx->play_message( path, file );
+    fx->play_message( path, file, volume );
 
     return true;
 }
index 37df00392ec528e403df8bbefe918147900b2dd8..de5f4e152bd7882b8a6a7d3333042ebaa27394af 100644 (file)
@@ -187,17 +187,17 @@ FGFX::update (double dt)
 void
 FGFX::play_message( SGSoundSample *_sample )
 {
-    _sample->set_volume( 1.0 );
     _samplequeue.push( _sample );
 }
 void
-FGFX::play_message( const string path, const string fname )
+FGFX::play_message( const string path, const string fname, double volume )
 {
     if (globals->get_soundmgr()->is_working() == false) {
         return;
     }
     SGSoundSample *sample;
     sample = new SGSoundSample( path.c_str(), fname.c_str() );
+    sample->set_volume( volume );
     play_message( sample );
 }
 
index 3bfa58c3573e958134f31528bd13b832352aff22..0fd4a2ff2bdfbe880f42cc236729c91dff120d49 100644 (file)
@@ -72,7 +72,7 @@ public:
      * in order.
      */
     void play_message( SGSoundSample *_sample );
-    void play_message( const string path, const string fname );
+    void play_message( const string path, const string fname, double volume );
 
 private: