]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
Lower verbosity level.
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index 2578f1ccad87c67c0d01a11ca4b23f00b12e609e..7c7b89b6f289dcc0472d2a5a1ff548fca0c609f5 100644 (file)
 
 #include <iostream>
 
-#include <AL/al.h>
-#include <AL/alut.h>
-#include <AL/alc.h>
+#if defined(__APPLE__)
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+# include <OpenAL/alc.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+# include <AL/alc.h>
+#endif
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
@@ -77,6 +83,9 @@ SGSoundMgr::SGSoundMgr() {
        SG_LOG( SG_GENERAL, SG_ALERT,
                 "Oops AL error after audio initialization!" );
     }
+
+    // exaggerate the ear candy?
+    alDopplerFactor(1.0);
 }
 
 // destructor
@@ -261,3 +270,25 @@ bool SGSoundMgr::stop( const string& refname ) {
         return true;
     }
 }
+
+
+// set source position of all managed sounds
+void SGSoundMgr::set_source_pos_all( ALfloat *pos ) {
+    sample_map_iterator sample_current = samples.begin();
+    sample_map_iterator sample_end = samples.end();
+    for ( ; sample_current != sample_end; ++sample_current ) {
+       SGSoundSample *sample = sample_current->second;
+        sample->set_source_pos( pos );
+    }
+}
+
+
+// set source velocity of all managed sounds
+void SGSoundMgr::set_source_vel_all( ALfloat *vel ) {
+    sample_map_iterator sample_current = samples.begin();
+    sample_map_iterator sample_end = samples.end();
+    for ( ; sample_current != sample_end; ++sample_current ) {
+       SGSoundSample *sample = sample_current->second;
+        sample->set_source_vel( vel );
+    }
+}