Index: /trunk/src/lib/sound/Makefile.am
===================================================================
--- /trunk/src/lib/sound/Makefile.am	(revision 5385)
+++ /trunk/src/lib/sound/Makefile.am	(revision 5386)
@@ -5,6 +5,10 @@
 
 libORXsound_a_SOURCES = sound_engine.cc \
+			sound_source.cc \
+			sound_buffer.cc \
                         ogg_player.cc
 
 noinst_HEADERS = sound_engine.h \
+		 sound_source.h \
+		 sound_buffer.h \
                  ogg_player.h
Index: /trunk/src/lib/sound/Makefile.in
===================================================================
--- /trunk/src/lib/sound/Makefile.in	(revision 5385)
+++ /trunk/src/lib/sound/Makefile.in	(revision 5386)
@@ -54,5 +54,7 @@
 libORXsound_a_AR = $(AR) $(ARFLAGS)
 libORXsound_a_LIBADD =
-am_libORXsound_a_OBJECTS = sound_engine.$(OBJEXT) ogg_player.$(OBJEXT)
+am_libORXsound_a_OBJECTS = sound_engine.$(OBJEXT) \
+	sound_source.$(OBJEXT) sound_buffer.$(OBJEXT) \
+	ogg_player.$(OBJEXT)
 libORXsound_a_OBJECTS = $(am_libORXsound_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@@ -60,5 +62,7 @@
 am__depfiles_maybe = depfiles
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ogg_player.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/sound_engine.Po
+@AMDEP_TRUE@	./$(DEPDIR)/sound_buffer.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/sound_engine.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/sound_source.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -183,7 +187,11 @@
 noinst_LIBRARIES = libORXsound.a
 libORXsound_a_SOURCES = sound_engine.cc \
+			sound_source.cc \
+			sound_buffer.cc \
                         ogg_player.cc
 
 noinst_HEADERS = sound_engine.h \
+		 sound_source.h \
+		 sound_buffer.h \
                  ogg_player.h
 
@@ -236,5 +244,7 @@
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogg_player.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sound_buffer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sound_engine.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sound_source.Po@am__quote@
 
 .cc.o:
Index: /trunk/src/lib/sound/sound_buffer.cc
===================================================================
--- /trunk/src/lib/sound/sound_buffer.cc	(revision 5386)
+++ /trunk/src/lib/sound/sound_buffer.cc	(revision 5386)
@@ -0,0 +1,78 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SOUND
+
+#include "sound_buffer.h"
+
+#include "sound_engine.h"
+
+
+using namespace std;
+
+
+//////////////////
+/* SOUND-BUFFER */
+//////////////////
+/**
+ *  Creates a Soundbuffer out of an inputfile
+ * @param fileName The name of the File
+ */
+SoundBuffer::SoundBuffer(const char* fileName)
+{
+  this->setClassID(CL_SOUND_BUFFER, "SoundBuffer");
+  this->setName(fileName);
+
+  SoundEngine::getInstance()->addBuffer(this);
+
+  ALenum format;
+  ALvoid* data;
+  ALsizei freq;
+
+  ALenum result;
+
+  // generate a Buffer
+  alGenBuffers(1, &this->bufferID);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+
+  // read in the wav data
+  /* according to http://www.edenwaith.com/products/pige/tutorials/openal.php the alutLoadWAVFile differs from platform to platform*/
+#ifdef __APPLE__
+  alutLoadWAVFile((ALbyte*)fileName, &format, &data, &this->size, &freq);
+#elif defined __WIN32__
+  alutLoadWAVFile(fileName, &format, &data, &size, &freq, &this->loop);
+#else
+  alutLoadWAVFile((ALbyte*)fileName, &format, &data, &this->size, &freq, &this->loop);
+#endif
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+
+  // send the loaded wav data to the buffer
+  alBufferData(this->bufferID, format, data, this->size, freq);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+
+  // remove the wav data (redundant)
+  alutUnloadWAV(format, data, this->size, freq);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+}
+
+SoundBuffer::~SoundBuffer()
+{
+//  SoundEngine::getInstance()->removeBuffer(this);
+  alDeleteBuffers(1, &this->bufferID);
+}
Index: /trunk/src/lib/sound/sound_buffer.h
===================================================================
--- /trunk/src/lib/sound/sound_buffer.h	(revision 5386)
+++ /trunk/src/lib/sound/sound_buffer.h	(revision 5386)
@@ -0,0 +1,31 @@
+/*!
+ * @file sound_buffer.h
+ * @brief Definition of the sound-buffer-class
+*/
+
+#ifndef _SOUND_BUFFER_H
+#define _SOUND_BUFFER_H
+
+#include "base_object.h"
+#include "alincl.h"
+
+// FORWARD DECLARATION
+
+//! A class that represents a datastructure to play Sounds.
+class SoundBuffer : public BaseObject
+{
+  public:
+    SoundBuffer(const char* fileName);
+    ~SoundBuffer();
+
+    /** @returns the ID of the buffer used in this SoundBuffer */
+    inline ALuint getID() const { return this->bufferID; }
+
+  private:
+    ALuint        bufferID;             //!< The address of the Buffer.
+
+    ALsizei       size;                 //!< The size of the Buffer.
+    ALboolean     loop;                 //!< loop information.
+};
+
+#endif /* _SOUND_BUFFER_H */
Index: /trunk/src/lib/sound/sound_engine.cc
===================================================================
--- /trunk/src/lib/sound/sound_engine.cc	(revision 5385)
+++ /trunk/src/lib/sound/sound_engine.cc	(revision 5386)
@@ -17,5 +17,5 @@
 */
 
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SOUND
 
 #include "sound_engine.h"
@@ -31,153 +31,4 @@
 
 using namespace std;
-
-//////////////////
-/* SOUND-BUFFER */
-//////////////////
-/**
- *  Creates a Soundbuffer out of an inputfile
- * @param fileName The name of the File
-*/
-SoundBuffer::SoundBuffer(const char* fileName)
-{
-  this->setClassID(CL_SOUND_BUFFER, "SoundBuffer");
-  this->setName(fileName);
-
-  SoundEngine::getInstance()->addBuffer(this);
-
-  ALenum format;
-  ALvoid* data;
-  ALsizei freq;
-
-  ALenum result;
-
-  // generate a Buffer
-  alGenBuffers(1, &this->bufferID);
-  if ((result = alGetError()) != AL_NO_ERROR)
-    SoundEngine::PrintALErrorString(result);
-
-  // read in the wav data
-  /* according to http://www.edenwaith.com/products/pige/tutorials/openal.php the alutLoadWAVFile differs from platform to platform*/
-#ifdef __APPLE__
-  alutLoadWAVFile((ALbyte*)fileName, &format, &data, &this->size, &freq);
-#elif defined __WIN32__
-  alutLoadWAVFile(fileName, &format, &data, &size, &freq, &this->loop);
-#else
-  alutLoadWAVFile((ALbyte*)fileName, &format, &data, &this->size, &freq, &this->loop);
-#endif
-  if ((result = alGetError()) != AL_NO_ERROR)
-    SoundEngine::PrintALErrorString(result);
-
-  // send the loaded wav data to the buffer
-  alBufferData(this->bufferID, format, data, this->size, freq);
-  if ((result = alGetError()) != AL_NO_ERROR)
-    SoundEngine::PrintALErrorString(result);
-
-  // remove the wav data (redundant)
-  alutUnloadWAV(format, data, this->size, freq);
-  if ((result = alGetError()) != AL_NO_ERROR)
-    SoundEngine::PrintALErrorString(result);
-}
-
-SoundBuffer::~SoundBuffer()
-{
-//  SoundEngine::getInstance()->removeBuffer(this);
-  alDeleteBuffers(1, &this->bufferID);
-}
-
-//////////////////
-/* SOUND-SOURCE */
-//////////////////
-/**
- *  creates a SoundSource at position sourceNode with the SoundBuffer buffer
-*/
-SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
-{
-  this->setClassID(CL_SOUND_SOURCE, "SoundSource");
-
-  ALenum result;
-
-  // adding the Source to the SourcesList of the SoundEngine
-  SoundEngine::getInstance()->addSource(this);
-
-  this->buffer = buffer;
-  this->sourceNode = sourceNode;
-
-  alGenSources(1, &this->sourceID);
-  if ((result = alGetError()) != AL_NO_ERROR)
-    SoundEngine::PrintALErrorString(result);
-  if (this->buffer != NULL)
-    alSourcei (this->sourceID, AL_BUFFER,   this->buffer->getID());
-  alSourcef (this->sourceID, AL_PITCH,    1.0      );
-  alSourcef (this->sourceID, AL_GAIN,     SoundEngine::getInstance()->getEffectsVolume() );
-  alSourcei (sourceID, AL_LOOPING,  AL_FALSE     );
-}
-
-/**
- *  deletes a SoundSource
-*/
-SoundSource::~SoundSource()
-{
-  //SoundEngine::getInstance()->removeSource(this);
-  alDeleteSources(1, &this->sourceID);
-}
-
-/**
- *  Plays back a SoundSource
-*/
-void SoundSource::play()
-{
-  alSourcePlay(this->sourceID);
-}
-
-/**
- * Plays back buffer on this Source
- * @param buffer the buffer to play back on this Source
- */
-void SoundSource::play(const SoundBuffer* buffer)
-{
-  alSourceStop(this->sourceID);
-  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
-  alSourcePlay(this->sourceID);
-
-  if (unlikely(this->buffer != NULL))
-    alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
-}
-
-/**
- *  Stops playback of a SoundSource
-*/
-void SoundSource::stop()
-{
-  alSourceStop(this->sourceID);
-}
-
-/**
- *  Pauses Playback of a SoundSource
-*/
-void SoundSource::pause()
-{
-  alSourcePause(this->sourceID);
-}
-
-/**
- *  Rewinds Playback of a SoundSource
-*/
-void SoundSource::rewind()
-{
-  alSourceRewind(this->sourceID);
-}
-
-/**
- *  sets the RolloffFactor of the Sound emitted from the SoundSource
- * @param rolloffFactor The Factor described
-
-   this tells openAL how fast the Sounds decay outward from the Source
-*/
-void SoundSource::setRolloffFactor(ALfloat rolloffFactor)
-{
-  alSourcef(this->sourceID, AL_ROLLOFF_FACTOR, rolloffFactor);
-}
-
 
 
@@ -439,10 +290,10 @@
   const char* devWalk = deviceList;
   if (alcIsExtensionPresent(NULL, (ALubyte*)"ALC_ENUMERATION_EXT") == AL_TRUE) { // try out enumeration extension
-    printf("Enumeration-extension found\n");
-
-    printf("Default device: %s\n", defaultDevice);
+    PRINTF(3)("Enumeration-extension found\n");
+
+    PRINTF(3)("Default device: %s\n", defaultDevice);
     do
     {
-      printf("%s\n", devWalk);
+      PRINTF(3)("%s\n", devWalk);
       devWalk += strlen(devWalk)+1;
     } while (devWalk[0] != '\0');
Index: /trunk/src/lib/sound/sound_engine.h
===================================================================
--- /trunk/src/lib/sound/sound_engine.h	(revision 5385)
+++ /trunk/src/lib/sound/sound_engine.h	(revision 5386)
@@ -10,4 +10,7 @@
 #include "alincl.h"
 
+#include "sound_buffer.h"
+#include "sound_source.h"
+
 #define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
 #define SOUND_DOPPLER_VELOCITY     5000000        //!< A factor for the TravelSpeed of sound
@@ -17,54 +20,4 @@
 template<class T> class tList;
 class IniParser;
-
-
-//! A class that represents a datastructure to play Sounds.
-class SoundBuffer : public BaseObject
-{
-  public:
-    SoundBuffer(const char* fileName);
-    ~SoundBuffer();
-
-    /** @returns the ID of the buffer used in this SoundBuffer */
-    inline ALuint getID() const { return this->bufferID; }
-
-  private:
-    ALuint        bufferID;             //!< The address of the Buffer.
-
-    ALsizei       size;                 //!< The size of the Buffer.
-    ALboolean     loop;                 //!< loop information.
-};
-
-//! A class that represents a SoundSource
-class SoundSource : public BaseObject
-{
-  public:
-    SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
-    ~SoundSource();
-
-  // user interaction
-    void play();
-    void play(const SoundBuffer* buffer);
-    void stop();
-    void pause();
-    void rewind();
-
-  // development functions
-    /** @returns The ID of this Source */
-    inline ALuint getID() const { return this->sourceID; }
-    /** @returns the SoundBuffer of this Source */
-    inline const SoundBuffer* getBuffer() const { return this->buffer; }
-    /** @returns the SourceNode of this Source */
-    inline const PNode* getNode() const { return this->sourceNode;}
-
-    void setRolloffFactor(ALfloat rolloffFactor);
-
-  private:
-    ALuint                 sourceID;              //!< The ID of the Source
-    const SoundBuffer*     buffer;                //!< The buffer to play in this source.
-    const PNode*           sourceNode;            //!< The SourceNode represente the position/velocity... of this source.
-};
-
-
 
 //! A class that handles audio via the openAudioLibrary
Index: /trunk/src/lib/sound/sound_source.cc
===================================================================
--- /trunk/src/lib/sound/sound_source.cc	(revision 5386)
+++ /trunk/src/lib/sound/sound_source.cc	(revision 5386)
@@ -0,0 +1,115 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SOUND
+
+#include "sound_source.h"
+#include "sound_engine.h"
+#include "alincl.h"
+#include "compiler.h"
+
+using namespace std;
+
+/**
+ *  creates a SoundSource at position sourceNode with the SoundBuffer buffer
+ */
+SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
+{
+  this->setClassID(CL_SOUND_SOURCE, "SoundSource");
+
+  ALenum result;
+
+  // adding the Source to the SourcesList of the SoundEngine
+  SoundEngine::getInstance()->addSource(this);
+
+  this->buffer = buffer;
+  this->sourceNode = sourceNode;
+
+  alGenSources(1, &this->sourceID);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+  if (this->buffer != NULL)
+    alSourcei (this->sourceID, AL_BUFFER,   this->buffer->getID());
+  alSourcef (this->sourceID, AL_PITCH,    1.0      );
+  alSourcef (this->sourceID, AL_GAIN,     SoundEngine::getInstance()->getEffectsVolume() );
+  alSourcei (sourceID, AL_LOOPING,  AL_FALSE     );
+}
+
+/**
+ *  deletes a SoundSource
+ */
+SoundSource::~SoundSource()
+{
+  //SoundEngine::getInstance()->removeSource(this);
+  alDeleteSources(1, &this->sourceID);
+}
+
+/**
+ *  Plays back a SoundSource
+ */
+void SoundSource::play()
+{
+  alSourcePlay(this->sourceID);
+}
+
+/**
+ * Plays back buffer on this Source
+ * @param buffer the buffer to play back on this Source
+ */
+void SoundSource::play(const SoundBuffer* buffer)
+{
+  alSourceStop(this->sourceID);
+  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
+  alSourcePlay(this->sourceID);
+
+  if (unlikely(this->buffer != NULL))
+    alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
+}
+
+/**
+ *  Stops playback of a SoundSource
+ */
+void SoundSource::stop()
+{
+  alSourceStop(this->sourceID);
+}
+
+/**
+ *  Pauses Playback of a SoundSource
+ */
+void SoundSource::pause()
+{
+  alSourcePause(this->sourceID);
+}
+
+/**
+ *  Rewinds Playback of a SoundSource
+ */
+void SoundSource::rewind()
+{
+  alSourceRewind(this->sourceID);
+}
+
+/**
+ *  sets the RolloffFactor of the Sound emitted from the SoundSource
+ * @param rolloffFactor The Factor described
+
+   this tells openAL how fast the Sounds decay outward from the Source
+ */
+void SoundSource::setRolloffFactor(ALfloat rolloffFactor)
+{
+  alSourcef(this->sourceID, AL_ROLLOFF_FACTOR, rolloffFactor);
+}
+
Index: /trunk/src/lib/sound/sound_source.h
===================================================================
--- /trunk/src/lib/sound/sound_source.h	(revision 5386)
+++ /trunk/src/lib/sound/sound_source.h	(revision 5386)
@@ -0,0 +1,45 @@
+/*!
+ * @file sound_source.h
+ * @brief Definition of the SoundSource.
+*/
+
+#ifndef _SOUND_SOURCE_H
+#define _SOUND_SOURCE_H
+
+#include "base_object.h"
+#include "alincl.h"
+
+// FORWARD DECLARATION
+class SoundBuffer;
+class PNode;
+
+//! A class that represents a SoundSource
+class SoundSource : public BaseObject
+{
+  public:
+    SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
+    ~SoundSource();
+
+  // user interaction
+    void play();
+    void play(const SoundBuffer* buffer);
+    void stop();
+    void pause();
+    void rewind();
+
+  // development functions
+    /** @returns The ID of this Source */
+    inline ALuint getID() const { return this->sourceID; }
+    /** @returns the SoundBuffer of this Source */
+    inline const SoundBuffer* getBuffer() const { return this->buffer; }
+    /** @returns the SourceNode of this Source */
+    inline const PNode* getNode() const { return this->sourceNode;}
+
+    void setRolloffFactor(ALfloat rolloffFactor);
+
+  private:
+    ALuint                 sourceID;              //!< The ID of the Source
+    const SoundBuffer*     buffer;                //!< The buffer to play in this source.
+    const PNode*           sourceNode;            //!< The SourceNode represente the position/velocity... of this source.
+};
+#endif /* _SOUND_SOURCE_H */
