- Timestamp:
- Dec 17, 2009, 11:10:39 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/sound/SoundManager.h
r6349 r6370 50 50 // forward declaration 51 51 class SoundBuffer; 52 52 53 53 //! Enum for the sound type. 54 54 namespace SoundType … … 56 56 enum Value 57 57 { 58 none,59 ambient,60 effects58 All = 0, 59 Music = 1, 60 Effects = 2 61 61 }; 62 62 } 63 64 /** 65 * The SoundManager class manages the OpenAL device, context and listener 66 * position. It is a singleton. 67 * 68 */ 63 64 //! The SoundManager class manages the OpenAL device, context and listener position. 69 65 class _OrxonoxExport SoundManager 70 66 // tolua_end … … 94 90 void pauseAmbientSound(AmbientSound* ambient); 95 91 92 // tolua_begin 96 93 void setVolume(float vol, SoundType::Value type); 97 float getVolume(SoundType::Value type); // tolua_export 94 float getVolume(SoundType::Value type); 95 float getRealVolume(SoundType::Value type); 98 96 99 void toggleMute(SoundType::Value type); // tolua_export 100 bool getMute(SoundType::Value type); // tolua_export 97 void toggleMute(SoundType::Value type); 98 bool getMute(SoundType::Value type); 99 // tolua_end 101 100 102 101 shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename); … … 114 113 115 114 void checkFadeStepValidity(); 116 bool checkVolumeValidity(SoundType::Value type);117 void checkSoundVolumeValidity(void);118 void checkAmbientVolumeValidity(void);119 void checkEffectsVolumeValidity(void);120 115 121 float checkVolumeRange(float vol); 122 116 void checkVolumeValidity(SoundType::Value type); 117 void checkSoundVolumeValidity() { this->checkVolumeValidity(SoundType::All); } 118 void checkAmbientVolumeValidity() { this->checkVolumeValidity(SoundType::Music); } 119 void checkEffectsVolumeValidity() { this->checkVolumeValidity(SoundType::Effects); } 123 120 void updateVolume(SoundType::Value type); 124 121 125 void setVolumeInternal(float vol, SoundType::Value type); 126 float getVolumeInternal(SoundType::Value type); 127 122 // OpenAL device/context related 128 123 std::vector<std::string> deviceNames_; 129 124 ALCdevice* device_; 130 125 ALCcontext* context_; 131 126 127 // Ambient sound related 132 128 typedef std::list<std::pair<AmbientSound*, bool> > AmbientList; 133 AmbientList ambientSounds_;134 135 float crossFadeStep_; //!< Absolute change per second (0.1 means 10% of the nominal volume) for cross fading129 AmbientList ambientSounds_; 130 //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading 131 float crossFadeStep_; 136 132 std::list<SmartPtr<AmbientSound> > fadeInList_; 137 133 std::list<SmartPtr<AmbientSound> > fadeOutList_; 138 134 139 float soundVolume_; 140 float ambientVolume_; 141 float effectsVolume_; 142 std::map<SoundType::Value, bool> mute_; 135 // Volume related 136 float volume_[3]; 137 float mute_[3]; 143 138 139 // Sound buffer related 144 140 static const unsigned int maxEffectsPoolSize_s = 40 * 1024 * 1024; 145 141 unsigned int effectsPoolSize_; … … 149 145 SoundBufferMap soundBuffers_; 150 146 147 // Sound source related 151 148 unsigned int maxSources_; 152 149 std::vector<ALuint> soundSources_;
Note: See TracChangeset
for help on using the changeset viewer.