Index: /orxonox/branches/sound_engine/src/lib/sound/sound_engine.cc
===================================================================
--- /orxonox/branches/sound_engine/src/lib/sound/sound_engine.cc	(revision 3889)
+++ /orxonox/branches/sound_engine/src/lib/sound/sound_engine.cc	(revision 3890)
@@ -20,7 +20,91 @@
 #include "sound_engine.h"
 #include <SDL_mixer.h>
+#include "compiler.h"
 
 using namespace std;
 
+
+/*----------------
+  SOUND AND MUSIC
+  ---------------*/
+
+Sound::Sound(const char* fileName, SOUND_TYPE soundType)
+{
+  // checking if the sound-format is known
+  if (soundType == SOUND_NONE)
+    {
+      if (likely(!strncmp(fileName+(strlen(fileName)-4), ".wav", 4)) ||
+	  unlikely(!strncmp(fileName+(strlen(fileName)-4), ".voc", 4)) ||
+	  unlikely(!strncmp(fileName+(strlen(fileName)-5), ".aiff", 5)) ||
+	  unlikely(!strncmp(fileName+(strlen(fileName)-5), ".riff", 5)))
+	this->soundType = SOUND_WAV;
+      else if (likely(!strncmp(fileName+(strlen(fileName)-4), ".ogg", 4)))
+	this->soundType = SOUND_OGG;
+      else if (likely(!strncmp(fileName+(strlen(fileName)-4), ".mp3", 4)))
+	this->soundType = SOUND_MP3;
+      else if (unlikely(!strncmp(fileName+(strlen(fileName)-4), ".mod", 4)) ||
+	       unlikely(!strncmp(fileName+(strlen(fileName)-4), ".s3m", 4)) ||
+	       unlikely(!strncmp(fileName+(strlen(fileName)-3), ".it", 3)) ||
+	       unlikely(!strncmp(fileName+(strlen(fileName)-3), ".xm", 3)))
+	this->soundType = SOUND_MOD;
+      else if (likely(!strncmp(fileName+(strlen(fileName)-4), ".mid", 4)))
+	this->soundType = SOUND_MID;
+    }
+}
+
+Sound::~Sound()
+{
+
+}
+
+SoundEffect::SoundEffect(const char* fileName, SOUND_TYPE soundType) : Sound(fileName, soundType)
+{
+  // checking how to load
+  this->effect = NULL;
+  if (likely(SoundEngine::isInit))
+    {
+      if (this->soundType == SOUND_WAV ||
+	  this->soundType == SOUND_MOD ||
+	  this->soundType == SOUND_OGG)
+	this->effect = Mix_LoadWAV(fileName);
+      else
+	PRINTF(2)("%s cannot be loaded as SoundEffect. Wrong Type\n", fileName);
+    }
+  else
+    PRINTF(2)("SoundEngine not yet started. not loading SoundEffect %s\n", fileName);
+}
+
+SoundEffect::~SoundEffect(void)
+{
+  // deleting the effects-chunk
+  Mix_FreeChunk(this->effect);
+}
+
+Music::Music(const char* fileName, SOUND_TYPE soundType) : Sound(fileName, soundType)
+{
+  this->music = NULL;
+  if (likely(SoundEngine::isInit))
+    {
+      if (this->soundType == SOUND_WAV ||
+	  this->soundType == SOUND_MOD ||
+	  this->soundType == SOUND_OGG ||
+	  this->soundType == SOUND_MP3 ||
+	  this->soundType == SOUND_MID )
+	this->music = Mix_LoadMUS(fileName);
+      else
+	PRINTF(2)("%s cannot be loaded as Music. Wrong Type\n", fileName);
+    }
+  else
+    PRINTF(2)("SoundEngine not yet started. not loading Music %s\n", fileName);
+}
+
+Music::~Music()
+{
+  Mix_FreeMusic(this->music);
+}
+
+/*----------------------
+ STARTING AND UNLOADING
+  ----------------------*/
 /**
    \brief standard constructor
@@ -31,5 +115,4 @@
 
    // preInit
-   this->isInit = false;
    this->frequency = SOUND_DEFAULT_FREQUENCY;
    this->format = MIX_DEFAULT_FORMAT;
@@ -65,4 +148,8 @@
   this->disableSound();
 }
+
+bool SoundEngine::isInit = false;
+bool SoundEngine::enabled = false;
+
 
 
@@ -94,6 +181,4 @@
 	    PRINTF(1)("Mix_OpenAudio: %s\n", Mix_GetError());
 	}
-  
-
     }
 }
@@ -143,2 +228,16 @@
     }
 }
+
+
+/*-------------
+  FUNCTIONALITY
+  -------------*/
+
+/**
+   \param numberOfChannels sets the number of Channels to use.
+*/
+void SoundEngine::setNumberOfChannels(unsigned int numberOfChannels) 
+{
+  this->numberOfChannels = numberOfChannels;
+  Mix_AllocateChannels(numberOfChannels);
+}
Index: /orxonox/branches/sound_engine/src/lib/sound/sound_engine.h
===================================================================
--- /orxonox/branches/sound_engine/src/lib/sound/sound_engine.h	(revision 3889)
+++ /orxonox/branches/sound_engine/src/lib/sound/sound_engine.h	(revision 3890)
@@ -29,5 +29,38 @@
 #define SOUND_DEFAULT_BUFIZE 16384
 
+// an enumerator of the different Sound Types.
+typedef enum SOUND_TYPE {SOUND_NONE,
+			 SOUND_WAV, /* .wav */
+			 SOUND_MOD, /* .mod .s3m .it .xm */
+			 SOUND_MID, /* mid */
+			 SOUND_OGG,
+			 SOUND_MP3};
+
 // FORWARD DEFINITION
+
+class Sound {
+ public:
+  Sound(const char* fileName, SOUND_TYPE soundType);
+  virtual ~Sound(void);
+ protected:
+  SOUND_TYPE soundType;
+  int channel;
+};
+
+class SoundEffect : public Sound {
+ public:
+  SoundEffect(const char* fileName, SOUND_TYPE soundType = SOUND_NONE);
+  virtual ~SoundEffect(void);
+ private:
+  Mix_Chunk* effect;
+};
+
+class Music :public Sound {
+ public:
+  Music(const char* fileName, SOUND_TYPE soundType = SOUND_NONE);
+  virtual ~Music(void);
+ private:
+  Mix_Music* music;
+};
 
 //! The Main Sound Engine
@@ -38,10 +71,14 @@
   virtual ~SoundEngine(void);
 
+
+  void setNumberOfChannels(unsigned int numberOfChannels);
+
+
+  static bool isInit;
+  static bool enabled;
  private:
   SoundEngine(void);
   static SoundEngine* singletonRef;
 
-  
-  
   void enableSound(void);
   void disableSound(void);
@@ -51,4 +88,5 @@
   // settings
   int volume;
+  unsigned int numberOfChannels;
 
   // audio specifications
@@ -59,5 +97,6 @@
   int buffers;
 
-  bool isInit;
+
+
 };
 
