Index: trunk/src/lib/sound/sound_buffer.cc
===================================================================
--- trunk/src/lib/sound/sound_buffer.cc	(revision 7290)
+++ trunk/src/lib/sound/sound_buffer.cc	(revision 7460)
@@ -23,80 +23,80 @@
 #include <cassert>
 
-using namespace std;
+namespace OrxSound
+{
+  //////////////////
+  /* SOUND-BUFFER */
+  //////////////////
+  /**
+   *  Creates a Soundbuffer out of an inputfile
+   * @param fileName The name of the File
+   */
+  SoundBuffer::SoundBuffer(const std::string& fileName)
+  {
+    this->setClassID(CL_SOUND_BUFFER, "SoundBuffer");
+    this->setName(fileName);
 
-//////////////////
-/* SOUND-BUFFER */
-//////////////////
-/**
- *  Creates a Soundbuffer out of an inputfile
- * @param fileName The name of the File
- */
-SoundBuffer::SoundBuffer(const std::string& fileName)
-{
-  this->setClassID(CL_SOUND_BUFFER, "SoundBuffer");
-  this->setName(fileName);
-
-  // generate a Buffer
-  alGenBuffers(1, &this->bufferID);
-  SoundEngine::checkError("Generate Buffer", __LINE__);
-  this->loadWAV(fileName);
-}
-
-SoundBuffer::~SoundBuffer()
-{
-  //  SoundEngine::getInstance()->removeBuffer(this);
-  alDeleteBuffers(1, &this->bufferID);
-  SoundEngine::checkError("SoundBuffer: Delete Buffer", __LINE__);
-}
-
-/**
- * @brief loads a Waveform from the local fileSystem into this Source.
- * @param fileName the Name of the File to Load.
- * @returns true on success.
- */
-bool SoundBuffer::loadWAV(const std::string& fileName)
-{
-  SDL_AudioSpec wavSpec;
-  Uint32 wavLength;
-  Uint8 *wavBuffer;
-
-  /* Load the WAV */
-  if( SDL_LoadWAV(fileName.c_str(), &wavSpec, &wavBuffer, &wavLength) == NULL)
-  {
-    PRINTF(2)("Could not open %s: %s\n", fileName.c_str(), SDL_GetError());
-    return false;
+    // generate a Buffer
+    alGenBuffers(1, &this->bufferID);
+    SoundEngine::checkError("Generate Buffer", __LINE__);
+    this->loadWAV(fileName);
   }
 
-  alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), wavBuffer, wavLength, wavSpec.freq);
-  SDL_FreeWAV(wavBuffer);
-  if (SoundEngine::checkError("Could not load Wave file", __LINE__))
-    return true;
-  else
-    return false;
+  SoundBuffer::~SoundBuffer()
+  {
+    //  SoundEngine::getInstance()->removeBuffer(this);
+    alDeleteBuffers(1, &this->bufferID);
+    SoundEngine::checkError("SoundBuffer: Delete Buffer", __LINE__);
+  }
+
+  /**
+   * @brief loads a Waveform from the local fileSystem into this Source.
+   * @param fileName the Name of the File to Load.
+   * @returns true on success.
+   */
+  bool SoundBuffer::loadWAV(const std::string& fileName)
+  {
+    SDL_AudioSpec wavSpec;
+    Uint32 wavLength;
+    Uint8 *wavBuffer;
+
+    /* Load the WAV */
+    if( SDL_LoadWAV(fileName.c_str(), &wavSpec, &wavBuffer, &wavLength) == NULL)
+    {
+      PRINTF(2)("Could not open %s: %s\n", fileName.c_str(), SDL_GetError());
+      return false;
+    }
+
+    alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), wavBuffer, wavLength, wavSpec.freq);
+    SDL_FreeWAV(wavBuffer);
+    if (SoundEngine::checkError("Could not load Wave file", __LINE__))
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * @brief converts an SDL_AudioSpec into a valid OpenAL AUDIO_FORMAT enumerator
+   * @param audiospec the AudioSpec to convert.
+   * @returns the AL_FORMAT
+   */
+  ALenum SoundBuffer::sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec)
+  {
+    assert (audiospec != NULL);
+    bool stereo = true;
+    bool is16Bit = true;
+    if (audiospec->format == AUDIO_U8 || audiospec->format == AUDIO_S8)
+      is16Bit = false;
+    if (audiospec->channels == 1)
+      stereo = false;
+
+    if (!stereo && !is16Bit)
+      return AL_FORMAT_MONO8;
+    else if (!stereo && is16Bit)
+      return AL_FORMAT_MONO16;
+    else if (stereo && !is16Bit)
+      return AL_FORMAT_STEREO8;
+    else if (stereo && is16Bit)
+      return AL_FORMAT_STEREO16;
+  }
 }
-
-/**
- * @brief converts an SDL_AudioSpec into a valid OpenAL AUDIO_FORMAT enumerator
- * @param audiospec the AudioSpec to convert.
- * @returns the AL_FORMAT
- */
-ALenum SoundBuffer::sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec)
-{
-  assert (audiospec != NULL);
-  bool stereo = true;
-  bool is16Bit = true;
-  if (audiospec->format == AUDIO_U8 || audiospec->format == AUDIO_S8)
-    is16Bit = false;
-  if (audiospec->channels == 1)
-    stereo = false;
-
-  if (!stereo && !is16Bit)
-    return AL_FORMAT_MONO8;
-  else if (!stereo && is16Bit)
-    return AL_FORMAT_MONO16;
-  else if (stereo && !is16Bit)
-    return AL_FORMAT_STEREO8;
-  else if (stereo && is16Bit)
-    return AL_FORMAT_STEREO16;
-}
-
