aboutsummaryrefslogtreecommitdiffstats
path: root/al/eax/api.h
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2023-05-24 16:36:21 -0700
committerChris Robinson <chris.kcat@gmail.com>2023-05-24 16:36:21 -0700
commit8db38cfb763acc231a3ddbcc9c49ff93d4531c16 (patch)
treec55b532a808fadccedb0e98c173a8648bb2ecbe9 /al/eax/api.h
parentf3e9d066df50a6e77e8c15ea97b195a4b069f254 (diff)
Use a variant to hold EAX effect properties
Diffstat (limited to 'al/eax/api.h')
-rw-r--r--al/eax/api.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/al/eax/api.h b/al/eax/api.h
index d254da1f..b3a09d29 100644
--- a/al/eax/api.h
+++ b/al/eax/api.h
@@ -38,6 +38,9 @@ inline bool operator!=(const GUID& lhs, const GUID& rhs) noexcept
#endif // _SYS_GUID_OPERATOR_EQ_
#endif // GUID_DEFINED
+#define DECL_EQOP(T) \
+friend bool operator==(const T &lhs, const T &rhs) noexcept { return std::memcmp(&lhs, &rhs, sizeof(T)) == 0; } \
+friend bool operator!=(const T &lhs, const T &rhs) noexcept { return !(lhs == rhs); }
extern const GUID DSPROPSETID_EAX_ReverbProperties;
@@ -836,6 +839,7 @@ struct EAXREVERBPROPERTIES {
float flLFReference; // reference low frequency
float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
unsigned long ulFlags; // modifies the behavior of properties
+ DECL_EQOP(EAXREVERBPROPERTIES)
}; // EAXREVERBPROPERTIES
@@ -965,6 +969,7 @@ enum EAXAGCCOMPRESSOR_PROPERTY : unsigned int {
struct EAXAGCCOMPRESSORPROPERTIES {
unsigned long ulOnOff; // Switch Compressor on or off
+ DECL_EQOP(EAXAGCCOMPRESSORPROPERTIES)
}; // EAXAGCCOMPRESSORPROPERTIES
@@ -991,6 +996,7 @@ struct EAXAUTOWAHPROPERTIES {
float flReleaseTime; // Release time (seconds)
long lResonance; // Resonance (mB)
long lPeakLevel; // Peak level (mB)
+ DECL_EQOP(EAXAUTOWAHPROPERTIES)
}; // EAXAUTOWAHPROPERTIES
@@ -1038,6 +1044,7 @@ struct EAXCHORUSPROPERTIES {
float flDepth; // Depth (0 to 1)
float flFeedback; // Feedback (-1 to 1)
float flDelay; // Delay (seconds)
+ DECL_EQOP(EAXCHORUSPROPERTIES)
}; // EAXCHORUSPROPERTIES
@@ -1086,6 +1093,7 @@ struct EAXDISTORTIONPROPERTIES {
float flLowPassCutOff; // Controls the cut-off of the filter pre-distortion (Hz)
float flEQCenter; // Controls the center frequency of the EQ post-distortion (Hz)
float flEQBandwidth; // Controls the bandwidth of the EQ post-distortion (Hz)
+ DECL_EQOP(EAXDISTORTIONPROPERTIES)
}; // EAXDISTORTIONPROPERTIES
@@ -1130,6 +1138,7 @@ struct EAXECHOPROPERTIES {
float flDamping; // Controls a low-pass filter that dampens the echoes (0 to 1)
float flFeedback; // Controls the duration of echo repetition (0 to 1)
float flSpread; // Controls the left-right spread of the echoes
+ DECL_EQOP(EAXECHOPROPERTIES)
}; // EAXECHOPROPERTIES
@@ -1184,6 +1193,7 @@ struct EAXEQUALIZERPROPERTIES {
float flMid2Width; // (octaves)
long lHighGain; // (mB)
float flHighCutOff; // (Hz)
+ DECL_EQOP(EAXEQUALIZERPROPERTIES)
}; // EAXEQUALIZERPROPERTIES
@@ -1255,6 +1265,7 @@ struct EAXFLANGERPROPERTIES {
float flDepth; // Depth (0 to 1)
float flFeedback; // Feedback (0 to 1)
float flDelay; // Delay (seconds)
+ DECL_EQOP(EAXFLANGERPROPERTIES)
}; // EAXFLANGERPROPERTIES
@@ -1305,6 +1316,7 @@ struct EAXFREQUENCYSHIFTERPROPERTIES {
float flFrequency; // (Hz)
unsigned long ulLeftDirection; // see enum above
unsigned long ulRightDirection; // see enum above
+ DECL_EQOP(EAXFREQUENCYSHIFTERPROPERTIES)
}; // EAXFREQUENCYSHIFTERPROPERTIES
@@ -1383,6 +1395,7 @@ struct EAXVOCALMORPHERPROPERTIES {
long lPhonemeBCoarseTuning; // (semitones)
unsigned long ulWaveform; // Waveform selector - see enum above
float flRate; // (Hz)
+ DECL_EQOP(EAXVOCALMORPHERPROPERTIES)
}; // EAXVOCALMORPHERPROPERTIES
@@ -1425,6 +1438,7 @@ enum EAXPITCHSHIFTER_PROPERTY : unsigned int {
struct EAXPITCHSHIFTERPROPERTIES {
long lCoarseTune; // Amount of pitch shift (semitones)
long lFineTune; // Amount of pitch shift (cents)
+ DECL_EQOP(EAXPITCHSHIFTERPROPERTIES)
}; // EAXPITCHSHIFTERPROPERTIES
@@ -1460,6 +1474,7 @@ struct EAXRINGMODULATORPROPERTIES {
float flFrequency; // Frequency of modulation (Hz)
float flHighPassCutOff; // Cut-off frequency of high-pass filter (Hz)
unsigned long ulWaveform; // Waveform selector - see enum above
+ DECL_EQOP(EAXRINGMODULATORPROPERTIES)
}; // EAXRINGMODULATORPROPERTIES
@@ -1490,4 +1505,5 @@ using LPEAXGET = ALenum(AL_APIENTRY*)(
ALvoid* property_buffer,
ALuint property_size);
+#undef DECL_EQOP
#endif // !EAX_API_INCLUDED