Index: /orxonox/branches/sound/sound/sound_control.cc
===================================================================
--- /orxonox/branches/sound/sound/sound_control.cc	(revision 2978)
+++ /orxonox/branches/sound/sound/sound_control.cc	(revision 2979)
@@ -18,8 +18,6 @@
 using namespace std;
 
-// global variables
-SoundControl* SoundControl::instance = NULL; // singleton reference
+SoundControl* SoundControl::instance = NULL;
 int volume = SDL_MIX_MAXVOLUME;
-int done = 0;
 int track_number = 1;
 static Mix_Music* music = NULL;
@@ -192,54 +190,4 @@
 } 
 
-/** 
-    \brief Selects the track of all orxonox tracks 
-*/
-void SoundControl::trackSelect() { 
-  switch (track_number) { 
-  case 1:
-    music = Mix_LoadMUS("luke_grey_orxonox1.ogg"); 
-    if(Mix_PlayMusic(music, 1) == -1){
-      printf("Mix_PlayMusic: %s\n",Mix_GetError());
-    }
-    Mix_HookMusicFinished(musicDone);
-    break; 
-  case 2: 
-    music = Mix_LoadMUS("luke_grey_orxonox2.ogg");
-    if(Mix_PlayMusic(music, 1) == -1){
-      printf("Mix_PlayMusic: %s\n",Mix_GetError());
-    }
-    Mix_HookMusicFinished(musicDone);
-    break; 
-  case 3: 
-    music = Mix_LoadMUS("luke_grey_orxonox3.ogg"); 
-    if(Mix_PlayMusic(music, 1) == -1){
-      printf("Mix_PlayMusic: %s\n",Mix_GetError());
-    }
-    Mix_HookMusicFinished(musicDone);    
-    break; 
-  case 4: 
-    music = Mix_LoadMUS("luke_grey_and_aquarius_orxonox.ogg"); 
-    if(Mix_PlayMusic(music, 1) == -1){
-      printf("Mix_PlayMusic: %s\n",Mix_GetError());
-    }
-    Mix_HookMusicFinished(musicDone);    
-    break; 
-  case 5: 
-    music = Mix_LoadMUS("nomenes_orxonox.ogg"); 
-    if(Mix_PlayMusic(music, 1) == -1){
-      printf("Mix_PlayMusic: %s\n",Mix_GetError());
-    }
-    Mix_HookMusicFinished(musicDone);    
-    break; 
-  case 6:
-    music = Mix_LoadMUS("nomenes_funkadudu.ogg");
-    if(Mix_PlayMusic(music, 1) == -1){
-      printf("Mix_PlayMusic: %s\n",Mix_GetError());
-    }
-    Mix_HookMusicFinished(musicDone);
-    break;
-  } 
-}
-
 
 /** 
Index: /orxonox/branches/sound/sound/sound_control.h
===================================================================
--- /orxonox/branches/sound/sound/sound_control.h	(revision 2978)
+++ /orxonox/branches/sound/sound/sound_control.h	(revision 2979)
@@ -22,6 +22,10 @@
   void pauseMusic();
   void resumeMusic();
-  void trackSelect();
   static void musicDone();
+  int volume;
+  int track_number;
+  int audio_rate, audio_channels, audio_buffers;
+  int done;
+  Uint16 audio_format;
 
 protected:
Index: /orxonox/branches/sound/sound/sound_test.cc
===================================================================
--- /orxonox/branches/sound/sound/sound_test.cc	(revision 2978)
+++ /orxonox/branches/sound/sound/sound_test.cc	(revision 2979)
@@ -19,6 +19,7 @@
 
 SoundControl* sound = NULL;
-int counter = 0;
-int through = 0;
+int sfx_channel1 = -1;
+int sfx_channel2 = -1;
+int finished = 0;
 
 SoundTest::SoundTest() {
@@ -26,23 +27,67 @@
 }
 
-
 SoundTest::~SoundTest() {
   sound->deleteInstance();
 }
 
-
 int main(void) {
   SoundTest();
   SDL_Surface *screen;
+  SDL_Event event;
   SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); 
   screen = SDL_SetVideoMode(320, 240, 0, 0);
-  sound->playOgg("music.ogg");
-  while(!through) {
-    SDL_Delay(100);
-    if(counter >= 1000) {
-    	through = 1;
+  while(!finished) {
+    while(SDL_PollEvent(&event)) {
+      switch(event.type) {
+      case SDL_QUIT:
+	finished = 1;
+	break;
+      case SDL_KEYDOWN:
+      case SDL_KEYUP:
+	handleKey(event.key);
+	break;
+      }
     }
-    counter++;
+    SDL_Delay(50);
   }
   SDL_Quit();
 }
+
+void handleKey(SDL_KeyboardEvent key) {
+  switch(key.keysym.sym) {
+  case SDLK_a:
+    if(key.type == SDL_KEYDOWN) {
+      if(sfx_channel1 < 0) {
+	sfx_channel1 = sound->playWav("sound1.wav");
+      }
+    } else {
+      Mix_HaltChannel(sfx_channel1);
+      sfx_channel1 = -1;
+    }
+    break;
+  case SDLK_s:
+    if(key.type == SDL_KEYDOWN) {
+      if(sfx_channel2 < 0) {
+	sfx_channel2 = sound->playWav("sound2.wav");
+      }
+    } else {
+      Mix_HaltChannel(sfx_channel2);
+      sfx_channel2 = -1;
+    }
+    break;
+  case SDLK_m:
+    if(key.state == SDL_PRESSED) {
+      if(sound.music == NULL) { 
+	sound->playOgg("music.ogg");
+      } else {
+	Mix_HaltMusic();
+	Mix_FreeMusic(music);
+	music = NULL;
+      }
+    }
+    break;
+  case SDLK_q:
+    finished = 1;
+    break;
+  }
+}
Index: /orxonox/branches/sound/sound/sound_test.h
===================================================================
--- /orxonox/branches/sound/sound/sound_test.h	(revision 2978)
+++ /orxonox/branches/sound/sound/sound_test.h	(revision 2979)
@@ -12,7 +12,9 @@
   ~SoundTest();
   int main (void);
+  void handleKey(SDL_KeyboardEvent key);
   SoundControl* sound;
-  int counter;
-  int through;
+  int sfx_channel1;
+  int sfx_channel2;
+  int finished;
 };
 
