diff options
author | Chris Robinson <[email protected]> | 2017-07-01 19:18:57 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-07-01 19:18:57 -0700 |
commit | cb83f4810565169afb6af5b2a72399d27901613a (patch) | |
tree | 84c91d68178c51a577eaa891a04e9c0b5ddad89a /examples/alffplay.cpp | |
parent | a14f6510342fe68b42c1d513eb425c8beb0481d9 (diff) |
Add an option to enable direct channels for alffplay
Diffstat (limited to 'examples/alffplay.cpp')
-rw-r--r-- | examples/alffplay.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index b2033b97..56379953 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -40,6 +40,7 @@ namespace static const std::string AppName("alffplay"); +static bool do_direct_out = false; static bool has_latency_check = false; static LPALGETSOURCEDVSOFT alGetSourcedvSOFT; @@ -730,6 +731,17 @@ int AudioState::handler() alGenBuffers(AUDIO_BUFFER_QUEUE_SIZE, mBuffers); alGenSources(1, &mSource); + if(do_direct_out) + { + if(!alIsExtensionPresent("AL_SOFT_direct_channels")) + std::cerr<< "AL_SOFT_direct_channels not supported for direct output" <<std::endl; + else + { + alSourcei(mSource, AL_DIRECT_CHANNELS_SOFT, AL_TRUE); + std::cout<< "Direct out enabled" <<std::endl; + } + } + while(alGetError() == AL_NO_ERROR && !mMovie->mQuit.load()) { /* First remove any processed buffers. */ @@ -1437,6 +1449,12 @@ int main(int argc, char *argv[]) return 1; } + if(fileidx < argc && strcmp(argv[fileidx], "-direct") == 0) + { + ++fileidx; + do_direct_out = true; + } + while(fileidx < argc && !movState) { movState = std::unique_ptr<MovieState>(new MovieState(argv[fileidx++])); |