]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_commands.cxx
bug99 - Fix case where damping is enabled, but factor is 0.
[flightgear.git] / src / Main / fg_commands.cxx
index ab6a15844df8542af151037960ff1efce5da0384..c8b938473cd1218e06d305653c4166051fa0d0fd 100644 (file)
@@ -34,7 +34,7 @@
 #include <Scenery/tilemgr.hxx>
 #include <Scenery/scenery.hxx>
 #include <Scripting/NasalSys.hxx>
-#include <Sound/fg_fx.hxx>
+#include <Sound/sample_queue.hxx>
 #include <Time/sunsolver.hxx>
 #include <Time/tmp.hxx>
 
@@ -189,7 +189,7 @@ do_exit (const SGPropertyNode * arg)
     fgSetBool("/sim/signals/exit", true);
 
     if (fgGetBool("/sim/startup/save-on-exit")) {
-#ifdef _MSC_VER
+#ifdef _WIN32
         char* envp = ::getenv( "APPDATA" );
         if ( envp != NULL ) {
             SGPath config( envp );
@@ -1254,15 +1254,20 @@ do_play_audio_sample (const SGPropertyNode * arg)
 {
     string path = arg->getStringValue("path");
     string file = arg->getStringValue("file");
-    double volume = arg->getDoubleValue("volume");
+    float volume = arg->getFloatValue("volume");
     // cout << "playing " << path << " / " << file << endl;
     try {
-        static FGFX *fx = 0;
-        if ( !fx ) {
-           SGSoundMgr *smgr = (SGSoundMgr *)globals->get_subsystem("soundmgr");
-           fx = (FGFX *)smgr->find("fx");
+        static FGSampleQueue *queue = 0;
+        if ( !queue ) {
+           SGSoundMgr *smgr = globals->get_soundmgr();
+           queue = new FGSampleQueue(smgr, "chatter");
+           queue->tie_to_listener();
         }
-        if (fx) fx->play_message( path, file, volume );
+
+        SGSoundSample *msg = new SGSoundSample(path.c_str(), file.c_str());
+        msg->set_volume( volume );
+        queue->add( msg );
+
         return true;
 
     } catch (const sg_io_exception&) {