diff options
author | Chris Robinson <[email protected]> | 2019-12-28 16:40:10 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-12-28 16:40:10 -0800 |
commit | 137394c2cfb7d3133e06b8b24a827db95995f7d8 (patch) | |
tree | bf377908c47fb63eeacf180c675726bf4549ebfb /examples/alffplay.cpp | |
parent | 701d43b41e1976f4a06622df0baa0f284aaaf022 (diff) |
Make the new direct channel remix extension public
Diffstat (limited to 'examples/alffplay.cpp')
-rw-r--r-- | examples/alffplay.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index fcbf19b5..040a9e69 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -125,7 +125,7 @@ using seconds_d64 = std::chrono::duration<double>; const std::string AppName{"alffplay"}; -bool EnableDirectOut{false}; +ALenum DirectOutMode{AL_FALSE}; bool EnableWideStereo{false}; bool DisableVideo{false}; LPALGETSOURCEI64VSOFT alGetSourcei64vSOFT; @@ -1008,8 +1008,8 @@ int AudioState::handler() alGenBuffers(static_cast<ALsizei>(mBuffers.size()), mBuffers.data()); alGenSources(1, &mSource); - if(EnableDirectOut) - alSourcei(mSource, AL_DIRECT_CHANNELS_SOFT, AL_TRUE); + if(DirectOutMode) + alSourcei(mSource, AL_DIRECT_CHANNELS_SOFT, DirectOutMode); if (EnableWideStereo) { ALfloat angles[2] = {static_cast<ALfloat>(M_PI / 3.0), static_cast<ALfloat>(-M_PI / 3.0)}; @@ -1768,13 +1768,18 @@ int main(int argc, char *argv[]) { if(strcmp(argv[fileidx], "-direct") == 0) { - if(!alIsExtensionPresent("AL_SOFT_direct_channels")) - std::cerr<< "AL_SOFT_direct_channels not supported for direct output" <<std::endl; - else + if(alIsExtensionPresent("AL_SOFT_direct_channels_remix")) + { + std::cout<< "Found AL_SOFT_direct_channels_remix" <<std::endl; + DirectOutMode = AL_REMIX_UNMATCHED_SOFT; + } + else if(alIsExtensionPresent("AL_SOFT_direct_channels")) { std::cout<< "Found AL_SOFT_direct_channels" <<std::endl; - EnableDirectOut = true; + DirectOutMode = AL_DROP_UNMATCHED_SOFT; } + else + std::cerr<< "AL_SOFT_direct_channels not supported for direct output" <<std::endl; } else if(strcmp(argv[fileidx], "-wide") == 0) { |