Make the new direct channel remix extension public

This commit is contained in:
Chris Robinson 2019-12-28 16:40:10 -08:00
parent 701d43b41e
commit 137394c2cf
4 changed files with 22 additions and 13 deletions

View File

@ -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 "

View File

@ -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

View File

@ -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)
{

View File

@ -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