MixerSettings.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * MixerSettings.h
  3. * ---------------
  4. * Purpose: A struct containing settings for the mixer of soundlib.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. OPENMPT_NAMESPACE_BEGIN
  12. struct MixerSettings
  13. {
  14. int32 m_nStereoSeparation;
  15. enum : int32 { StereoSeparationScale = 128 };
  16. uint32 m_nMaxMixChannels;
  17. uint32 DSPMask;
  18. uint32 MixerFlags;
  19. uint32 gdwMixingFreq;
  20. uint32 gnChannels;
  21. uint32 m_nPreAmp;
  22. std::size_t NumInputChannels;
  23. int32 VolumeRampUpMicroseconds;
  24. int32 VolumeRampDownMicroseconds;
  25. int32 GetVolumeRampUpMicroseconds() const { return VolumeRampUpMicroseconds; }
  26. int32 GetVolumeRampDownMicroseconds() const { return VolumeRampDownMicroseconds; }
  27. void SetVolumeRampUpMicroseconds(int32 rampUpMicroseconds) { VolumeRampUpMicroseconds = rampUpMicroseconds; }
  28. void SetVolumeRampDownMicroseconds(int32 rampDownMicroseconds) { VolumeRampDownMicroseconds = rampDownMicroseconds; }
  29. int32 GetVolumeRampUpSamples() const;
  30. int32 GetVolumeRampDownSamples() const;
  31. void SetVolumeRampUpSamples(int32 rampUpSamples);
  32. void SetVolumeRampDownSamples(int32 rampDownSamples);
  33. bool IsValid() const
  34. {
  35. return (gdwMixingFreq > 0) && (gnChannels == 1 || gnChannels == 2 || gnChannels == 4) && (NumInputChannels == 0 || NumInputChannels == 1 || NumInputChannels == 2 || NumInputChannels == 4);
  36. }
  37. MixerSettings();
  38. };
  39. OPENMPT_NAMESPACE_END