Index: /code/branches/presentation2/data/gui/scripts/NewAudioMenu.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/NewAudioMenu.lua	(revision 6185)
+++ /code/branches/presentation2/data/gui/scripts/NewAudioMenu.lua	(revision 6186)
@@ -23,10 +23,12 @@
 
 function P.AudioMuteMusicCheckbox_clicked(e)
-    -- mute music
+    soundMgr = orxonox.SoundManager:getInstance()
+    soundMgr:toggleMute(orxonox.SoundType.ambient)
     debug("event: mute music")
 end
 
 function P.AudioMuteSoundCheckbox_clicked(e)
-    -- mute sound
+    soundMgr = orxonox.SoundManager:getInstance()
+    soundMgr:toggleMute(orxonox.SoundType.none)
     debug("event: mute sound")
 end
Index: /code/branches/presentation2/src/orxonox/sound/AmbientSound.cc
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/AmbientSound.cc	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/AmbientSound.cc	(revision 6186)
@@ -101,4 +101,9 @@
         }
     }
+    
+    float AmbientSound::getVolumeGain()
+    {
+        return SoundManager::getInstance().getVolume(SoundType::ambient);
+    }
 
     void AmbientSound::doPause()
Index: /code/branches/presentation2/src/orxonox/sound/AmbientSound.h
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/AmbientSound.h	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/AmbientSound.h	(revision 6186)
@@ -58,4 +58,6 @@
         virtual void stop();
         virtual void pause();
+        
+        virtual float getVolumeGain();
 
         virtual void setAmbientSource(const std::string& source);
Index: /code/branches/presentation2/src/orxonox/sound/BaseSound.cc
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/BaseSound.cc	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/BaseSound.cc	(revision 6186)
@@ -38,4 +38,5 @@
 #include "core/Resource.h"
 #include "core/XMLPort.h"
+#include "SoundManager.h"
 
 namespace orxonox
@@ -54,4 +55,5 @@
             assert(this->audioSource_ != 0);
         }
+        
     }
 
@@ -108,25 +110,17 @@
         }
         this->volume_ = vol;
+        
+        this->updateVolume();
+    }
+    
+    float BaseSound::getVolumeGain()
+    {
+        return SoundManager::getInstance().getVolume(SoundType::none);
+    }
+    
+    void BaseSound::updateVolume(void)
+    {
         if (alIsSource(this->audioSource_))
-            alSourcef(this->audioSource_, AL_GAIN, this->getEffectiveVolume());
-    }
-    
-    void BaseSound::setVolumeGain(float gain)
-    {
-        COUT(1) << "blubb: " << gain << std::endl;
-        if (gain > 1 || gain < 0)
-        {
-            COUT(2) << "Sound warning: volume gain out of range, cropping value." << std::endl;
-            gain = gain > 1 ? 1 : gain;
-            gain = gain < 0 ? 0 : gain;
-        }
-        this->volumeGain_ = gain;
-        if (alIsSource(this->audioSource_))
-            alSourcef(this->audioSource_, AL_GAIN, this->getEffectiveVolume());
-    }
-    
-    float BaseSound::getEffectiveVolume(void)
-    {
-        return this->volume_*this->volumeGain_;
+            alSourcef(this->audioSource_, AL_GAIN, this->volume_*this->getVolumeGain());
     }
 
@@ -200,5 +194,5 @@
 
         alSource3f(this->audioSource_, AL_POSITION,  0, 0, 0);
-        alSourcef (this->audioSource_, AL_GAIN, this->getEffectiveVolume());
+        this->updateVolume();
         alSourcei (this->audioSource_, AL_LOOPING, (this->bLoop_ ? AL_TRUE : AL_FALSE));
         if (this->isPlaying() || this->isPaused())
Index: /code/branches/presentation2/src/orxonox/sound/BaseSound.h
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/BaseSound.h	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/BaseSound.h	(revision 6186)
@@ -65,9 +65,6 @@
         float getVolume() const { return this->volume_; }
         
-        void setVolumeGain(float gain);
-        inline float getVolumeGain()
-            { return this->volumeGain_; }
-            
-        float getEffectiveVolume(void);
+        virtual float getVolumeGain();
+        void updateVolume(void);
 
         bool getLooping() const   { return this->bLoop_; }
@@ -92,5 +89,4 @@
         std::string     source_;
         float           volume_;
-        float           volumeGain_;
         bool            bLoop_;
         State           state_;
Index: /code/branches/presentation2/src/orxonox/sound/SoundManager.cc
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/SoundManager.cc	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/SoundManager.cc	(revision 6186)
@@ -92,7 +92,11 @@
         desroyContextGuard.Dismiss();
         
-        this->volume_ = 1.0;
-        this->ambientVolume_ = 1.0;
-        this->effectsVolume_ = 1.0;
+        this->setVolumeInternal(1.0, SoundType::none);
+        this->setVolumeInternal(1.0, SoundType::ambient);
+        this->setVolumeInternal(1.0, SoundType::effects);
+        
+        this->mute_[SoundType::none] = false;
+        this->mute_[SoundType::ambient] = false;
+        this->mute_[SoundType::effects] = false;
 
         this->setConfigValues();
@@ -118,7 +122,7 @@
             .callback(this, &SoundManager::checkFadeStepValidity);
             
-        SetConfigValue(volume_, 1.0f)
+        SetConfigValue(soundVolume_, 1.0f)
             .description("Defines the overall volume.")
-            .callback(this, &SoundManager::checkVolumeValidity);
+            .callback(this, &SoundManager::checkSoundVolumeValidity);
             
         SetConfigValue(ambientVolume_, 1.0f)
@@ -142,15 +146,30 @@
     }
     
-    void SoundManager::checkVolumeValidity()
-    {
-        if(volume_ < 0.0 || volume_ > 1.0)
+    bool SoundManager::checkVolumeValidity(SoundType::Value type)
+    {
+        bool valid = true;
+        
+        if(this->getVolumeInternal(type) < 0.0 || this->getVolumeInternal(type) > 1.0)
         {
             COUT(2) << "Sound warning: Sound volume out of range, ignoring change." << std::endl;
-            ResetConfigValue(volume_);
-        }
-        
-        this->updateVolume();
-        COUT(3) << "SoundManager: Overall volume set to " << volume_ << std::endl;
-        return;
+            valid = false;
+        }
+        
+        this->updateVolume(type);
+        COUT(3) << "SoundManager: volume set to " << this->getVolumeInternal(type) << std::endl;
+        return valid;
+    }
+    
+    void SoundManager::checkSoundVolumeValidity()
+    {
+        if(this->soundVolume_ < 0.0 || this->soundVolume_ > 1.0)
+        {
+            COUT(2) << "Sound warning: Sound volume out of range, ignoring change." << std::endl;
+            ResetConfigValue(soundVolume_);
+        }
+        
+        this->updateVolume(SoundType::none);
+        COUT(3) << "SoundManager: volume set to " << this->soundVolume_ << std::endl;
+            
     }
     
@@ -159,11 +178,10 @@
         if(this->ambientVolume_ < 0.0 || this->ambientVolume_ > 1.0)
         {
-            COUT(2) << "Sound warning: Ambient volume out of range, ignoring change." << std::endl;
+            COUT(2) << "Sound warning: Sound volume out of range, ignoring change." << std::endl;
             ResetConfigValue(ambientVolume_);
         }
         
-        this->updateAmbientVolume();
-        COUT(3) << "SoundManager: Ambient volume set to " << this->ambientVolume_ << std::endl;
-        return;
+        this->updateVolume(SoundType::ambient);
+        COUT(3) << "SoundManager: volume set to " << this->ambientVolume_ << std::endl;
     }
     
@@ -172,12 +190,29 @@
         if(this->effectsVolume_ < 0.0 || this->effectsVolume_ > 1.0)
         {
-            COUT(2) << "Sound warning: effects volume out of range, ignoring change." << std::endl;
+            COUT(2) << "Sound warning: Sound volume out of range, ignoring change." << std::endl;
             ResetConfigValue(effectsVolume_);
         }
         
-        this->updateEffectsVolume();
-        COUT(3) << "SoundManager: Effects volume set to " << this->effectsVolume_ << std::endl;
-        return;
-    }
+        this->updateVolume(SoundType::effects);
+        COUT(3) << "SoundManager: volume set to " << this->effectsVolume_ << std::endl;
+    }
+    
+//     void SoundManager::checkSoundVolumeValidity()
+//     {
+//         if(!checkVolumeValidity(SoundType::none))
+//             ResetConfigValue(soundVolume_)
+//     }
+//     
+//     void SoundManager::checkAmbientVolumeValidity()
+//     {
+//         if(!checkVolumeValidity(SoundType::ambient))
+//             ResetConfigValue(ambientVolume_);
+//     }
+//     
+//     void SoundManager::checkEffectsVolumeValidity()
+//     {
+//         if(!checkVolumeValidity(SoundType::effects))
+//             ResetConfigValue(effectsVolume_);
+//     }
 
     void SoundManager::setListenerPosition(const Vector3& position)
@@ -276,7 +311,17 @@
     }
     
-    void SoundManager::setAmbientVolume(float vol)
-    {
-        if (vol > 1 || vol < 0)
+    
+    void SoundManager::setVolume(float vol, SoundType::Value type)
+    {
+        vol = this->checkVolumeRange(vol);
+        
+        this->setVolumeInternal(vol, type);
+        
+        this->updateVolume(type);
+    }
+    
+    float SoundManager::checkVolumeRange(float vol)
+    {
+        if(vol < 0.0 || vol > 1.0)
         {
             COUT(2) << "Sound warning: volume out of range, cropping value." << std::endl;
@@ -284,49 +329,93 @@
             vol = vol < 0 ? 0 : vol;
         }
-        this->ambientVolume_ = vol;
-        
-        this->updateAmbientVolume();
-    }
-    
-    void SoundManager::setEffectsVolume(float vol)
-    {
-        if (vol > 1 || vol < 0)
-        {
-            COUT(2) << "Sound warning: volume out of range, cropping value." << std::endl;
-            vol = vol > 1 ? 1 : vol;
-            vol = vol < 0 ? 0 : vol;
-        }
-        this->effectsVolume_ = vol;
-        
-        this->updateEffectsVolume();
-    }
-    
-    void SoundManager::setVolume(float vol)
-    {
-        if (vol > 1 || vol < 0)
-        {
-            COUT(2) << "Sound warning: volume out of range, cropping value." << std::endl;
-            vol = vol > 1 ? 1 : vol;
-            vol = vol < 0 ? 0 : vol;
-        }
-        this->volume_ = vol;
-        
-        this->updateVolume();
-    }
-    
-    float SoundManager::getAmbientVolume(void)
-    {
-        return this->ambientVolume_;
-    }
-    
-    float SoundManager::getEffectsVolume(void)
-    {
-        return this->effectsVolume_;
-    }
-    
-    float SoundManager::getVolume(void) 
-    {
-        return this->volume_;
-    }
+        
+        return vol;
+    }
+    
+    void SoundManager::updateVolume(SoundType::Value type)
+    {
+        switch(type)
+        {
+            case SoundType::none:
+                for (ObjectList<BaseSound>::iterator it = ObjectList<BaseSound>::begin(); it != ObjectList<BaseSound>::end(); ++it)
+                {
+                    (*it)->updateVolume();
+                }
+                break;
+            case SoundType::ambient:
+                for (ObjectList<AmbientSound>::iterator it = ObjectList<AmbientSound>::begin(); it != ObjectList<AmbientSound>::end(); ++it)
+                {
+                    (*it)->updateVolume();
+                }
+                break;
+            case SoundType::effects:
+                for (ObjectList<WorldSound>::iterator it = ObjectList<WorldSound>::begin(); it != ObjectList<WorldSound>::end(); ++it)
+                {
+                    (*it)->updateVolume();
+                }
+                break;
+            default:
+                COUT(2) << "Invalid SoundType in SoundManager::updateVolume() - Not updating!" << std::endl;
+        }
+    }
+    
+    void SoundManager::setVolumeInternal(float vol, SoundType::Value type)
+    {
+        switch(type)
+        {
+            case SoundType::none:
+                this->soundVolume_ = vol;
+                break;
+            case SoundType::ambient:
+                this->ambientVolume_ = vol;
+                break;
+            case SoundType::effects:
+                this->effectsVolume_ = vol;
+                break;
+            default:
+                COUT(2) << "Invalid SoundType in SoundManager::setVolumeInternal() - Not setting any volume!" << std::endl;
+        }
+    }
+    
+    float SoundManager::getVolumeInternal(SoundType::Value type)
+    {
+        switch(type)
+        {
+            case SoundType::none:
+                return this->soundVolume_;
+            case SoundType::ambient:
+                return this->ambientVolume_;
+            case SoundType::effects:
+                return this->effectsVolume_;
+            default:
+                COUT(2) << "Invalid SoundType in SoundManager::setVolumeInternal() - Returning 0.0!" << std::endl;
+                return 0.0;
+        }
+    }
+    
+    float SoundManager::getVolume(SoundType::Value type) 
+    {
+        if(this->mute_[SoundType::none] || this->mute_[type])
+            return 0.0;
+        
+        if(type == SoundType::none)
+            return this->getVolumeInternal(type);
+        
+        return this->getVolumeInternal(SoundType::none)*this->getVolumeInternal(type);
+    }
+    
+    void SoundManager::toggleMute(SoundType::Value type)
+    {
+        bool mute = !this->mute_[type];
+        this->mute_[type] = mute;
+        
+        this->updateVolume(type);
+    }
+    
+    bool SoundManager::getMute(SoundType::Value type)
+    {
+        return this->mute_[type];
+    }
+    
 
     void SoundManager::fadeIn(AmbientSound* sound)
@@ -416,39 +505,3 @@
     }
     
-    void SoundManager::updateAmbientVolume(void)
-    {
-        for(ObjectList<AmbientSound>::iterator it = ObjectList<AmbientSound>::begin(); it != ObjectList<AmbientSound>::end(); ++it)
-        {
-            (*it)->setVolumeGain(this->volume_*this->ambientVolume_);
-        }
-    }
-    
-    void SoundManager::updateEffectsVolume(void)
-    {
-        for (ObjectList<WorldSound>::iterator it = ObjectList<WorldSound>::begin(); it != ObjectList<WorldSound>::end(); ++it)
-        {
-            (*it)->setVolumeGain(this->volume_*this->effectsVolume_);
-        }
-    }
-    
-    void SoundManager::updateVolume(void)
-    {
-        for (ObjectList<BaseSound>::iterator it = ObjectList<BaseSound>::begin(); it != ObjectList<BaseSound>::end(); ++it)
-        {
-            AmbientSound* ambient = dynamic_cast<AmbientSound*>(*it);
-            WorldSound* world = dynamic_cast<WorldSound*>(*it);
-            if(ambient != NULL)
-            {
-                ambient->setVolumeGain(this->volume_*this->ambientVolume_);
-            }
-            else if(world != NULL)
-            {
-                world->setVolumeGain(this->volume_*this->effectsVolume_);
-            }
-            else
-            {
-                (*it)->setVolumeGain(this->volume_);
-            }
-        }
-    }
 }
Index: /code/branches/presentation2/src/orxonox/sound/SoundManager.h
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/SoundManager.h	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/SoundManager.h	(revision 6186)
@@ -34,4 +34,5 @@
 #include <list>
 #include <string>
+#include <map>
 #include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
@@ -40,4 +41,16 @@
 namespace orxonox
 {
+    
+    //! Enum for the sound type.
+    namespace SoundType
+    {
+        enum Value
+        {
+            none,
+            ambient,
+            effects
+        };
+    }
+    
     /**
      * The SoundManager class manages the OpenAL device, context and listener
@@ -67,11 +80,9 @@
         void pauseAmbientSound(AmbientSound* ambient);
         
-        void setAmbientVolume(float vol); // tolua_export
-        void setEffectsVolume(float vol); // tolua_export
-        void setVolume(float vol); // tolua_export
+        void setVolume(float vol, SoundType::Value type); // tolua_export
+        float getVolume(SoundType::Value type); // tolua_export
         
-        float getAmbientVolume(void); // tolua_export
-        float getEffectsVolume(void); // tolua_export
-        float getVolume(void); // tolua_export
+        void toggleMute(SoundType::Value type); // tolua_export
+        bool getMute(SoundType::Value type); // tolua_export
 
     private:
@@ -81,11 +92,15 @@
 
         void checkFadeStepValidity();
-        void checkVolumeValidity();
-        void checkAmbientVolumeValidity();
-        void checkEffectsVolumeValidity();
+        bool checkVolumeValidity(SoundType::Value type);
+        void checkSoundVolumeValidity(void);
+        void checkAmbientVolumeValidity(void);
+        void checkEffectsVolumeValidity(void);
         
-        void updateAmbientVolume(void);
-        void updateEffectsVolume(void);
-        void updateVolume(void);
+        float checkVolumeRange(float vol);
+        
+        void updateVolume(SoundType::Value type);
+        
+        void setVolumeInternal(float vol, SoundType::Value type);
+        float getVolumeInternal(SoundType::Value type);
 
         ALCdevice* device_;
@@ -99,7 +114,8 @@
         std::list<AmbientSound*> fadeOutList_;
         
+        float soundVolume_;
         float ambientVolume_;
         float effectsVolume_;
-        float volume_;
+        std::map<SoundType::Value, bool> mute_;
         
         static SoundManager* singletonPtr_s;
Index: /code/branches/presentation2/src/orxonox/sound/WorldSound.cc
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/WorldSound.cc	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/WorldSound.cc	(revision 6186)
@@ -35,4 +35,5 @@
 #include "core/EventIncludes.h"
 #include "core/XMLPort.h"
+#include "SoundManager.h"
 
 namespace orxonox
@@ -95,3 +96,8 @@
             this->stop();
     }
+    
+    float WorldSound::getVolumeGain()
+    {
+        return SoundManager::getInstance().getVolume(SoundType::effects);
+    }
 }
Index: /code/branches/presentation2/src/orxonox/sound/WorldSound.h
===================================================================
--- /code/branches/presentation2/src/orxonox/sound/WorldSound.h	(revision 6185)
+++ /code/branches/presentation2/src/orxonox/sound/WorldSound.h	(revision 6186)
@@ -51,4 +51,6 @@
         virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
         virtual void changedActivity();
+        
+        virtual float getVolumeGain();
 
         virtual void tick(float dt);
