diff options
-rw-r--r-- | alc/alc.cpp | 12 | ||||
-rw-r--r-- | alc/panning.cpp | 10 | ||||
-rw-r--r-- | core/device.h | 6 |
3 files changed, 15 insertions, 13 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index f6bbcb59..c71d84ae 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1755,10 +1755,10 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) else if(device->FmtChans == DevFmtStereo) { if(opthrtf) - stereomode = *opthrtf ? StereoEncoding::Hrtf : StereoEncoding::Normal; + stereomode = *opthrtf ? StereoEncoding::Hrtf : StereoEncoding::Default; if(outmode == ALC_STEREO_BASIC_SOFT) - stereomode = StereoEncoding::Normal; + stereomode = StereoEncoding::Basic; else if(outmode == ALC_STEREO_UHJ_SOFT) stereomode = StereoEncoding::Uhj; else if(outmode == ALC_STEREO_HRTF_SOFT) @@ -1802,7 +1802,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) stereomode = StereoEncoding::Hrtf; } else - stereomode = StereoEncoding::Normal; + stereomode = StereoEncoding::Default; } using OutputMode = ALCdevice::OutputMode; @@ -1813,7 +1813,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) case OutputMode::Stereo: set_device_mode(DevFmtStereo); break; case OutputMode::StereoBasic: set_device_mode(DevFmtStereo); - stereomode = StereoEncoding::Normal; + stereomode = StereoEncoding::Basic; break; case OutputMode::Uhj2: set_device_mode(DevFmtStereo); @@ -1994,7 +1994,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) else if(al::strcasecmp(hrtf, "false") == 0) { if(!stereomode || *stereomode == StereoEncoding::Hrtf) - stereomode = StereoEncoding::Normal; + stereomode = StereoEncoding::Default; } else if(al::strcasecmp(hrtf, "auto") != 0) ERR("Unexpected hrtf value: %s\n", hrtf); @@ -2060,7 +2060,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) { const char *mode{encopt->c_str()}; if(al::strcasecmp(mode, "panpot") == 0) - stereomode = al::make_optional(StereoEncoding::Normal); + stereomode = al::make_optional(StereoEncoding::Basic); else if(al::strcasecmp(mode, "uhj") == 0) stereomode = al::make_optional(StereoEncoding::Uhj); else if(al::strcasecmp(mode, "hrtf") == 0) diff --git a/alc/panning.cpp b/alc/panning.cpp index 3431a3f9..00bf5662 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -981,11 +981,11 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, al::optional<StereoEncoding } - /* If there's no request for HRTF or UHJ and the device is headphones, or - * if HRTF is explicitly requested, try to enable it. + /* If HRTF is explicitly requested, or if there's no explicit request and + * the device is headphones, try to enable it. */ - if((!stereomode && device->Flags.test(DirectEar)) - || (stereomode && *stereomode == StereoEncoding::Hrtf)) + if(stereomode.value_or(StereoEncoding::Default) == StereoEncoding::Hrtf + || (!stereomode && device->Flags.test(DirectEar))) { if(device->mHrtfList.empty()) device->enumerateHrtfs(); @@ -1033,7 +1033,7 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, al::optional<StereoEncoding } old_hrtf = nullptr; - if(stereomode && *stereomode == StereoEncoding::Uhj) + if(stereomode.value_or(StereoEncoding::Default) == StereoEncoding::Uhj) { device->mUhjEncoder = std::make_unique<UhjEncoder>(); TRACE("UHJ enabled\n"); diff --git a/core/device.h b/core/device.h index e9596bb4..48d04f77 100644 --- a/core/device.h +++ b/core/device.h @@ -57,9 +57,11 @@ enum class RenderMode : unsigned char { }; enum class StereoEncoding : unsigned char { - Normal, + Basic, Uhj, - Hrtf + Hrtf, + + Default = Basic }; |