diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/external_dependencies/openmpt-trunk/soundlib/MixerSettings.cpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/external_dependencies/openmpt-trunk/soundlib/MixerSettings.cpp')
-rw-r--r-- | Src/external_dependencies/openmpt-trunk/soundlib/MixerSettings.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Src/external_dependencies/openmpt-trunk/soundlib/MixerSettings.cpp b/Src/external_dependencies/openmpt-trunk/soundlib/MixerSettings.cpp new file mode 100644 index 00000000..7a105725 --- /dev/null +++ b/Src/external_dependencies/openmpt-trunk/soundlib/MixerSettings.cpp @@ -0,0 +1,59 @@ +/* + * MixerSettings.cpp + * ----------------- + * Purpose: A struct containing settings for the mixer of soundlib. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include "stdafx.h" +#include "MixerSettings.h" +#include "Snd_defs.h" +#include "../common/misc_util.h" + +OPENMPT_NAMESPACE_BEGIN + +MixerSettings::MixerSettings() +{ + + // SNDMIX: These are global flags for playback control + m_nStereoSeparation = 128; + m_nMaxMixChannels = MAX_CHANNELS; + + DSPMask = 0; + MixerFlags = 0; + + // Mixing Configuration + gnChannels = 2; + gdwMixingFreq = 48000; + + m_nPreAmp = 128; + + VolumeRampUpMicroseconds = 363; // 16 @44100 + VolumeRampDownMicroseconds = 952; // 42 @44100 + + NumInputChannels = 0; + +} + +int32 MixerSettings::GetVolumeRampUpSamples() const +{ + return Util::muldivr(VolumeRampUpMicroseconds, gdwMixingFreq, 1000000); +} +int32 MixerSettings::GetVolumeRampDownSamples() const +{ + return Util::muldivr(VolumeRampDownMicroseconds, gdwMixingFreq, 1000000); +} + +void MixerSettings::SetVolumeRampUpSamples(int32 rampUpSamples) +{ + VolumeRampUpMicroseconds = Util::muldivr(rampUpSamples, 1000000, gdwMixingFreq); +} +void MixerSettings::SetVolumeRampDownSamples(int32 rampDownSamples) +{ + VolumeRampDownMicroseconds = Util::muldivr(rampDownSamples, 1000000, gdwMixingFreq); +} + + +OPENMPT_NAMESPACE_END |