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