From 0489ad7c62424343e6e8b2f397d8ca14a370105e Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 14 May 2004 15:47:01 +0000 Subject: [PATCH] Add a function to globally set volume (aka AL_GAIN) --- simgear/sound/soundmgr_openal.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/simgear/sound/soundmgr_openal.hxx b/simgear/sound/soundmgr_openal.hxx index 3f7c4cbd..c85612d4 100644 --- a/simgear/sound/soundmgr_openal.hxx +++ b/simgear/sound/soundmgr_openal.hxx @@ -174,6 +174,16 @@ public: */ bool stop( const string& refname ); + /** + * set overall volume for the application. + * @param vol 1.0 is default, must be greater than 0 + */ + inline void set_volume( const ALfloat vol ) { + if ( vol > 0.0 ) { + alListenerf( AL_GAIN, vol ); + } + } + /** * set the position of the listener (in opengl coordinates) */ -- 2.39.5