aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-04-02 15:53:27 -0700
committerChris Robinson <[email protected]>2019-04-02 16:06:45 -0700
commitd04f9326c95696413a26f6a2d004138f42686e4d (patch)
treebb25f6b50b05aa132e953bda837c6902b1d9f167 /OpenAL32/Include
parent9ac3524521e23e667e69dccee6a928a18267a440 (diff)
Change RealMixParams::ChannelName to better reflect its use
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index daa3a09a..947b6f1b 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -123,7 +123,7 @@ enum Channel {
Aux14,
Aux15,
- InvalidChannel
+ MaxChannels
};
@@ -326,7 +326,7 @@ struct MixParams {
};
struct RealMixParams {
- Channel ChannelName[MAX_OUTPUT_CHANNELS]{};
+ std::array<ALint,MaxChannels> ChannelIndex{};
ALfloat (*Buffer)[BUFFERSIZE]{nullptr};
ALsizei NumChannels{0};
@@ -553,20 +553,14 @@ void SetDefaultWFXChannelOrder(ALCdevice *device);
const ALCchar *DevFmtTypeString(DevFmtType type) noexcept;
const ALCchar *DevFmtChannelsString(DevFmtChannels chans) noexcept;
-inline ALint GetChannelIndex(const Channel (&names)[MAX_OUTPUT_CHANNELS], Channel chan)
-{
- auto iter = std::find(std::begin(names), std::end(names), chan);
- if(iter == std::end(names)) return -1;
- return static_cast<ALint>(std::distance(std::begin(names), iter));
-}
/**
* GetChannelIdxByName
*
* Returns the index for the given channel name (e.g. FrontCenter), or -1 if it
* doesn't exist.
*/
-inline ALint GetChannelIdxByName(const RealMixParams &real, Channel chan)
-{ return GetChannelIndex(real.ChannelName, chan); }
+inline ALint GetChannelIdxByName(const RealMixParams &real, Channel chan) noexcept
+{ return real.ChannelIndex[chan]; }
void StartEventThrd(ALCcontext *ctx);