diff options
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++])); |