SoundFilePlayConfig.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * SoundFilePlayConfig.h
  3. * ---------------------
  4. * Purpose: Configuration of sound levels, pan laws, etc... for various mix configurations.
  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. enum class TempoMode : uint8
  13. {
  14. Classic = 0,
  15. Alternative = 1,
  16. Modern = 2,
  17. NumModes
  18. };
  19. enum class MixLevels : uint8
  20. {
  21. Original = 0,
  22. v1_17RC1 = 1,
  23. v1_17RC2 = 2,
  24. v1_17RC3 = 3,
  25. Compatible = 4,
  26. CompatibleFT2 = 5,
  27. NumMixLevels
  28. };
  29. enum class PanningMode : uint8
  30. {
  31. Undetermined,
  32. SoftPanning,
  33. NoSoftPanning,
  34. FT2Panning,
  35. };
  36. // Class used to store settings for a song file.
  37. class CSoundFilePlayConfig
  38. {
  39. public:
  40. CSoundFilePlayConfig();
  41. void SetMixLevels(MixLevels mixLevelType);
  42. //getters/setters
  43. bool getGlobalVolumeAppliesToMaster() const { return m_globalVolumeAppliesToMaster; }
  44. void setGlobalVolumeAppliesToMaster(bool inGlobalVolumeAppliesToMaster) { m_globalVolumeAppliesToMaster=inGlobalVolumeAppliesToMaster; }
  45. // user-controllable VSTi gain factor.
  46. float getVSTiVolume() const { return m_VSTiVolume; }
  47. void setVSTiVolume(float inVSTiVolume) { m_VSTiVolume = inVSTiVolume; }
  48. // default VSTi gain factor, different depending on the MPT version we're "emulating"
  49. float getVSTiAttenuation() const { return m_VSTiAttenuation; }
  50. void setVSTiAttenuation(float inVSTiAttenuation) { m_VSTiAttenuation = inVSTiAttenuation; }
  51. float getIntToFloat() const { return m_IntToFloat; }
  52. void setIntToFloat(float inIntToFloat) { m_IntToFloat = inIntToFloat; }
  53. float getFloatToInt() const { return m_FloatToInt; }
  54. void setFloatToInt(float inFloatToInt) { m_FloatToInt = inFloatToInt; }
  55. bool getUseGlobalPreAmp() const { return m_ignorePreAmp; }
  56. void setUseGlobalPreAmp(bool inUseGlobalPreAmp) { m_ignorePreAmp = inUseGlobalPreAmp; }
  57. PanningMode getPanningMode() const { return m_forceSoftPanning; }
  58. void setPanningMode(PanningMode inForceSoftPanning) { m_forceSoftPanning = inForceSoftPanning; }
  59. bool getDisplayDBValues() const { return m_displayDBValues; }
  60. void setDisplayDBValues(bool in) { m_displayDBValues = in; }
  61. // Values at which volumes are unchanged
  62. float getNormalSamplePreAmp() const { return m_normalSamplePreAmp; }
  63. void setNormalSamplePreAmp(float in) { m_normalSamplePreAmp = in; }
  64. float getNormalVSTiVol() const { return m_normalVSTiVol; }
  65. void setNormalVSTiVol(float in) { m_normalVSTiVol = in; }
  66. float getNormalGlobalVol() const { return m_normalGlobalVol; }
  67. void setNormalGlobalVol(float in) { m_normalGlobalVol = in; }
  68. // Extra sample attenuation in bits
  69. int getExtraSampleAttenuation() const { return m_extraAttenuation; }
  70. void setExtraSampleAttenuation(int attn) { m_extraAttenuation = attn; }
  71. protected:
  72. float m_IntToFloat;
  73. float m_FloatToInt;
  74. float m_VSTiAttenuation;
  75. float m_VSTiVolume;
  76. float m_normalSamplePreAmp;
  77. float m_normalVSTiVol;
  78. float m_normalGlobalVol;
  79. int m_extraAttenuation;
  80. PanningMode m_forceSoftPanning;
  81. bool m_globalVolumeAppliesToMaster;
  82. bool m_ignorePreAmp;
  83. bool m_displayDBValues;
  84. };
  85. OPENMPT_NAMESPACE_END