diff options
-rw-r--r-- | alc/alc.cpp | 4 | ||||
-rw-r--r-- | alc/inprogext.h | 6 | ||||
-rw-r--r-- | examples/alffplay.cpp | 19 | ||||
-rw-r--r-- | include/AL/alext.h | 6 |
4 files changed, 22 insertions, 13 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index d9578b9d..125051c8 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -782,6 +782,9 @@ constexpr struct { DECL(AL_EVENT_TYPE_ERROR_SOFT), DECL(AL_EVENT_TYPE_PERFORMANCE_SOFT), DECL(AL_EVENT_TYPE_DEPRECATED_SOFT), + + DECL(AL_DROP_UNMATCHED_SOFT), + DECL(AL_REMIX_UNMATCHED_SOFT), }; #undef DECL @@ -829,6 +832,7 @@ constexpr ALchar alExtList[] = "AL_SOFT_block_alignment " "AL_SOFT_deferred_updates " "AL_SOFT_direct_channels " + "AL_SOFT_direct_channels_remix " "AL_SOFTX_effect_chain " "AL_SOFTX_events " "AL_SOFTX_filter_gain_ex " diff --git a/alc/inprogext.h b/alc/inprogext.h index 17638e52..d1890e70 100644 --- a/alc/inprogext.h +++ b/alc/inprogext.h @@ -92,12 +92,6 @@ AL_API void AL_APIENTRY alGetPointervSOFT(ALenum pname, void **values); #define AL_N3D_SOFT 0x0002 #endif -#ifndef AL_SOFT_direct_channels_remix -#define AL_SOFT_direct_channels_remix -#define AL_DROP_UNMATCHED_SOFT 0x0001 -#define AL_REMIX_UNMATCHED_SOFT 0x0002 -#endif - #ifdef __cplusplus } /* extern "C" */ #endif 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) { diff --git a/include/AL/alext.h b/include/AL/alext.h index cd7f2750..1979baa2 100644 --- a/include/AL/alext.h +++ b/include/AL/alext.h @@ -509,6 +509,12 @@ ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname, #endif #endif +#ifndef AL_SOFT_direct_channels_remix +#define AL_SOFT_direct_channels_remix 1 +#define AL_DROP_UNMATCHED_SOFT 0x0001 +#define AL_REMIX_UNMATCHED_SOFT 0x0002 +#endif + #ifdef __cplusplus } #endif |