Index: /orxonox/trunk/src/defs/class_id.h
===================================================================
--- /orxonox/trunk/src/defs/class_id.h	(revision 4960)
+++ /orxonox/trunk/src/defs/class_id.h	(revision 4961)
@@ -172,4 +172,5 @@
   CL_SOUND_BUFFER               =    0x00000a01,
   CL_SOUND_SOURCE               =    0x00000a02,
+  CL_SOUND_OGG_PLAYER           =    0x00000a11,
 
 
Index: /orxonox/trunk/src/lib/sound/ogg_player.cc
===================================================================
--- /orxonox/trunk/src/lib/sound/ogg_player.cc	(revision 4960)
+++ /orxonox/trunk/src/lib/sound/ogg_player.cc	(revision 4961)
@@ -23,9 +23,28 @@
 #include "debug.h"
 
-void OggStream::open(string path)
+
+/**
+ * initializes an Ogg-player from a file
+ * @param fileName the file to load
+ */
+OggPlayer::OggPlayer(const char* fileName)
+{
+  this->setClassID(CL_SOUND_OGG_PLAYER, "OggPlayer");
+  if (fileName != NULL)
+  {
+    this->open(fileName);
+    this->setName(fileName);
+  }
+}
+
+/**
+ * opens a file for playback
+ * @param fileName the file to open
+ */
+void OggPlayer::open(const char* fileName)
 {
     int result;
 
-    if(!(oggFile = fopen(path.c_str(), "rb")))
+    if(!(oggFile = fopen(fileName, "rb")))
         PRINTF(2)("Could not open Ogg file.");
 
@@ -58,8 +77,8 @@
 }
 
-
-
-
-void OggStream::release()
+/**
+ * releases a stream
+ */
+void OggPlayer::release()
 {
     alSourceStop(source);
@@ -73,8 +92,8 @@
 }
 
-
-
-
-void OggStream::display()
+/**
+ * displays some info about the ogg-file
+ */
+void OggPlayer::display()
 {
     cout
@@ -96,7 +115,9 @@
 
 
-
-
-bool OggStream::playback()
+/**
+ * plays back the sound
+ * @return true if running, false otherwise
+ */
+bool OggPlayer::playback()
 {
     if(playing())
@@ -115,8 +136,9 @@
 }
 
-
-
-
-bool OggStream::playing()
+/**
+ *
+ * @returns true if the file is playing
+ */
+bool OggPlayer::playing()
 {
     ALenum state;
@@ -127,8 +149,9 @@
 }
 
-
-
-
-bool OggStream::update()
+/**
+ * updates the stream, this has to be done every few parts of a second, for sound-consistency
+ * @returns true, if the Sound is playing flawlessly
+ */
+bool OggPlayer::update()
 {
     int processed;
@@ -153,8 +176,10 @@
 }
 
-
-
-
-bool OggStream::stream(ALuint buffer)
+/**
+ * gets a new Stream from buffer
+ * @param buffer the buffer to get the stream from
+ * @return true, if everything worked as planed
+ */
+bool OggPlayer::stream(ALuint buffer)
 {
     char pcm[BUFFER_SIZE];
@@ -186,7 +211,8 @@
 
 
-
-
-void OggStream::empty()
+/**
+ * empties the buffers
+ */
+void OggPlayer::empty()
 {
     int queued;
@@ -203,8 +229,8 @@
 }
 
-
-
-
-void OggStream::check()
+/**
+ * checks for errors
+ */
+void OggPlayer::check()
 {
         int error = alGetError();
@@ -214,7 +240,10 @@
 }
 
-
-
-const char* OggStream::errorString(int code)
+/**
+ * returns errors
+ * @param code the error-code
+ * @return the error as a String
+ */
+const char* OggPlayer::errorString(int code)
 {
      switch(code)
Index: /orxonox/trunk/src/lib/sound/ogg_player.h
===================================================================
--- /orxonox/trunk/src/lib/sound/ogg_player.h	(revision 4960)
+++ /orxonox/trunk/src/lib/sound/ogg_player.h	(revision 4961)
@@ -1,5 +1,5 @@
 /*!
  * @file ogg_player.h
- *  Ogg-Player definition
+ * Ogg-Player definition
  */
 
@@ -8,7 +8,8 @@
 #define _OGG_PLAYER_H
 
-#include <string>
 #include <iostream>
 using namespace std;
+
+#include "base_object.h"
 
 #include <AL/al.h>
@@ -21,34 +22,35 @@
 
 
+// the definition of a Ogg-Player
+class OggPlayer : public BaseObject
+  {
+  public:
+    OggPlayer(const char* fileName = NULL);
 
-class OggStream
-{
-    public:
+    void open(const char* fileName);
+    void release();
+    void display();
+    bool playback();
+    bool playing();
+    bool update();
 
-        void open(string path);
-        void release();
-        void display();
-        bool playback();
-        bool playing();
-        bool update();
+  protected:
 
-    protected:
+    bool stream(ALuint buffer);
+    void empty();
+    void check();
+    const char* errorString(int code);
 
-        bool stream(ALuint buffer);
-        void empty();
-        void check();
-        const char* errorString(int code);
+  private:
 
-    private:
+    FILE*               oggFile;              //!< general file-handler, to open the sound-file
+    OggVorbis_File      oggStream;            //!< The stream this Ogg-player is playing back
+    vorbis_info*        vorbisInfo;           //!< The information held in the opened ogg-file
+    vorbis_comment*     vorbisComment;        //!< Comments about the ogg-file
 
-        FILE*             oggFile;
-        OggVorbis_File    oggStream;
-        vorbis_info*      vorbisInfo;
-        vorbis_comment*   vorbisComment;
-
-        ALuint            buffers[2];
-        ALuint            source;
-        ALenum            format;
-};
+    ALuint              buffers[2];           //!< buffers that handle sequentially buffering of the audio
+    ALuint              source;               //!< The source we play back on
+    ALenum              format;               //!< The format we play back
+  };
 
 
Index: /orxonox/trunk/src/lib/sound/sound_engine.cc
===================================================================
--- /orxonox/trunk/src/lib/sound/sound_engine.cc	(revision 4960)
+++ /orxonox/trunk/src/lib/sound/sound_engine.cc	(revision 4961)
@@ -250,13 +250,4 @@
 {
   return new SoundSource(sourceNode, (SoundBuffer*)ResourceManager::getInstance()->load(fileName, WAV, RP_LEVEL));
-}
-
-
-/**
- *  sets The listener (normaly the Camera)
-*/
-void SoundEngine::setListener(PNode* listener)
-{
-  this->listener = listener;
 }
 
Index: /orxonox/trunk/src/lib/sound/sound_engine.h
===================================================================
--- /orxonox/trunk/src/lib/sound/sound_engine.h	(revision 4960)
+++ /orxonox/trunk/src/lib/sound/sound_engine.h	(revision 4961)
@@ -77,15 +77,16 @@
     SoundSource* createSource(const char* fileName, PNode* sourceNode = NULL);
 
-    void setListener(PNode* listener);
+    /** @param listener the listener in the scene */
+    void setListener(PNode* listener) { this->listener = listener; };
     void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity);
 
 
+    void update();
+
+  // administrative
     void addBuffer(SoundBuffer* buffer);
     void removeBuffer(SoundBuffer* buffer);
     void addSource(SoundSource* source);
 
-    void update();
-
-  // administrative
     void flushUnusedBuffers();
     void flushAllBuffers();
Index: /orxonox/trunk/src/story_entities/world.cc
===================================================================
--- /orxonox/trunk/src/story_entities/world.cc	(revision 4960)
+++ /orxonox/trunk/src/story_entities/world.cc	(revision 4961)
@@ -66,4 +66,5 @@
 
 #include "sound_engine.h"
+#include "ogg_player.h"
 
 #include "class_list.h"
@@ -206,4 +207,7 @@
 
   LoadClassDescription::printAll();
+
+
+  ResourceManager::getInstance()->unload(this->music);
   ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
 }
@@ -226,4 +230,6 @@
   //strcpy(this->worldName, name);
   this->debugWorldNr = worldID;
+
+  this->music = NULL;
 }
 
@@ -517,4 +523,7 @@
 
   ClassList::debug();
+
+  this->music = (OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);
+  music->playback();
 }
 
@@ -954,4 +963,5 @@
 
   SoundEngine::getInstance()->update();
+  music->update();
 }
 
Index: /orxonox/trunk/src/story_entities/world.h
===================================================================
--- /orxonox/trunk/src/story_entities/world.h	(revision 4960)
+++ /orxonox/trunk/src/story_entities/world.h	(revision 4961)
@@ -24,4 +24,5 @@
 class PilotNode;
 
+class OggPlayer;
 //! The game world Interface
 /**
@@ -112,4 +113,5 @@
 
 
+  OggPlayer* music;
   // IMPORTANT WORLD-ENTITIES
   PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
Index: /orxonox/trunk/src/util/resource_manager.cc
===================================================================
--- /orxonox/trunk/src/util/resource_manager.cc	(revision 4960)
+++ /orxonox/trunk/src/util/resource_manager.cc	(revision 4961)
@@ -34,4 +34,5 @@
 #ifndef NO_AUDIO
 #include "sound_engine.h"
+#include "ogg_player.h"
 #endif /* NO_AUDIO */
 
@@ -228,5 +229,5 @@
 
 /**
- *  loads resources
+ * loads resources
  * @param fileName: The fileName of the resource to load
  * @param type: The Type of Resource to load (\see ResourceType)
@@ -346,4 +347,8 @@
           if(isFile(fullName))
             tmpResource->pointer = new SoundBuffer(fullName);
+          break;
+        case OGG:
+          if (isFile(fullName))
+            tmpResource->pointer = new OggPlayer(fullName);
           break;
 #endif /* NO_AUDIO */
@@ -400,5 +405,5 @@
 
 /**
- *  unloads a Resource
+ * unloads a Resource
  * @param pointer: The pointer to free
  * @param prio: the PriorityLevel to unload this resource
@@ -419,5 +424,5 @@
 
 /**
- *  unloads a Resource
+ * unloads a Resource
  * @param resource: The resource to unloade
  * @param prio the PriorityLevel to unload this resource
@@ -446,4 +451,7 @@
             case WAV:
               delete (SoundBuffer*)resource->pointer;
+              break;
+            case OGG:
+              delete (OggPlayer*)resource->pointer;
               break;
 #endif /* NO_AUDIO */
@@ -500,5 +508,5 @@
 
 /**
- *  Searches for a Resource by some information
+ * Searches for a Resource by some information
  * @param fileName: The name to look for
  * @param type the Type of resource to locate.
@@ -587,5 +595,5 @@
 
 /**
- *  Searches for a Resource by Pointer
+ * Searches for a Resource by Pointer
  * @param pointer the Pointer to search for
  * @returns a Pointer to the Resource if found, NULL otherwise.
@@ -610,5 +618,5 @@
 
 /**
- *  Checks if it is a Directory
+ * Checks if it is a Directory
  * @param directoryName the Directory to check for
  * @returns true if it is a directory/symlink false otherwise
@@ -657,5 +665,5 @@
 
 /**
- *  Checks if the file is either a Regular file or a Symlink
+ * Checks if the file is either a Regular file or a Symlink
  * @param fileName the File to check for
  * @returns true if it is a regular file/symlink, false otherwise
@@ -693,5 +701,5 @@
 
 /**
- *  touches a File on the disk (thereby creating it)
+ * touches a File on the disk (thereby creating it)
  * @param fileName The file to touch
 */
@@ -713,5 +721,5 @@
 
 /**
- *  deletes a File from disk
+ * deletes a File from disk
  * @param fileName the File to delete
 */
@@ -726,8 +734,8 @@
 
 /**
-  * @param name the Name of the file to check
-  * @returns The name of the file, including the HomeDir
-    IMPORTANT: this has to be deleted from the outside
-*/
+ * @param name the Name of the file to check
+ * @returns The name of the file, including the HomeDir
+ * IMPORTANT: this has to be deleted from the outside
+ */
 char* ResourceManager::homeDirCheck(const char* name)
 {
@@ -755,7 +763,7 @@
 
 /**
-  * @param fileName the Name of the File to check
-  * @returns The full name of the file, including the DataDir, and NULL if the file does not exist
-    IMPORTANT: this has to be deleted from the outside
+ * @param fileName the Name of the File to check
+ * @returns The full name of the file, including the DataDir, and NULL if the file does not exist
+ *  IMPORTANT: this has to be deleted from the outside
 */
 char* ResourceManager::getFullName(const char* fileName)
@@ -778,5 +786,5 @@
 
 /**
- *  outputs debug information about the ResourceManager
+ * outputs debug information about the ResourceManager
 */
 void ResourceManager::debug() const
@@ -824,4 +832,8 @@
         case WAV:
           PRINT(0)("SoundFile\n");
+          break;
+        case OGG:
+          PRINT(0)("MusicFile\n");
+          break;
 #endif
         default:
