Index: orxonox/branches/sound/src/Makefile
===================================================================
--- orxonox/branches/sound/src/Makefile	(revision 3178)
+++ orxonox/branches/sound/src/Makefile	(revision 3179)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.2 from Makefile.am.
 # src/Makefile.  Generated from Makefile.in by configure.
 
@@ -49,5 +49,5 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = $(DESTDIR)$(bindir)
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
@@ -90,11 +90,11 @@
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run aclocal-1.8
+ACLOCAL = aclocal-1.8
 AMDEP_FALSE = #
 AMDEP_TRUE = 
-AMTAR = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run tar
-AUTOCONF = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run automake-1.8
+AMTAR = tar
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.8
 AWK = gawk
 CC = gcc
@@ -113,5 +113,5 @@
 ECHO_T = 
 EGREP = grep -E
-EXEEXT = 
+EXEEXT = .exe
 INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_PROGRAM = ${INSTALL}
@@ -120,8 +120,8 @@
 LDFLAGS = 
 LIBOBJS = 
-LIBS = -lm  -lGL -lGLU -lSDL -lSDL_mixer -lpthread -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  
+LIBS = -lm  -lopengl32 -lGLU32 -lmingw32 -lsdlmain -lsdl -lSDL_mixer -Lc:/Prog/Utils/MinGW/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv  
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run makeinfo
-MSBITFIELDS = 
+MAKEINFO = makeinfo
+MSBITFIELDS = -mms-bitfields
 OBJEXT = o
 PACKAGE = orxonox
@@ -137,5 +137,5 @@
 VERSION = 0.1-pre-alpha
 ac_ct_CC = gcc
-ac_ct_CXX = 
+ac_ct_CXX = g++
 ac_ct_STRIP = 
 am__fastdepCC_FALSE = #
@@ -153,5 +153,5 @@
 includedir = ${prefix}/include
 infodir = ${prefix}/info
-install_sh = /home/bensch/svn/orxonox/branches/sound/install-sh
+install_sh = /c/Documents and Settings/bensch/Desktop/svn/orxonox/branches/sound/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
@@ -206,5 +206,5 @@
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	$(mkdir_p) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -212,6 +212,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
 	  else :; fi; \
 	done
@@ -221,6 +221,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+	  rm -f $(DESTDIR)$(bindir)/$$f; \
 	done
 
@@ -296,9 +296,7 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -355,7 +353,5 @@
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
-	done
+	$(mkdir_p) $(DESTDIR)$(bindir)
 install: install-am
 install-exec: install-exec-am
Index: orxonox/branches/sound/src/Makefile.in
===================================================================
--- orxonox/branches/sound/src/Makefile.in	(revision 3178)
+++ orxonox/branches/sound/src/Makefile.in	(revision 3179)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.2 from Makefile.am.
 # @configure_input@
 
@@ -49,5 +49,5 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = $(DESTDIR)$(bindir)
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
@@ -206,5 +206,5 @@
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	$(mkdir_p) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -212,6 +212,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
 	  else :; fi; \
 	done
@@ -221,6 +221,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+	  rm -f $(DESTDIR)$(bindir)/$$f; \
 	done
 
@@ -296,9 +296,7 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -355,7 +353,5 @@
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
-	done
+	$(mkdir_p) $(DESTDIR)$(bindir)
 install: install-am
 install-exec: install-exec-am
Index: orxonox/branches/sound/src/sound_control.cc
===================================================================
--- orxonox/branches/sound/src/sound_control.cc	(revision 3179)
+++ orxonox/branches/sound/src/sound_control.cc	(revision 3179)
@@ -0,0 +1,262 @@
+/* 
+   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: Simon Hofmann 
+   co-programmer:
+*/
+
+#include "sound_control.h"
+
+using namespace std;
+
+int sfx_channel1 = -1;
+int sfx_channel2 = -1;
+int finished = 0;
+SoundControl* SoundControl::sound = SoundControl::getInstance();
+SoundControl* SoundControl::instance = 0;
+int volume = SDL_MIX_MAXVOLUME;
+int track_number = 1;
+Mix_Music* music = NULL;
+int audio_rate = 44100, audio_channels = MIX_DEFAULT_CHANNELS, 
+audio_buffers = 16384, bits = 0; 
+Uint16 audio_format = MIX_DEFAULT_FORMAT;
+SDL_Event event;
+
+
+/** 
+    \brief standard constructor 
+    This constructor builds a SoundControl Object and initialises it .
+    All sound output is handled by this singleton object.
+*/ 
+SoundControl::SoundControl() { 
+  if(SDL_Init(SDL_INIT_AUDIO)<0) {
+    printf("SDL_Init: INIT_AUDIO error.\n"); 
+  } 
+  if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) { 
+    printf("Mix_OpenAudio: Failed to open audio!\n"); 
+  } 
+  initialise();
+}
+
+/** 
+    \brief Default destructor 
+*/ 
+SoundControl::~SoundControl() {
+}
+
+/**
+   \brief Returns a reference to the SoundControl singleton
+*/
+SoundControl* SoundControl::getInstance() {
+  if (instance == 0) {
+    instance = new SoundControl;
+  }
+  return instance;
+}
+
+void SoundControl::deleteInstance() {
+}
+
+/** 
+    \brief Is called by SoundControl object to initiate all values and to output some text
+*/ 
+void SoundControl::initialise() { 
+  Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); 
+  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 ); 
+  Mix_VolumeMusic(volume);
+} 
+
+/** 
+    \brief Sets the number of output Channels
+*/ 
+void SoundControl::setNumberOfChannels(int number_of_channels) { 
+  Mix_AllocateChannels(number_of_channels);
+} 
+
+/** 
+    \brief Static function to play a .xm file 
+    \param filename: self-explanatory 
+*/ 
+void SoundControl::playMod(char* fileName) {
+  Mix_Chunk* chunk = NULL; 
+  chunk = Mix_LoadWAV(fileName); 
+  if(Mix_PlayChannel(-1, chunk, 0) == -1) {
+    printf("Mix_PlayChannel: %s\n", Mix_GetError());
+  }
+}
+
+/** 
+    \brief Static function to play a .wav file 
+    \param filename: self-explanatory 
+*/ 
+void SoundControl::playWav(char* fileName) {
+  Mix_Chunk* chunk = NULL; 
+  chunk = Mix_LoadWAV(fileName); 
+  if(Mix_PlayChannel(-1, chunk, 0) == -1) {
+    printf("Mix_PlayChannel: %s\n", Mix_GetError());
+  }
+} 
+
+/** 
+    \brief Static function to play an .ogg file 
+    \param filename: self-explanatory 
+*/ 
+void SoundControl::playOgg(char* fileName) {
+  Mix_Music* music = NULL;
+  music = Mix_LoadMUS(fileName);
+  if(Mix_PlayMusic(music, 1) == -1) {
+    printf("Mix_PlayMusic: %s\n",Mix_GetError());
+  }
+  Mix_HookMusicFinished(musicDone);
+} 
+
+/** 
+    \brief Heightens the overall volume of output 
+*/ 
+void SoundControl::volumeUp() { 
+  volume = (volume + 1) << 1; 
+  if(volume > SDL_MIX_MAXVOLUME) 
+    volume = SDL_MIX_MAXVOLUME; 
+  Mix_VolumeMusic(volume); 
+} 
+
+
+/** 
+    \brief Lowers the overall volume of output 
+*/  
+void SoundControl::volumeDown() { 
+  volume >>= 1; 
+  Mix_VolumeMusic(volume); 
+} 
+
+/** 
+    \brief Rewinds music to the beginning 
+*/  
+void SoundControl::trackRewind() { 
+  Mix_RewindMusic(); 
+} 
+
+/** 
+    \brief Rewinds the music 5 seconds 
+*/  
+void SoundControl::forwardMusic() { 
+  Mix_SetMusicPosition(+5); 
+} 
+
+/** 
+    \brief Forwards the music 5 seconds 
+*/  
+void SoundControl::rewindMusic () { 
+  Mix_SetMusicPosition(-5); 
+} 
+
+/** 
+    \brief Pauses music output 
+*/ 
+void SoundControl::pauseMusic() {
+  Mix_PauseMusic();
+} 
+
+/** 
+    \brief Pauses music output 
+*/ 
+void SoundControl::resumeMusic() {
+  Mix_ResumeMusic();
+} 
+
+/** 
+    \brief Fades in music
+*/ 
+void fadeInMusic(int time) {
+
+}
+
+/** 
+    \brief Fades out music
+*/ 
+void SoundControl::fadeOutMusic(int time) {
+
+}
+
+/** 
+    \brief Hooked by playOgg at end of .ogg playback
+*/ 
+void SoundControl::musicDone() {
+  Mix_HaltMusic();
+  Mix_FreeMusic(music);
+  music = NULL;
+} 
+
+/** 
+    \brief Handles input events
+*/ 
+void SoundControl::handleKey(SDL_KeyboardEvent key) {
+  switch(key.keysym.sym) {
+  case SDLK_a:
+    if(key.type == SDL_KEYDOWN) {
+      if(sfx_channel1 < 0) {
+	sfx_channel1 = 1;
+	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 = 1;
+	sound->playWav("sound2.wav");
+      }
+    } else {
+      Mix_HaltChannel(sfx_channel2);
+      sfx_channel2 = -1;
+    }
+    break;
+  case SDLK_m:
+    if(key.state == SDL_PRESSED) {
+      sound->playOgg("music.ogg");
+    }
+    break;
+  case SDLK_q:
+    finished = 1;
+    break;
+  default:
+    break;
+  }
+}
+
+int SoundControl::main(int argc, char* argv[]) {
+  SDL_Surface* screen;
+  SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); 
+  screen = SDL_SetVideoMode(320, 240, 0, 0);
+  while(!finished) {
+    while(SDL_PollEvent(&event)) {
+      switch(event.type) {
+      case SDL_QUIT:
+	finished = 1;
+	break;
+      case SDL_KEYDOWN:
+      case SDL_KEYUP:
+	SoundControl::handleKey(event.key);
+	break;
+      default:
+	break;
+      }
+    }
+    SDL_Delay(50);
+  }
+  deleteInstance();
+  SDL_Quit();
+  return 0;
+}
Index: orxonox/branches/sound/src/sound_control.h
===================================================================
--- orxonox/branches/sound/src/sound_control.h	(revision 3179)
+++ orxonox/branches/sound/src/sound_control.h	(revision 3179)
@@ -0,0 +1,50 @@
+#ifndef SOUNDCONTROL_CLASS_H
+#define SOUNDCONTROL_CLASS_H
+
+#include "SDL/SDL.h"
+#include "SDL/SDL_mixer.h"
+#include <stdio.h>
+
+class SoundControl {
+ public:
+  static SoundControl* getInstance();
+  static void deleteInstance();
+  
+  void setNumberOfChannels(int number_of_channels);
+  static void playMod(char* filename);
+  static void playWav(char* filename);
+  static void playOgg(char* filename);
+  void volumeUp();
+  void volumeDown();
+  void trackRewind();
+  void forwardMusic();
+  void rewindMusic();
+  void pauseMusic();
+  void resumeMusic();
+  void fadeInMusic(int time);
+  void fadeOutMusic(int time);
+  static void musicDone();
+  
+  void handleKey(SDL_KeyboardEvent key); 
+  int main(int argc, char* argv[]);
+  
+  static SoundControl* sound;
+  int volume;
+  int track_number;
+  int audio_rate, audio_channels, audio_buffers;
+  int done;
+  Uint16 audio_format;
+  int sfx_channel1;
+  int sfx_channel2;
+  int finished;
+
+ protected:
+  SoundControl();
+  ~SoundControl();
+  void initialise();
+
+ private:
+  static SoundControl* instance;
+};
+
+#endif
Index: orxonox/branches/sound/src/sound_test.cc
===================================================================
--- orxonox/branches/sound/src/sound_test.cc	(revision 3179)
+++ orxonox/branches/sound/src/sound_test.cc	(revision 3179)
@@ -0,0 +1,48 @@
+/* 
+   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: Simon Hofmann
+   co-programmer:
+*/
+
+#include "sound_test.h"
+
+using namespace std;
+
+SoundControl* sound = NULL;
+int counter = 0;
+int through = 0;
+
+SoundTest::SoundTest() {
+  sound = SoundControl::getInstance();
+}
+
+
+SoundTest::~SoundTest() {
+  sound->deleteInstance();
+}
+
+
+int main(int argc, char *argv[]) {
+  SoundTest();
+  SDL_Surface *screen;
+  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;
+    }
+    counter++;
+  }
+  SDL_Quit();
+}
Index: orxonox/branches/sound/src/sound_test.h
===================================================================
--- orxonox/branches/sound/src/sound_test.h	(revision 3179)
+++ orxonox/branches/sound/src/sound_test.h	(revision 3179)
@@ -0,0 +1,19 @@
+#ifndef SOUND_TEST_H
+#define SOUND_TEST_H
+
+#include "sound_control.h"
+#include "SDL/SDL.h"
+#include "SDL/SDL_mixer.h"
+
+class SoundTest {
+
+ public:
+  SoundTest();
+  ~SoundTest();
+  int main (void);
+  SoundControl* sound;
+  int counter;
+  int through;
+};
+
+#endif
