Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2009, 8:50:44 PM (14 years ago)
Author:
dafrick
Message:

Created capability in SoundManager to set an overall volume, and to also adjust general ambient and effects volumes.
For this to work, you need to delete your config-file (orxonox.ini) so that it can be reset.
It has still som quirks, though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/SoundManager.h

    r6183 r6184  
    3535#include <string>
    3636#include "util/Singleton.h"
     37#include "core/OrxonoxClass.h"
    3738
     39// tolua_begin
    3840namespace orxonox
    3941{
     
    4345     *
    4446     */
    45     class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public OrxonoxClass
    46     {
     47    class _OrxonoxExport SoundManager
     48    // tolua_end
     49        : public Singleton<SoundManager>, public OrxonoxClass
     50    { // tolua_export
    4751        friend class Singleton<SoundManager>;
    4852
     
    5357        void preUpdate(const Clock& time);
    5458        void setConfigValues();
     59       
     60        static SoundManager& getInstance() { return Singleton<SoundManager>::getInstance(); } // tolua_export
    5561
    5662        void setListenerPosition(const Vector3& position);
     
    6066        void unregisterAmbientSound(AmbientSound* oldAmbient);
    6167        void pauseAmbientSound(AmbientSound* ambient);
     68       
     69        void setAmbientVolume(float vol); // tolua_export
     70        void setEffectsVolume(float vol); // tolua_export
     71        void setVolume(float vol); // tolua_export
     72       
     73        float getAmbientVolume(void); // tolua_export
     74        float getEffectsVolume(void); // tolua_export
     75        float getVolume(void); // tolua_export
    6276
    6377    private:
     
    6781
    6882        void checkFadeStepValidity();
     83        void checkVolumeValidity();
     84        void checkAmbientVolumeValidity();
     85        void checkEffectsVolumeValidity();
     86       
     87        void updateAmbientVolume(void);
     88        void updateEffectsVolume(void);
     89        void updateVolume(void);
    6990
    7091        ALCdevice* device_;
     
    7899        std::list<AmbientSound*> fadeOutList_;
    79100       
     101        float ambientVolume_;
     102        float effectsVolume_;
     103        float volume_;
     104       
    80105        static SoundManager* singletonPtr_s;
    81     };
    82 }
     106    }; // tolua_export
     107} // tolua_export
    83108
    84109#endif /* _SoundManager_H__ */
Note: See TracChangeset for help on using the changeset viewer.