]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sound.cc
foundational changes; tying up some loose ends
[chaz/yoink] / src / Moof / Sound.cc
index 4c60e328085f60d7d282c2e70144079c49c5dbc2..4275ea4485900c67e147aeb04165b5f6c2496b30 100644 (file)
@@ -35,6 +35,7 @@
 #include <vorbis/codec.h>
 #include <vorbis/vorbisfile.h>
 
+#include "Engine.hh"
 #include "Exception.hh"
 #include "Library.hh"
 #include "Log.hh"
@@ -98,15 +99,12 @@ public:
                        {
                                logWarning("error while loading sound %s",
                                                getName().c_str());
-                               throw Exception(ErrorCode::UNKNOWN_AUDIO_FORMAT);
+                               throw Exception(ErrorCode::UNKNOWN_AUDIO_FORMAT, getName());
                        }
 
                        vorbis_info* vorbisInfo = ov_info(&mOggStream, -1);
                        mFormat = getAudioFormat(vorbisInfo);
                        mFreq = vorbisInfo->rate;
-
-                       logDebug("   channels: %d", vorbisInfo->channels);
-                       logDebug("  frequency: %d", vorbisInfo->rate);
                }
 
 
@@ -137,7 +135,6 @@ public:
                        if (size == 0)
                        {
                                logWarning("decoded no bytes from %s", getName().c_str());
-                               //throw Exception("file_not_found");
                                return;
                        }
 
@@ -209,6 +206,9 @@ public:
 
        void init()
        {
+               // make sure the engine is initialized
+               Engine::getInstance();
+
                ALfloat zero[] = {0.0f, 0.0f, 0.0f};
                
                alGenSources(1, &mSource);
This page took 0.018028 seconds and 4 git commands to generate.