#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"
{
public:
- Buffer(const std::string& name) :
+ explicit Buffer(const std::string& name) :
Library<Buffer>(name),
mBuffer(-1)
{
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);
}
if (size == 0)
{
- logWarning("decoded no bytes from %s", getName().c_str());
+ logWarning << "decoded no bytes from "
+ << getName() << std::endl;
return;
}
void init()
{
- // make sure the engine is initialized
- Engine::getInstance();
-
mIsLoaded = false;
mIsPlaying = false;
mIsLooping = false;
std::deque<BufferP> mQueue;
Timer mStreamTimer;
+
+ Backend mBackend;
};