Be consistent in how we apply the base gain.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@979 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -240,11 +240,9 @@ public class OpenALSoundPlayer extends SoundPlayer
|
|||||||
@Override
|
@Override
|
||||||
protected Frob loop (String pkgPath, String key, float pan)
|
protected Frob loop (String pkgPath, String key, float pan)
|
||||||
{
|
{
|
||||||
final float volume = getClipVolume();
|
|
||||||
final SoundGrabber loader = new SoundGrabber(pkgPath, key) {
|
final SoundGrabber loader = new SoundGrabber(pkgPath, key) {
|
||||||
@Override
|
@Override
|
||||||
protected void soundLoaded () {
|
protected void soundLoaded () {
|
||||||
sound.setGain(volume);
|
|
||||||
sound.loop(true);
|
sound.loop(true);
|
||||||
}};
|
}};
|
||||||
getSoundQueue().postRunnable(loader);
|
getSoundQueue().postRunnable(loader);
|
||||||
@@ -274,7 +272,7 @@ public class OpenALSoundPlayer extends SoundPlayer
|
|||||||
@Override
|
@Override
|
||||||
public void play (String pkgPath, String key, float pan)
|
public void play (String pkgPath, String key, float pan)
|
||||||
{
|
{
|
||||||
play(pkgPath, key, pan, getClipVolume());
|
play(pkgPath, key, pan, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void play (String pkgPath, String key, float pan, final float gain)
|
public void play (String pkgPath, String key, float pan, final float gain)
|
||||||
|
|||||||
@@ -85,12 +85,12 @@ public class Sound
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the gain of the sound.
|
* Sets the gain of the sound (which will be multiplied by the base gain).
|
||||||
*/
|
*/
|
||||||
public void setGain (float gain)
|
public void setGain (float gain)
|
||||||
{
|
{
|
||||||
if (_source != null) {
|
if (_source != null) {
|
||||||
_source.setGain(gain);
|
_source.setGain(gain * _group.getBaseGain());
|
||||||
}
|
}
|
||||||
_gain = gain;
|
_gain = gain;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user