Index: orxonox/branches/sound/src/sound_control.cc
===================================================================
--- orxonox/branches/sound/src/sound_control.cc	(revision 2815)
+++ orxonox/branches/sound/src/sound_control.cc	(revision 2838)
@@ -20,4 +20,11 @@
 using namespace std;
 
+// global variables
+
+SoundControl* SoundControl::instance = 0; // singleton reference
+int volume = SDL_MIX_MAXVOLUME; // volume
+int done = 0; // 
+int track_number = 1;
+Mix_Music* music = NULL; 
 
 /** 
@@ -32,6 +39,5 @@
   int audio_rate = MIX_DEFAULT_FREQUENCY, audio_channels = MIX_DEFAULT_CHANNELS, audio_buffers = 8192, bits = 0; 
   Uint16 audio_format = MIX_DEFAULT_FORMAT; 
-  Mix_Music* music = NULL; 
-  
+
   //initializing sound and calling Mix_OpenAudio 
   if(SDL_Init(SDL_INIT_AUDIO)<0){ 
@@ -53,5 +59,6 @@
 */ 
 SoundControl::~SoundControl () { 
-  instance = NULL;
+  delete instance;
+  instance = 0;
 }
 
@@ -59,9 +66,14 @@
    \brief Returns a reference to the singleton
 */
-SoundControl* SoundControl::getObject(){
-  static SoundControl instance;
-  return &instance;
-}
-
+SoundControl* SoundControl::getInstance() {
+  if (instance == 0) {
+    instance = new SoundControl;
+  }
+  return instance;
+}
+
+void SoundControl::deleteInstance() {
+  ~SoundControl();
+}
 
 /** 
@@ -74,9 +86,5 @@
   bits=audio_format&0xFF; 
   printf("Opened audio at %d Hz %d bit %s, %d bytes audio buffer\n", audio_rate, bits, audio_channels > 1 ? "stereo" : "mono", audio_buffers ); 
-  
-  int volume = SDL_MIX_MAXVOLUME;
   Mix_VolumeMusic(volume);
-  int track_number = 1;
-  int done = 0;
 } 
 
@@ -194,22 +202,46 @@
 void SoundControl::trackSelect () { 
   switch (track_number) { 
-  case 1: 
+  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"); 
+    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"); 
-    break; 
+    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");
-    break;
+  if(Mix_PlayMusic(music, 1) == -1){
+    printf("Mix_PlayMusic: %s\n",Mix_GetError());
+  }
+  Mix_HookMusicFinished(musicDone);    
+break;
   } 
 }
Index: orxonox/branches/sound/src/sound_control.h
===================================================================
--- orxonox/branches/sound/src/sound_control.h	(revision 2815)
+++ orxonox/branches/sound/src/sound_control.h	(revision 2838)
@@ -7,5 +7,6 @@
 
  public:
-  SoundControl* getObject();
+  static SoundControl* getInstance();
+  static void deleteInstance();
   void setNumberOfChannels(int number_of channels);
   int playMod(char* filename);
@@ -21,9 +22,12 @@
   void trackSelect();
 
+protected:
+  void initialise();
+  SoundControl();
+  ~SoundControl();
+
 private:
-  void initialise();
-  //SoundControl singleton object must be made via getObject()
-  SoundControl();
-  ~SoundControl()
+  static SoundControl* instance;
+
 }
 
Index: orxonox/branches/sound/src/sound_test.cc
===================================================================
--- orxonox/branches/sound/src/sound_test.cc	(revision 2815)
+++ orxonox/branches/sound/src/sound_test.cc	(revision 2838)
@@ -21,7 +21,8 @@
 using namespace std;
 
+SoundControl* test;
 
 SoundTest::SoundTest () {
-  
+  test = SoundControl::getInstance();
 }
 
@@ -41,3 +42,2 @@
   sound.~SoundControl();
 }
- 
Index: orxonox/branches/sound/src/sound_test.h
===================================================================
--- orxonox/branches/sound/src/sound_test.h	(revision 2815)
+++ orxonox/branches/sound/src/sound_test.h	(revision 2838)
@@ -11,5 +11,5 @@
   SoundTest ();
   ~SoundTest ();
-
+  void main (void);
 };
 
