aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-16 21:45:03 -0800
committerChris Robinson <[email protected]>2023-01-16 21:45:03 -0800
commit3d00147b99d4996f322ff231a7e0e7d9aff86f60 (patch)
treeaa6dde806a0d279fad83d77dbbf4f5f8356c6ce4 /core
parent8e9833c7a6dfe53b570d5a021888f2a5397b4796 (diff)
Change a couple macros to constexpr variables
Diffstat (limited to 'core')
-rw-r--r--core/device.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/device.h b/core/device.h
index 80a59502..178b66b8 100644
--- a/core/device.h
+++ b/core/device.h
@@ -73,13 +73,13 @@ struct InputRemixMap {
};
-/* Maximum delay in samples for speaker distance compensation. */
-#define MAX_DELAY_LENGTH 1024
-
struct DistanceComp {
+ /* Maximum delay in samples for speaker distance compensation. */
+ static constexpr uint MaxDelay{1024};
+
struct ChanData {
float Gain{1.0f};
- uint Length{0u}; /* Valid range is [0...MAX_DELAY_LENGTH). */
+ uint Length{0u}; /* Valid range is [0...MaxDelay). */
float *Buffer{nullptr};
};
@@ -95,7 +95,7 @@ struct DistanceComp {
};
-#define INVALID_CHANNEL_INDEX ~0u
+constexpr uint InvalidChannelIndex{~0u};
struct BFChannelConfig {
float Scale;
@@ -123,7 +123,7 @@ struct MixParams {
const size_t numOut{Buffer.size()};
for(size_t i{0};i < numIn;++i)
{
- auto idx = INVALID_CHANNEL_INDEX;
+ auto idx = InvalidChannelIndex;
auto gain = 0.0f;
for(size_t j{0};j < numOut;++j)