]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_openal.cxx
Lower verbosity.
[simgear.git] / simgear / sound / sample_openal.cxx
index a4459788731de4e4d277dd9fd50d78290be078da..2a36333ae6e88407555760052925716063015121 100644 (file)
 // $Id$
 
 
-#include <AL/al.h>
-#include <AL/alut.h>
+#if defined( __APPLE__ )
+# define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+#endif
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
@@ -86,8 +93,13 @@ SGSoundSample::SGSoundSample( const char *path, const char *file ) :
     }
 
     // Load the sample file
+#if defined (__APPLE__)
+    alutLoadWAVFile( (ALbyte *)samplepath.c_str(),
+                     &format, &data, &size, &freq );
+#else
     alutLoadWAVFile( (ALbyte *)samplepath.c_str(),
                      &format, &data, &size, &freq, &loop );
+#endif
     if (alGetError() != AL_NO_ERROR) {
         throw sg_exception("Failed to load wav file.");
     }
@@ -157,7 +169,7 @@ SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq ) :
 
 // destructor
 SGSoundSample::~SGSoundSample() {
-    SG_LOG( SG_GENERAL, SG_ALERT, "Deleting a sample" );
+    SG_LOG( SG_GENERAL, SG_INFO, "Deleting a sample" );
     alDeleteSources(1, &source);
     alDeleteBuffers(1, &buffer);
 }