Index: /orxonox/branches/weaponSystem/src/lib/sound/sound_engine.cc
===================================================================
--- /orxonox/branches/weaponSystem/src/lib/sound/sound_engine.cc	(revision 4882)
+++ /orxonox/branches/weaponSystem/src/lib/sound/sound_engine.cc	(revision 4883)
@@ -91,5 +91,5 @@
  *  creates a SoundSource at position sourceNode with the SoundBuffer buffer
 */
-SoundSource::SoundSource(SoundBuffer* buffer, PNode* sourceNode)
+SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
 {
   this->setClassID(CL_SOUND_SOURCE, "SoundSource");
@@ -106,5 +106,6 @@
   if ((result = alGetError()) != AL_NO_ERROR)
     SoundEngine::PrintALErrorString(result);
-  alSourcei (this->sourceID, AL_BUFFER,   this->buffer->getID());
+  if (this->buffer != NULL)
+    alSourcei (this->sourceID, AL_BUFFER,   this->buffer->getID());
   alSourcef (this->sourceID, AL_PITCH,    1.0      );
   alSourcef (this->sourceID, AL_GAIN,     1.0      );
@@ -127,4 +128,15 @@
 {
   alSourcePlay(this->sourceID);
+}
+
+/**
+ * Plays back buffer on this Source
+ * @param buffer the buffer to play back on this Source
+ */
+void SoundSource::play(const SoundBuffer* buffer)
+{
+  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
+  alSourcePlay(this->sourceID);
+//  printf("playing sound\n");
 }
 
@@ -229,5 +241,5 @@
 SoundSource* SoundEngine::createSource(const char* fileName, PNode* sourceNode)
 {
-  return new SoundSource((SoundBuffer*)ResourceManager::getInstance()->load(fileName, WAV, RP_LEVEL), sourceNode);
+  return new SoundSource(sourceNode, (SoundBuffer*)ResourceManager::getInstance()->load(fileName, WAV, RP_LEVEL));
 }
 
Index: /orxonox/branches/weaponSystem/src/lib/sound/sound_engine.h
===================================================================
--- /orxonox/branches/weaponSystem/src/lib/sound/sound_engine.h	(revision 4882)
+++ /orxonox/branches/weaponSystem/src/lib/sound/sound_engine.h	(revision 4883)
@@ -27,5 +27,5 @@
 
   /** @returns the ID of the buffer used in this SoundBuffer */
-  inline ALuint getID() { return this->bufferID; }
+  inline ALuint getID() const { return this->bufferID; }
 
  private:
@@ -37,15 +37,13 @@
 
 //! A class that represents a SoundSource
-/**
- * @todo ability to play back different SoundBuffers on the same SounSource
- */
 class SoundSource : public BaseObject
 {
  public:
-  SoundSource(SoundBuffer* buffer, PNode* sourceNode = NULL);
+  SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
   ~SoundSource();
 
   // user interaction
   void play();
+  void play(const SoundBuffer* buffer);
   void stop();
   void pause();
@@ -56,14 +54,14 @@
   inline ALuint getID() const { return this->sourceID; }
   /** @returns the SoundBuffer of this Source */
-  inline SoundBuffer* getBuffer() const { return this->buffer; }
+  inline const SoundBuffer* getBuffer() const { return this->buffer; }
   /** @returns the SourceNode of this Source */
-  inline PNode* getNode() const { return this->sourceNode;}
+  inline const PNode* getNode() const { return this->sourceNode;}
 
   void setRolloffFactor(ALfloat rolloffFactor);
 
  private:
-  ALuint           sourceID;              //!< The ID of the Source
-  SoundBuffer*     buffer;                //!< The buffer to play in this source.
-  PNode*           sourceNode;            //!< The SourceNode represente the position/velocity... of this source.
+  ALuint                 sourceID;              //!< The ID of the Source
+  const SoundBuffer*     buffer;                //!< The buffer to play in this source.
+  const PNode*           sourceNode;            //!< The SourceNode represente the position/velocity... of this source.
 };
 
Index: /orxonox/branches/weaponSystem/src/util/animation/t_animation.h
===================================================================
--- /orxonox/branches/weaponSystem/src/util/animation/t_animation.h	(revision 4882)
+++ /orxonox/branches/weaponSystem/src/util/animation/t_animation.h	(revision 4883)
@@ -205,5 +205,5 @@
               this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
 
-              printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
+              //printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
               this->setAnimFunc(this->currentKeyFrame->animFunc);
             }
Index: /orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc
===================================================================
--- /orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc	(revision 4882)
+++ /orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc	(revision 4883)
@@ -96,11 +96,14 @@
   this->weaponSource->setRolloffFactor(.1);*/
   Projectile* p = new TestBullet(this);
-//  ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p);
+
+  //  ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p);
   //ObjectManager::getInstance()->debug();
 
-  this->setStateDuration(WS_SHOOTING, 2);
+  this->setStateDuration(WS_SHOOTING, .2);
 
   this->energy = 100;
   this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/shot1.wav");
 }
 
@@ -150,4 +153,7 @@
 {
   this->energyLoaded -= this->minCharge;
+  if (this->soundBuffers[WA_SHOOT] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_SHOOT]);
+
 
   Projectile* pj =  new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS));
Index: /orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc
===================================================================
--- /orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc	(revision 4882)
+++ /orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc	(revision 4883)
@@ -53,5 +53,5 @@
   for (int i = 0; i < WA_ACTION_COUNT; i++)
     if (this->soundBuffers[i])
-      delete this->soundBuffers[i];
+      ResourceManager::getInstance()->unload(this->soundBuffers[i]);
 }
 
@@ -73,5 +73,5 @@
 
   this->requestedAction = WA_NONE;
-  this->weaponSource = NULL;
+  this->soundSource = new SoundSource(this);
 
   this->active = true;
@@ -86,28 +86,31 @@
 }
 
-/**
- * sets a new projectile to the weapon
- * @param new projectile for this weapon
+
+void Weapon::setActionSound(WeaponAction action, const char* soundFile)
+{
+  if (action >= WA_ACTION_COUNT)
+    return;
+  else
+  {
+    this->soundBuffers[action] = (SoundBuffer*)ResourceManager::getInstance()->load(soundFile, WAV);
+    if (this->soundBuffers[action] != NULL)
+    {
+      PRINTF(4)("Loaded sound %s to action %s\n", soundFile, actionToChar(action));
+    }
+    else
+    {
+      PRINTF(4)("failed to load sound %s to %s\n", soundFile, actionToChar(action));
+    }
+
+  }
+}
+
+/**
+ * request an action that should be executed,
+ * @param action the next action to take
  *
- * weapon an projectile are independent, so you can combine them as you want
-*/
-void Weapon::setProjectile(Projectile* projectile)
-{
-  this->projectile = projectile;
-}
-
-
-/**
- * sets a new projectile to the weapon
- * @returns the current projectile of this weapon
- *
- * weapon an projectile are independent, so you can combine them as you want
-*/
-Projectile* Weapon::getProjectile()
-{
-  return this->projectile;
-}
-
-
+ * This function must be called instead of the actions (like fire/reload...)
+ * to make all the checks needed to have a usefull WeaponSystem.
+ */
 void Weapon::requestAction(WeaponAction action)
 {
@@ -187,4 +190,7 @@
 {
   PRINTF(4)("Activating the Weapon %s\n", this->getName());
+
+  if (this->soundBuffers[WA_ACTIVATE] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
 }
 
@@ -196,4 +202,7 @@
 {
   PRINTF(4)("Deactivating the Weapon %s\n", this->getName());
+
+  if (this->soundBuffers[WA_DEACTIVATE] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_DEACTIVATE]);
 }
 
@@ -201,4 +210,7 @@
 {
   this->energyLoaded -= this->minCharge;
+
+  if (this->soundBuffers[WA_SHOOT] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_SHOOT]);
 }
 
@@ -226,8 +238,14 @@
     this->energy -= chargeSize;
   }
+  if (this->soundBuffers[WA_RELOAD] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_RELOAD]);
+
 }
 
 void Weapon::charge()
 {
+  if (this->soundBuffers[WA_CHARGE] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_CHARGE]);
+
 }
 
Index: /orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h
===================================================================
--- /orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h	(revision 4882)
+++ /orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h	(revision 4883)
@@ -85,6 +85,8 @@
 
     // FUNCTIONS TO SET THE WEAPONS PROPERTIES.
-    void setProjectile(Projectile* projectile);
-    Projectile* getProjectile();
+    /** @param projectile a projectile for this weapon */
+    void setProjectile(Projectile* projectile) { this->projectile = projectile; };
+    /** @returns The projectile if availiable */
+    Projectile* getProjectile() { return this->projectile; };
 
     /** @param state the State to time @param duration the duration of the State */
@@ -98,6 +100,10 @@
     /** @returns the current State of the Weapon */
     inline WeaponState getCurrentState() const { return this->currentState; };
+    /** @param energyMax the maximum energy the Weapon can have @param energyLoadedMax the maximum energy in the weapon buffers */
+    inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
 
-    inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
+    void setActionSound(WeaponAction action, const char* soundFile);
+    /** @see void setActionSound(WeaponAction action, const char* soundFile); */
+    void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); };
 
     virtual void destroy();
@@ -129,5 +135,5 @@
 
   protected:
-    SoundSource*         weaponSource;
+    SoundSource*         soundSource;
     // it is all about energy
     float                energy;
@@ -145,6 +151,6 @@
     float                stateDuration;                    //!< how long the state has taken until now.
     float                times[WS_STATE_COUNT];            //!< Times to stay in the different States @see WeaponState.
+    Animation3D*         animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
     SoundBuffer*         soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction.
-    Animation3D*         animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
 
 
