]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sound.cc
refactoring needed for win32 crash
[chaz/yoink] / src / Moof / Sound.cc
index 3aec3f6aa90aa85f4c0f40936508a6ae01a2fff7..ca3ecfec8117fb93386edf6128c507d5ae41bcc2 100644 (file)
@@ -35,8 +35,8 @@
 #include <vorbis/codec.h>
 #include <vorbis/vorbisfile.h>
 
-#include "Engine.hh"
-#include "Exception.hh"
+#include "Core.hh"
+#include "Error.hh"
 #include "Library.hh"
 #include "Log.hh"
 #include "Sound.hh"
@@ -66,7 +66,7 @@ public:
        {
        public:
 
-               Buffer(const std::string& name) :
+               explicit Buffer(const std::string& name) :
                        Library<Buffer>(name),
                        mBuffer(-1)
                {
@@ -97,9 +97,9 @@ public:
 
                        if (result < 0)
                        {
-                               logWarning("error while loading sound %s",
-                                               getName().c_str());
-                               throw Exception(ErrorCode::UNKNOWN_AUDIO_FORMAT, getName());
+                               logWarning << "error while loading sound "
+                                                  << getName() << std::endl;
+                               throw Error(Error::UNKNOWN_AUDIO_FORMAT, getName());
                        }
 
                        vorbis_info* vorbisInfo = ov_info(&mOggStream, -1);
@@ -134,7 +134,8 @@ public:
                        }
                        if (size == 0)
                        {
-                               logWarning("decoded no bytes from %s", getName().c_str());
+                               logWarning << "decoded no bytes from "
+                                                  << getName() << std::endl;
                                return;
                        }
 
@@ -206,9 +207,6 @@ public:
 
        void init()
        {
-               // make sure the engine is initialized
-               Engine::getInstance();
-
                mIsLoaded = false;
                mIsPlaying = false;
                mIsLooping = false;
@@ -439,6 +437,8 @@ public:
        std::deque<BufferP>             mQueue;
 
        Timer                                   mStreamTimer;
+
+       Backend                                 mBackend;
 };
 
 
This page took 0.019036 seconds and 4 git commands to generate.