Jonathan Giroux avatar Jonathan Giroux committed a014742

Add control to the sound attenuation by distance.

Comments (0)

Files changed (17)

platform/msvc2010/love.vcxproj

     <ClCompile Include="..\..\src\love.cpp">
       <ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ShowIncludes>
     </ClCompile>
+    <ClCompile Include="..\..\src\modules\audio\Audio.cpp" />
     <ClCompile Include="..\..\src\modules\audio\null\Audio.cpp" />
     <ClCompile Include="..\..\src\modules\audio\null\Source.cpp" />
     <ClCompile Include="..\..\src\modules\audio\openal\Audio.cpp" />
     <ClCompile Include="..\..\src\modules\thread\wrap_Thread.cpp" />
     <ClCompile Include="..\..\src\modules\timer\sdl\Timer.cpp" />
     <ClCompile Include="..\..\src\modules\timer\wrap_Timer.cpp" />
+    <ClCompile Include="..\..\src\modules\window\sdl\Window.cpp" />
+    <ClCompile Include="..\..\src\modules\window\Window.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\common\b64.h" />
     <ClInclude Include="..\..\src\modules\timer\sdl\Timer.h" />
     <ClInclude Include="..\..\src\modules\timer\Timer.h" />
     <ClInclude Include="..\..\src\modules\timer\wrap_Timer.h" />
+    <ClInclude Include="..\..\src\modules\window\sdl\Window.h" />
+    <ClInclude Include="..\..\src\modules\window\Window.h" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="app.rc" />
       <AdditionalDependencies>opengl32.lib;glu32.lib;DevIL.lib;freetype244MT.lib;libmpg123.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;lua.lib;modplug.lib;OpenAL32.lib;physfs.lib;SDL.lib;SDLmain.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>lib</AdditionalLibraryDirectories>
       <SubSystem>Windows</SubSystem>
+      <AdditionalOptions>/FORCE:MULTIPLE %(AdditionalOptions)</AdditionalOptions>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

platform/msvc2010/love.vcxproj.filters

     <Filter Include="modules\physics\box2d">
       <UniqueIdentifier>{9282b1b4-0df5-4180-8840-ea58561dc7b8}</UniqueIdentifier>
     </Filter>
+    <Filter Include="modules\window">
+      <UniqueIdentifier>{1ef7f9ba-1fc3-4d88-b3fd-8ff0f34a0cc6}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\src\love.cpp" />
     <ClCompile Include="..\..\src\modules\joystick\sdl\wrap_Joystick.cpp">
       <Filter>modules\joystick\sdl</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\modules\sound\Sound.cpp">
-      <Filter>modules\sound</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\src\modules\sound\SoundData.cpp">
       <Filter>modules\sound</Filter>
     </ClCompile>
     <ClCompile Include="..\..\src\modules\keyboard\sdl\Keyboard.cpp">
       <Filter>modules\keyboard\sdl</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\modules\sound\Sound.cpp">
+      <Filter>modules\sound</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\modules\window\sdl\Window.cpp">
+      <Filter>modules\window</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\modules\window\Window.cpp">
+      <Filter>modules\window</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\modules\audio\Audio.cpp">
+      <Filter>modules\audio</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\modules\audio\Audio.h">
     <ClInclude Include="..\..\src\modules\keyboard\sdl\Keyboard.h">
       <Filter>modules\keyboard\sdl</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\modules\window\Window.h">
+      <Filter>modules\window</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\modules\window\sdl\Window.h">
+      <Filter>modules\window</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="app.rc" />

src/modules/audio/Audio.cpp

+/**
+* Copyright (c) 2006-2011 LOVE Development Team
+*
+* This software is provided 'as-is', without any express or implied
+* warranty.  In no event will the authors be held liable for any damages
+* arising from the use of this software.
+*
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+*
+* 1. The origin of this software must not be misrepresented; you must not
+*    claim that you wrote the original software. If you use this software
+*    in a product, an acknowledgment in the product documentation would be
+*    appreciated but is not required.
+* 2. Altered Audio versions must be plainly marked as such, and must not be
+*    misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any Audio distribution.
+**/
+
+#include "Audio.h"
+
+namespace love
+{
+namespace audio
+{
+	StringMap<Audio::DistanceModel, Audio::DISTANCE_MAX_ENUM>::Entry Audio::distanceModelEntries[] =
+	{
+		{"none", Audio::DISTANCE_NONE},
+		{"inverse", Audio::DISTANCE_INVERSE},
+		{"inverse clamped", Audio::DISTANCE_INVERSE_CLAMPED},
+		{"linear", Audio::DISTANCE_LINEAR},
+		{"linear clamped", Audio::DISTANCE_LINEAR},
+		{"exponent", Audio::DISTANCE_EXPONENT},
+		{"exponent clamped", Audio::DISTANCE_EXPONENT}
+	};
+	
+	StringMap<Audio::DistanceModel, Audio::DISTANCE_MAX_ENUM> Audio::distanceModels(Audio::distanceModelEntries, sizeof(Audio::distanceModelEntries));
+	
+	bool Audio::getConstant(const char * in, DistanceModel & out)
+	{
+		return distanceModels.find(in, out);
+	}
+
+	bool Audio::getConstant(DistanceModel in, const char *& out)
+	{
+		return distanceModels.find(in, out);
+	}
+
+} // audio
+} // love

src/modules/audio/Audio.h

 #define LOVE_AUDIO_AUDIO_H
 
 #include <common/Module.h>
+#include <common/StringMap.h>
 #include "Source.h"
 
 namespace love
 	public:
 
 		/**
+		* Attenuation by distance.
+		*/
+		enum DistanceModel
+		{
+			DISTANCE_NONE = 1,
+			DISTANCE_INVERSE,
+			DISTANCE_INVERSE_CLAMPED,
+			DISTANCE_LINEAR,
+			DISTANCE_LINEAR_CLAMPED,
+			DISTANCE_EXPONENT,
+			DISTANCE_EXPONENT_CLAMPED,
+			DISTANCE_MAX_ENUM
+		};
+		
+		static bool getConstant(const char * in, DistanceModel & out);
+		static bool getConstant(DistanceModel in, const char *& out);
+
+		/**
 		* Destructor.
 		**/
 		virtual ~Audio(){};
 		**/
 		virtual bool canRecord() = 0;
 
+		/**
+		* Gets the distance model used for attenuation.
+		* @return Distance model.
+		*/
+		virtual DistanceModel getDistanceModel() const = 0;
+
+		/**
+		* Sets the distance model used for attenuation.
+		* @param distanceModel Distance model.
+		*/
+		virtual void setDistanceModel(DistanceModel distanceModel) = 0;
+
+	private:
+			
+		static StringMap<DistanceModel, DISTANCE_MAX_ENUM>::Entry distanceModelEntries[];
+		static StringMap<DistanceModel, DISTANCE_MAX_ENUM> distanceModels;
 	}; // Audio
 
 } // audio

src/modules/audio/Source.h

 		virtual void setLooping(bool looping) = 0;
 		virtual bool isLooping() const = 0;
 		virtual bool isStatic() const = 0;
+		
+		virtual void setMinVolume(float volume) = 0;
+		virtual float getMinVolume() const = 0;
+		virtual void setMaxVolume(float volume) = 0;
+		virtual float getMaxVolume() const = 0;
+
+		virtual void setReferenceDistance(float distance) = 0;
+		virtual float getReferenceDistance() const = 0;
+		virtual void setRolloffFactor(float factor) = 0;
+		virtual float getRolloffFactor() const = 0;
+		virtual void setMaxDistance(float distance) = 0;
+		virtual float getMaxDistance() const = 0;
 
 		static bool getConstant(const char * in, Type & out);
 		static bool getConstant(Type in, const char *& out);

src/modules/audio/null/Audio.cpp

 {
 namespace null
 {
-	Audio::Audio()
+	Audio::Audio() : distanceModel(DISTANCE_NONE)
 	{
 	}
 
 	{
 		return false;
 	}
+	
+	Audio::DistanceModel Audio::getDistanceModel() const
+	{
+		return this->distanceModel;
+	}
+
+	void Audio::setDistanceModel(DistanceModel distanceModel)
+	{
+		this->distanceModel = distanceModel;
+	}
 
 } // null
 } // audio

src/modules/audio/null/Audio.h

 	{
 	private:
 		float volume;
+		DistanceModel distanceModel;
 	public:
 
 		Audio();
 		love::sound::SoundData * stopRecording(bool returnData);
 		bool canRecord();
 
+		DistanceModel getDistanceModel() const;
+		void setDistanceModel(DistanceModel distanceModel);
+
 	}; // Audio
 
 } // null

src/modules/audio/null/Source.cpp

 	{
 		return (type == TYPE_STATIC);
 	}
+	
+	void Source::setMinVolume(float volume)
+	{
+		this->minVolume = volume;
+	}
+
+	float Source::getMinVolume() const
+	{
+		return this->minVolume;
+	}
+
+	void Source::setMaxVolume(float volume)
+	{
+		this->maxVolume = volume;
+	}
+
+	float Source::getMaxVolume() const
+	{
+		return this->maxVolume;
+	}
+
+	void Source::setReferenceDistance(float distance)
+	{
+		this->referenceDistance = distance;
+	}
+
+	float Source::getReferenceDistance() const
+	{
+		return this->referenceDistance;
+	}
+
+	void Source::setRolloffFactor(float factor)
+	{
+		this->rolloffFactor = factor;
+	}
+
+	float Source::getRolloffFactor() const
+	{
+		return this->rolloffFactor;
+	}
+
+	void Source::setMaxDistance(float distance)
+	{
+		this->maxDistance = distance;
+	}
+
+	float Source::getMaxDistance() const
+	{
+		return this->maxDistance;
+	}
 
 } // null
 } // audio

src/modules/audio/null/Source.h

 		float pitch;
 		float volume;
 		bool looping;
+		float minVolume;
+		float maxVolume;
+		float referenceDistance;
+		float rolloffFactor;
+		float maxDistance;
 
 	public:
 		Source();
 		void setLooping(bool looping);
 		bool isLooping() const;
 		bool isStatic() const;
+		virtual void setMinVolume(float volume);
+		virtual float getMinVolume() const;
+		virtual void setMaxVolume(float volume);
+		virtual float getMaxVolume() const;
+		virtual void setReferenceDistance(float distance);
+		virtual float getReferenceDistance() const;
+		virtual void setRolloffFactor(float factor);
+		virtual float getRolloffFactor() const;
+		virtual void setMaxDistance(float distance);
+		virtual float getMaxDistance() const;
 
 	}; // Source
 

src/modules/audio/openal/Audio.cpp

 	}
 
 
-	Audio::Audio()
+	Audio::Audio() : distanceModel(DISTANCE_INVERSE_CLAMPED)
 	{
 		// Passing zero for default device.
 		device = alcOpenDevice(0);
 	{
 		return (capture != NULL);
 	}
+	
+	Audio::DistanceModel Audio::getDistanceModel() const
+	{
+		return this->distanceModel;
+	}
 
+	void Audio::setDistanceModel(DistanceModel distanceModel)
+	{
+		this->distanceModel = distanceModel;
+		
+		switch (distanceModel)
+		{
+		case DISTANCE_NONE:
+			alDistanceModel(AL_NONE);
+			break;
+			
+		case DISTANCE_INVERSE:
+			alDistanceModel(AL_INVERSE_DISTANCE);
+			break;
+
+		case DISTANCE_INVERSE_CLAMPED:
+			alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED);
+			break;
+			
+		case DISTANCE_LINEAR:
+			alDistanceModel(AL_LINEAR_DISTANCE);
+			break;
+
+		case DISTANCE_LINEAR_CLAMPED:
+			alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
+			break;
+			
+		case DISTANCE_EXPONENT:
+			alDistanceModel(AL_EXPONENT_DISTANCE);
+			break;
+
+		case DISTANCE_EXPONENT_CLAMPED:
+			alDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED);
+			break;
+
+		default:
+			break;
+		}
+	}
 } // openal
 } // audio
 } // love

src/modules/audio/openal/Audio.h

 
 		PoolThread* poolThread;
 
+		DistanceModel distanceModel;
+
 	public:
 
 		Audio();
 		love::sound::SoundData * getRecordedData();
 		love::sound::SoundData * stopRecording(bool returnData);
 		bool canRecord();
-
+		
+		DistanceModel getDistanceModel() const;
+		void setDistanceModel(DistanceModel distanceModel);
 	}; // Audio
 
 } // openal

src/modules/audio/openal/Source.cpp

 
 // STD
 #include <iostream>
+#include <float.h>
 
 namespace love
 {
 
 	Source::Source(Pool * pool, love::sound::SoundData * soundData)
 		: love::audio::Source(Source::TYPE_STATIC), pool(pool), valid(false),
-		pitch(1.0f), volume(1.0f), looping(false), paused(false), offsetSamples(0),
-		offsetSeconds(0), decoder(0), toLoop(0)
+		pitch(1.0f), volume(1.0f), looping(false), paused(false), minVolume(0.0f),
+		maxVolume(1.0f), referenceDistance(1.0f), rolloffFactor(1.0f), maxDistance(FLT_MAX),
+		offsetSamples(0), offsetSeconds(0), decoder(0), toLoop(0)
 	{
 		alGenBuffers(1, buffers);
 		ALenum fmt = getFormat(soundData->getChannels(), soundData->getBits());
 
 	Source::Source(Pool * pool, love::sound::Decoder * decoder)
 		: love::audio::Source(Source::TYPE_STREAM), pool(pool), valid(false),
-		pitch(1.0f), volume(1.0f), looping(false), paused(false), offsetSamples(0),
-		offsetSeconds(0), decoder(decoder), toLoop(0)
+		pitch(1.0f), volume(1.0f), looping(false), paused(false), minVolume(0.0f),
+		maxVolume(1.0f), referenceDistance(1.0f), rolloffFactor(1.0f), maxDistance(FLT_MAX),
+		offsetSamples(0), offsetSeconds(0), decoder(decoder), toLoop(0)
 	{
 		decoder->retain();
 		alGenBuffers(MAX_BUFFERS, buffers);
 		// been without an AL source.
 		alSourcef(source, AL_PITCH, pitch);
 		alSourcef(source, AL_GAIN, volume);
+		alSourcef(source, AL_MIN_GAIN, minVolume);
+		alSourcef(source, AL_MAX_GAIN, maxVolume);
+		alSourcef(source, AL_REFERENCE_DISTANCE, referenceDistance);
+		alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor);
+		alSourcef(source, AL_MAX_DISTANCE, maxDistance);
 
 		alSourcePlay(source);
 
 		alSourcefv(source, AL_DIRECTION, direction);
 		alSourcef(source, AL_PITCH, pitch);
 		alSourcef(source, AL_GAIN, volume);
+		alSourcef(source, AL_MIN_GAIN, minVolume);
+		alSourcef(source, AL_MAX_GAIN, maxVolume);
+		alSourcef(source, AL_REFERENCE_DISTANCE, referenceDistance);
+		alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor);
+		alSourcef(source, AL_MAX_DISTANCE, maxDistance);
 	}
 
 	void Source::setFloatv(float * dst, const float * src) const
 	{
 		return (type == TYPE_STATIC);
 	}
+	
+	void Source::setMinVolume(float volume)
+	{
+		if (valid)
+		{
+			alSourcef(source, AL_MIN_GAIN, volume);
+		}
+
+		this->minVolume = volume;
+	}
+
+	float Source::getMinVolume() const
+	{
+		if (valid)
+		{
+			ALfloat f;
+			alGetSourcef(source, AL_MIN_GAIN, &f);
+			return f;
+		}
+
+		// In case the Source isn't playing.
+		return this->minVolume;
+	}
+
+	void Source::setMaxVolume(float volume)
+	{
+		if (valid)
+		{
+			alSourcef(source, AL_MAX_GAIN, volume);
+		}
+
+		this->maxVolume = volume;
+	}
+
+	float Source::getMaxVolume() const
+	{
+		if (valid)
+		{
+			ALfloat f;
+			alGetSourcef(source, AL_MAX_GAIN, &f);
+			return f;
+		}
+
+		// In case the Source isn't playing.
+		return this->maxVolume;
+	}
+
+	void Source::setReferenceDistance(float distance)
+	{
+		if (valid)
+		{
+			alSourcef(source, AL_REFERENCE_DISTANCE, distance);
+		}
+
+		this->referenceDistance = distance;
+	}
+
+	float Source::getReferenceDistance() const
+	{
+		if (valid)
+		{
+			ALfloat f;
+			alGetSourcef(source, AL_REFERENCE_DISTANCE, &f);
+			return f;
+		}
+
+		// In case the Source isn't playing.
+		return this->referenceDistance;
+	}
+
+	void Source::setRolloffFactor(float factor)
+	{
+		if (valid)
+		{
+			alSourcef(source, AL_ROLLOFF_FACTOR, factor);
+		}
+
+		this->rolloffFactor = factor;
+	}
+
+	float Source::getRolloffFactor() const
+	{
+		if (valid)
+		{
+			ALfloat f;
+			alGetSourcef(source, AL_ROLLOFF_FACTOR, &f);
+			return f;
+		}
+
+		// In case the Source isn't playing.
+		return this->rolloffFactor;
+	}
+
+	void Source::setMaxDistance(float distance)
+	{
+		if (valid)
+		{
+			alSourcef(source, AL_MAX_DISTANCE, distance);
+		}
+
+		this->maxDistance = distance;
+	}
+
+	float Source::getMaxDistance() const
+	{
+		if (valid)
+		{
+			ALfloat f;
+			alGetSourcef(source, AL_MAX_DISTANCE, &f);
+			return f;
+		}
+
+		// In case the Source isn't playing.
+		return this->maxDistance;
+	}
 
 } // openal
 } // audio

src/modules/audio/openal/Source.h

 		float direction[3];
 		bool looping;
 		bool paused;
+		float minVolume;
+		float maxVolume;
+		float referenceDistance;
+		float rolloffFactor;
+		float maxDistance;
 
 		float offsetSamples;
 		float offsetSeconds;
 		void setLooping(bool looping);
 		bool isLooping() const;
 		bool isStatic() const;
+		virtual void setMinVolume(float volume);
+		virtual float getMinVolume() const;
+		virtual void setMaxVolume(float volume);
+		virtual float getMaxVolume() const;
+		virtual void setReferenceDistance(float distance);
+		virtual float getReferenceDistance() const;
+		virtual void setRolloffFactor(float factor);
+		virtual float getRolloffFactor() const;
+		virtual void setMaxDistance(float distance);
+		virtual float getMaxDistance() const;
 
 		void playAtomic();
 		void stopAtomic();

src/modules/audio/wrap_Audio.cpp

 		luax_pushboolean(L, instance->canRecord());
 		return 1;
 	}
+	
+	int w_setDistanceModel(lua_State * L)
+	{
+		const char *modelStr = luaL_checkstring(L, 1);
+		Audio::DistanceModel distanceModel;
+		Audio::getConstant(modelStr, distanceModel);
+		instance->setDistanceModel(distanceModel);
+		return 0;
+	}
 
+	int w_getDistanceModel(lua_State * L)
+	{
+		Audio::DistanceModel distanceModel = instance->getDistanceModel();
+		const char *modelStr;
+		Audio::getConstant(distanceModel, modelStr);
+		lua_pushstring(L, modelStr);
+		return 1;
+	}
 
 	// List of functions to wrap.
 	static const luaL_Reg functions[] = {
 		/*{ "record", w_record },
 		{ "getRecordedData", w_getRecordedData },
 		{ "stopRecording", w_stopRecording },*/
+		{ "setDistanceModel", w_setDistanceModel },
+		{ "getDistanceModel", w_getDistanceModel },
 		{ 0, 0 }
 	};
 

src/modules/audio/wrap_Audio.h

 	int w_getRecordedData(lua_State * L);
 	int w_stopRecording(lua_State * L);
 	int w_canRecord(lua_State * L);
+	int w_setDistanceModel(lua_State * L);
+	int w_getDistanceModel(lua_State * L);
 	extern "C" LOVE_EXPORT int luaopen_love_audio(lua_State * L);
 
 } // audio

src/modules/audio/wrap_Source.cpp

 
 	int w_Source_isStatic(lua_State * L)
 	{
-		Source * t= luax_checksource(L, 1);
+		Source * t = luax_checksource(L, 1);
 		luax_pushboolean(L, t->isStatic());
 		return 1;
 	}
 
+	int w_Source_setMinVolume(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		t->setMinVolume((float)luaL_checknumber(L, 2));
+		return 0;
+	}
+
+	int w_Source_getMinVolume(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		lua_pushnumber(L, t->getMinVolume());
+		return 1;
+	}
+
+	int w_Source_setMaxVolume(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		t->setMaxVolume((float)luaL_checknumber(L, 2));
+		return 0;
+	}
+
+	int w_Source_getMaxVolume(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		lua_pushnumber(L, t->getMaxVolume());
+		return 1;
+	}
+
+	int w_Source_setReferenceDistance(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		t->setReferenceDistance((float)luaL_checknumber(L, 2));
+		return 0;
+	}
+
+	int w_Source_getReferenceDistance(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		lua_pushnumber(L, t->getReferenceDistance());
+		return 1;
+	}
+
+	int w_Source_setRolloffFactor(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		t->setRolloffFactor((float)luaL_checknumber(L, 2));
+		return 0;
+	}
+
+	int w_Source_getRolloffFactor(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		lua_pushnumber(L, t->getRolloffFactor());
+		return 1;
+	}
+
+	int w_Source_setMaxDistance(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		t->setMaxDistance((float)luaL_checknumber(L, 2));
+		return 0;
+	}
+
+	int w_Source_getMaxDistance(lua_State * L)
+	{
+		Source * t = luax_checksource(L, 1);
+		lua_pushnumber(L, t->getMaxDistance());
+		return 1;
+	}
+
+
 	static const luaL_Reg functions[] = {
 		{ "play", w_Source_play },
 		{ "stop", w_Source_stop },
 		{ "isStopped", w_Source_isStopped },
 		{ "isPaused", w_Source_isPaused },
 		{ "isStatic", w_Source_isStatic },
+		
+		{ "setMinVolume", w_Source_setMinVolume },
+		{ "getMinVolume", w_Source_getMinVolume },
+		{ "setMaxVolume", w_Source_setMaxVolume },
+		{ "getMaxVolume", w_Source_getMaxVolume },
+		{ "setReferenceDistance", w_Source_setReferenceDistance },
+		{ "getReferenceDistance", w_Source_getReferenceDistance },
+		{ "setRolloffFactor", w_Source_setRolloffFactor },
+		{ "getRolloffFactor", w_Source_getRolloffFactor },
+		{ "setMaxDistance", w_Source_setMaxDistance },
+		{ "getMaxDistance", w_Source_getMaxDistance },
+
 		{ 0, 0 }
 	};
 

src/modules/audio/wrap_Source.h

 	int w_Source_isStopped(lua_State * L);
 	int w_Source_isPaused(lua_State * L);
 	int w_Source_isStatic(lua_State * L);
+	int w_Source_setMinVolume(lua_State * L);
+	int w_Source_getMinVolume(lua_State * L);
+	int w_Source_setMaxVolume(lua_State * L);
+	int w_Source_getMinVolume(lua_State * L);
+	int w_Source_setReferenceDistance(lua_State * L);
+	int w_Source_getReferenceDistance(lua_State * L);
+	int w_Source_setRolloffFactor(lua_State * L);
+	int w_Source_getRolloffFactor(lua_State * L);
+	int w_Source_setMaxDistance(lua_State * L);
+	int w_Source_getMaxDistance(lua_State * L);
 	int luaopen_source(lua_State * L);
 
 } // audio
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.