diff options
author | Chris Robinson <[email protected]> | 2016-03-10 14:29:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-03-10 14:29:44 -0800 |
commit | d648486bcd431b34ad68b76db400ff7e963c72e2 (patch) | |
tree | 6b4e2fab0b5c92cbef7800dc0efceb6459c942c4 /OpenAL32/Include/alMain.h | |
parent | da5f75615bf4dee38d456949b30b90921ad713c0 (diff) |
Generalize GetChannelIdxByName
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index fc55b93b..aae19b05 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -688,20 +688,20 @@ const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans) DECL_CONST; /** * GetChannelIdxByName * - * Returns the dry buffer's channel index for the given channel name (e.g. - * FrontCenter), or -1 if it doesn't exist. + * Returns the index for the given channel name (e.g. FrontCenter), or -1 if it + * doesn't exist. */ -inline ALint GetChannelIdxByName(const ALCdevice *device, enum Channel chan) +inline ALint GetChannelIndex(const enum Channel names[MAX_OUTPUT_CHANNELS], enum Channel chan) { - ALint i = 0; + ALint i; for(i = 0;i < MAX_OUTPUT_CHANNELS;i++) { - if(device->Dry.ChannelName[i] == chan) + if(names[i] == chan) return i; } return -1; } - +#define GetChannelIdxByName(x, c) GetChannelIndex((x).ChannelName, (c)) extern FILE *LogFile; |