mirror of
https://github.com/jorio/Pomme.git
synced 2024-12-27 21:31:47 +00:00
Max channel gain
This commit is contained in:
parent
caa3414833
commit
88a3e4625b
@ -2,6 +2,10 @@
|
|||||||
#include "SoundMixer/ChannelImpl.h"
|
#include "SoundMixer/ChannelImpl.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#ifndef POMME_MAX_CHANNEL_GAIN
|
||||||
|
#define POMME_MAX_CHANNEL_GAIN 2.5
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Pomme::Sound
|
namespace Pomme::Sound
|
||||||
{
|
{
|
||||||
extern ChannelImpl* gHeadChan;
|
extern ChannelImpl* gHeadChan;
|
||||||
@ -61,6 +65,14 @@ void ChannelImpl::ApplyParametersToSource(int mask)
|
|||||||
// Pan and gain
|
// Pan and gain
|
||||||
if (mask & kApplyParameters_PanAndGain)
|
if (mask & kApplyParameters_PanAndGain)
|
||||||
{
|
{
|
||||||
|
if (gain > POMME_MAX_CHANNEL_GAIN)
|
||||||
|
{
|
||||||
|
#if _DEBUG
|
||||||
|
printf("Capping extreme channel gain (%f)\n", gain);
|
||||||
|
#endif
|
||||||
|
gain = POMME_MAX_CHANNEL_GAIN;
|
||||||
|
}
|
||||||
|
|
||||||
source.SetPan(pan);
|
source.SetPan(pan);
|
||||||
source.SetGain(gain);
|
source.SetGain(gain);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user