diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alc.cpp | 40 | ||||
-rw-r--r-- | Alc/alu.cpp | 7 | ||||
-rw-r--r-- | Alc/hrtf.cpp | 74 | ||||
-rw-r--r-- | Alc/hrtf.h | 14 | ||||
-rw-r--r-- | Alc/mixvoice.cpp | 2 | ||||
-rw-r--r-- | Alc/panning.cpp | 20 |
6 files changed, 78 insertions, 79 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 5b6d3bb3..cbd586b8 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -122,7 +122,7 @@ struct BackendInfo { BackendFactory& (*getFactory)(void); }; -struct BackendInfo BackendList[] = { +BackendInfo BackendList[] = { #ifdef HAVE_JACK { "jack", JackBackendFactory::getFactory }, #endif @@ -173,8 +173,8 @@ struct BackendInfo BackendList[] = { }; ALsizei BackendListSize = static_cast<ALsizei>(COUNTOF(BackendList)); -struct BackendInfo PlaybackBackend; -struct BackendInfo CaptureBackend; +BackendInfo PlaybackBackend; +BackendInfo CaptureBackend; /************************************************ @@ -1087,7 +1087,7 @@ static void alc_initconfig(void) } else { - struct BackendInfo Bkp = BackendList[n]; + BackendInfo Bkp = BackendList[n]; for(;n > i;n--) BackendList[n] = BackendList[n-1]; BackendList[n] = Bkp; @@ -1167,7 +1167,7 @@ static void alc_initconfig(void) /************************************************ * Device enumeration ************************************************/ -static void ProbeDevices(std::string *list, struct BackendInfo *backendinfo, enum DevProbe type) +static void ProbeDevices(std::string *list, BackendInfo *backendinfo, enum DevProbe type) { DO_INITCONFIG(); @@ -1550,7 +1550,7 @@ static void alcSetError(ALCdevice *device, ALCenum errorCode) } -static struct Compressor *CreateDeviceLimiter(const ALCdevice *device, const ALfloat threshold) +static Compressor *CreateDeviceLimiter(const ALCdevice *device, const ALfloat threshold) { return CompressorInit(device->RealOut.NumChannels, device->Frequency, AL_TRUE, AL_TRUE, AL_TRUE, AL_TRUE, AL_TRUE, 0.001f, 0.002f, @@ -1849,7 +1849,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if(hrtf_userreq == Hrtf_Enable || (hrtf_userreq != Hrtf_Disable && hrtf_appreq == Hrtf_Enable)) { - struct Hrtf *hrtf = nullptr; + HrtfEntry *hrtf{nullptr}; if(device->HrtfList.empty()) device->HrtfList = EnumerateHrtf(device->DeviceName.c_str()); if(!device->HrtfList.empty()) @@ -1865,9 +1865,9 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->FmtChans = DevFmtStereo; device->Frequency = hrtf->sampleRate; device->Flags |= DEVICE_CHANNELS_REQUEST | DEVICE_FREQUENCY_REQUEST; - if(device->HrtfHandle) - Hrtf_DecRef(device->HrtfHandle); - device->HrtfHandle = hrtf; + if(device->mHrtf) + Hrtf_DecRef(device->mHrtf); + device->mHrtf = hrtf; } else { @@ -2225,9 +2225,9 @@ ALCdevice_struct::~ALCdevice_struct() if(count > 0) WARN(SZFMT " Filter%s not deleted\n", count, (count==1)?"":"s"); - if(HrtfHandle) - Hrtf_DecRef(HrtfHandle); - HrtfHandle = nullptr; + if(mHrtf) + Hrtf_DecRef(mHrtf); + mHrtf = nullptr; } @@ -2322,20 +2322,20 @@ ALCcontext_struct::ALCcontext_struct(ALCdevice *device) static ALvoid InitContext(ALCcontext *Context) { ALlistener &listener = Context->Listener; - struct ALeffectslotArray *auxslots; + ALeffectslotArray *auxslots; //Validate Context if(Context->DefaultSlot) { auxslots = static_cast<ALeffectslotArray*>(al_calloc(DEF_ALIGN, - FAM_SIZE(struct ALeffectslotArray, slot, 1))); + FAM_SIZE(ALeffectslotArray, slot, 1))); auxslots->count = 1; auxslots->slot[0] = Context->DefaultSlot.get(); } else { auxslots = static_cast<ALeffectslotArray*>(al_calloc(DEF_ALIGN, - sizeof(struct ALeffectslotArray))); + sizeof(ALeffectslotArray))); auxslots->count = 0; } Context->ActiveAuxSlots.store(auxslots, std::memory_order_relaxed); @@ -2824,7 +2824,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *Device, ALCenum para else { std::lock_guard<std::mutex> _{dev->BackendLock}; - value = (dev->HrtfHandle ? dev->HrtfName.c_str() : ""); + value = (dev->mHrtf ? dev->HrtfName.c_str() : ""); } break; @@ -3009,7 +3009,7 @@ static ALCsizei GetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALC values[i++] = device->NumAuxSends; values[i++] = ALC_HRTF_SOFT; - values[i++] = (device->HrtfHandle ? ALC_TRUE : ALC_FALSE); + values[i++] = (device->mHrtf ? ALC_TRUE : ALC_FALSE); values[i++] = ALC_HRTF_STATUS_SOFT; values[i++] = device->HrtfStatus; @@ -3128,7 +3128,7 @@ static ALCsizei GetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALC return 1; case ALC_HRTF_SOFT: - values[0] = (device->HrtfHandle ? ALC_TRUE : ALC_FALSE); + values[0] = (device->mHrtf ? ALC_TRUE : ALC_FALSE); return 1; case ALC_HRTF_STATUS_SOFT: @@ -3239,7 +3239,7 @@ ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname, values[i++] = dev->NumAuxSends; values[i++] = ALC_HRTF_SOFT; - values[i++] = (dev->HrtfHandle ? ALC_TRUE : ALC_FALSE); + values[i++] = (dev->mHrtf ? ALC_TRUE : ALC_FALSE); values[i++] = ALC_HRTF_STATUS_SOFT; values[i++] = dev->HrtfStatus; diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 92502eee..419334d5 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -202,7 +202,7 @@ void DeinitVoice(ALvoice *voice) noexcept void aluSelectPostProcess(ALCdevice *device) { - if(device->HrtfHandle) + if(device->mHrtf) device->PostProcess = ProcessHrtf; else if(device->AmbiDecoder) device->PostProcess = ProcessAmbiDec; @@ -730,7 +730,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev /* Get the HRIR coefficients and delays just once, for the given * source direction. */ - GetHrtfCoeffs(Device->HrtfHandle, Elev, Azi, Spread, + GetHrtfCoeffs(Device->mHrtf, Elev, Azi, Spread, voice->Direct.Params[0].Hrtf.Target.Coeffs, voice->Direct.Params[0].Hrtf.Target.Delay); voice->Direct.Params[0].Hrtf.Target.Gain = DryGain * downmix_gain; @@ -777,8 +777,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev /* Get the HRIR coefficients and delays for this channel * position. */ - GetHrtfCoeffs(Device->HrtfHandle, - chans[c].elevation, chans[c].angle, Spread, + GetHrtfCoeffs(Device->mHrtf, chans[c].elevation, chans[c].angle, Spread, voice->Direct.Params[c].Hrtf.Target.Coeffs, voice->Direct.Params[c].Hrtf.Target.Delay ); diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp index f5613f5b..1995119a 100644 --- a/Alc/hrtf.cpp +++ b/Alc/hrtf.cpp @@ -43,8 +43,8 @@ #include "almalloc.h" -struct HrtfEntry { - Hrtf *handle{nullptr}; +struct HrtfHandle { + HrtfEntry *entry{nullptr}; char filename[]; DEF_PLACE_NEWDEL() @@ -52,7 +52,7 @@ struct HrtfEntry { namespace { -using HrtfEntryPtr = std::unique_ptr<HrtfEntry>; +using HrtfHandlePtr = std::unique_ptr<HrtfHandle>; /* Current data set limits defined by the makehrtf utility. */ #define MIN_IR_SIZE (8) @@ -82,7 +82,7 @@ constexpr ALchar magicMarker02[8]{'M','i','n','P','H','R','0','2'}; constexpr ALfloat PassthruCoeff{0.707106781187f/*sqrt(0.5)*/}; std::mutex LoadedHrtfLock; -al::vector<HrtfEntryPtr> LoadedHrtfs; +al::vector<HrtfHandlePtr> LoadedHrtfs; class databuf final : public std::streambuf { @@ -185,7 +185,7 @@ ALsizei CalcAzIndex(ALsizei azcount, ALfloat az, ALfloat *mu) /* Calculates static HRIR coefficients and delays for the given polar elevation * and azimuth in radians. The coefficients are normalized. */ -void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, +void GetHrtfCoeffs(const HrtfEntry *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat (*RESTRICT coeffs)[2], ALsizei *delays) { const ALfloat dirfact{1.0f - (spread / F_TAU)}; @@ -273,7 +273,7 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, } -void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_COEFFS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain) +void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_COEFFS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain) { static constexpr int OrderFromChan[MAX_AMBI_COEFFS]{ 0, 1,1,1, 2,2,2,2,2, 3,3,3,3,3,3,3, @@ -413,14 +413,14 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, const ALs namespace { -struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize, ALfloat distance, ALsizei evCount, +HrtfEntry *CreateHrtfStore(ALuint rate, ALsizei irSize, ALfloat distance, ALsizei evCount, ALsizei irCount, const ALubyte *azCount, const ALushort *evOffset, const ALfloat (*coeffs)[2], const ALubyte (*delays)[2], const char *filename) { - struct Hrtf *Hrtf; + HrtfEntry *Hrtf; size_t total; - total = sizeof(struct Hrtf); + total = sizeof(HrtfEntry); total += sizeof(Hrtf->azCount[0])*evCount; total = RoundUp(total, sizeof(ALushort)); /* Align for ushort fields */ total += sizeof(Hrtf->evOffset[0])*evCount; @@ -428,12 +428,12 @@ struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize, ALfloat distance, ALsi total += sizeof(Hrtf->coeffs[0])*irSize*irCount; total += sizeof(Hrtf->delays[0])*irCount; - Hrtf = static_cast<struct Hrtf*>(al_calloc(16, total)); + Hrtf = static_cast<HrtfEntry*>(al_calloc(16, total)); if(Hrtf == nullptr) ERR("Out of memory allocating storage for %s.\n", filename); else { - uintptr_t offset = sizeof(struct Hrtf); + uintptr_t offset = sizeof(HrtfEntry); char *base = (char*)Hrtf; ALushort *_evOffset; ALubyte *_azCount; @@ -524,7 +524,7 @@ ALuint GetLE_ALuint(std::istream &data) return ret; } -struct Hrtf *LoadHrtf00(std::istream &data, const char *filename) +HrtfEntry *LoadHrtf00(std::istream &data, const char *filename) { ALuint rate{GetLE_ALuint(data)}; ALushort irCount{GetLE_ALushort(data)}; @@ -642,7 +642,7 @@ struct Hrtf *LoadHrtf00(std::istream &data, const char *filename) &reinterpret_cast<ALubyte(&)[2]>(delays[0]), filename); } -struct Hrtf *LoadHrtf01(std::istream &data, const char *filename) +HrtfEntry *LoadHrtf01(std::istream &data, const char *filename) { ALuint rate{GetLE_ALuint(data)}; ALushort irSize{GetLE_ALubyte(data)}; @@ -746,7 +746,7 @@ struct Hrtf *LoadHrtf01(std::istream &data, const char *filename) #define CHANTYPE_LEFTONLY 0 #define CHANTYPE_LEFTRIGHT 1 -struct Hrtf *LoadHrtf02(std::istream &data, const char *filename) +HrtfEntry *LoadHrtf02(std::istream &data, const char *filename) { ALuint rate{GetLE_ALuint(data)}; ALubyte sampleType{GetLE_ALubyte(data)}; @@ -982,9 +982,9 @@ void AddFileEntry(al::vector<EnumeratedHrtf> &list, const std::string &filename) { TRACE("Got new file \"%s\"\n", filename.c_str()); - LoadedHrtfs.emplace_back(HrtfEntryPtr{new - (al_calloc(DEF_ALIGN, FAM_SIZE(HrtfEntry, filename, filename.length()+1))) - HrtfEntry{}}); + LoadedHrtfs.emplace_back(HrtfHandlePtr{new + (al_calloc(DEF_ALIGN, FAM_SIZE(HrtfHandle, filename, filename.length()+1))) + HrtfHandle{}}); loaded_entry = LoadedHrtfs.end()-1; strcpy((*loaded_entry)->filename, filename.c_str()); } @@ -1044,9 +1044,9 @@ void AddBuiltInEntry(al::vector<EnumeratedHrtf> &list, const std::string &filena TRACE("Got new file \"%s\"\n", filename.c_str()); - LoadedHrtfs.emplace_back(HrtfEntryPtr{new - (al_calloc(DEF_ALIGN, FAM_SIZE(HrtfEntry, filename, namelen))) - HrtfEntry{}}); + LoadedHrtfs.emplace_back(HrtfHandlePtr{new + (al_calloc(DEF_ALIGN, FAM_SIZE(HrtfHandle, filename, namelen))) + HrtfHandle{}}); loaded_entry = LoadedHrtfs.end()-1; snprintf((*loaded_entry)->filename, namelen, "!%u_%s", residx, filename.c_str()); @@ -1172,13 +1172,13 @@ al::vector<EnumeratedHrtf> EnumerateHrtf(const char *devname) return list; } -struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry) +HrtfEntry *GetLoadedHrtf(HrtfHandle *handle) { std::lock_guard<std::mutex> _{LoadedHrtfLock}; - if(entry->handle) + if(handle->entry) { - Hrtf *hrtf{entry->handle}; + HrtfEntry *hrtf{handle->entry}; Hrtf_IncRef(hrtf); return hrtf; } @@ -1187,9 +1187,9 @@ struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry) const char *name{""}; ALuint residx{}; char ch{}; - if(sscanf(entry->filename, "!%u%c", &residx, &ch) == 2 && ch == '_') + if(sscanf(handle->filename, "!%u%c", &residx, &ch) == 2 && ch == '_') { - name = strchr(entry->filename, ch)+1; + name = strchr(handle->filename, ch)+1; TRACE("Loading %s...\n", name); ResData res{GetResource(residx)}; @@ -1202,19 +1202,19 @@ struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry) } else { - name = entry->filename; + name = handle->filename; - TRACE("Loading %s...\n", entry->filename); - std::unique_ptr<al::ifstream> fstr{new al::ifstream{entry->filename, std::ios::binary}}; + TRACE("Loading %s...\n", handle->filename); + std::unique_ptr<al::ifstream> fstr{new al::ifstream{handle->filename, std::ios::binary}}; if(!fstr->is_open()) { - ERR("Could not open %s\n", entry->filename); + ERR("Could not open %s\n", handle->filename); return nullptr; } stream = std::move(fstr); } - Hrtf *hrtf{}; + HrtfEntry *hrtf{nullptr}; char magic[sizeof(magicMarker02)]; stream->read(magic, sizeof(magic)); if(stream->gcount() < static_cast<std::streamsize>(sizeof(magicMarker02))) @@ -1242,7 +1242,7 @@ struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry) ERR("Failed to load %s\n", name); else { - entry->handle = hrtf; + handle->entry = hrtf; Hrtf_IncRef(hrtf); TRACE("Loaded HRTF support for format: %s %uhz\n", DevFmtChannelsString(DevFmtStereo), hrtf->sampleRate); @@ -1252,13 +1252,13 @@ struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry) } -void Hrtf_IncRef(struct Hrtf *hrtf) +void Hrtf_IncRef(HrtfEntry *hrtf) { auto ref = IncrementRef(&hrtf->ref); TRACEREF("%p increasing refcount to %u\n", hrtf, ref); } -void Hrtf_DecRef(struct Hrtf *hrtf) +void Hrtf_DecRef(HrtfEntry *hrtf) { auto ref = DecrementRef(&hrtf->ref); TRACEREF("%p decreasing refcount to %u\n", hrtf, ref); @@ -1271,13 +1271,13 @@ void Hrtf_DecRef(struct Hrtf *hrtf) * before the lock was taken. */ auto iter = std::find_if(LoadedHrtfs.begin(), LoadedHrtfs.end(), - [hrtf](const HrtfEntryPtr &entry) noexcept -> bool - { return hrtf == entry->handle; } + [hrtf](const HrtfHandlePtr &entry) noexcept -> bool + { return hrtf == entry->entry; } ); if(iter != LoadedHrtfs.end() && ReadRef(&hrtf->ref) == 0) { - al_free((*iter)->handle); - (*iter)->handle = nullptr; + al_free((*iter)->entry); + (*iter)->entry = nullptr; TRACE("Unloaded unused HRTF %s\n", (*iter)->filename); } } @@ -19,9 +19,9 @@ #define HRIR_MASK (HRIR_LENGTH-1) -struct HrtfEntry; +struct HrtfHandle; -struct Hrtf { +struct HrtfEntry { RefCount ref; ALuint sampleRate; @@ -69,11 +69,11 @@ struct AngularPoint { al::vector<EnumeratedHrtf> EnumerateHrtf(const char *devname); -struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry); -void Hrtf_IncRef(struct Hrtf *hrtf); -void Hrtf_DecRef(struct Hrtf *hrtf); +HrtfEntry *GetLoadedHrtf(HrtfHandle *handle); +void Hrtf_IncRef(HrtfEntry *hrtf); +void Hrtf_DecRef(HrtfEntry *hrtf); -void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat (*RESTRICT coeffs)[2], ALsizei *delays); +void GetHrtfCoeffs(const HrtfEntry *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat (*RESTRICT coeffs)[2], ALsizei *delays); /** * Produces HRTF filter coefficients for decoding B-Format, given a set of @@ -82,6 +82,6 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, * ordered and scaled according to the matrix input. Note the specified virtual * positions should be in degrees, not radians! */ -void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_COEFFS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain); +void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_COEFFS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain); #endif /* ALC_HRTF_H */ diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp index f43ae127..db2609f5 100644 --- a/Alc/mixvoice.cpp +++ b/Alc/mixvoice.cpp @@ -310,7 +310,7 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize ASSUME(increment > 0); ALCdevice *Device{Context->Device}; - ALsizei IrSize{Device->HrtfHandle ? Device->HrtfHandle->irSize : 0}; + ALsizei IrSize{Device->mHrtf ? Device->mHrtf->irSize : 0}; ResamplerFunc Resample{(increment == FRACTIONONE && DataPosFrac == 0) ? Resample_copy_C : voice->Resampler}; diff --git a/Alc/panning.cpp b/Alc/panning.cpp index e4a9d787..f15c086e 100644 --- a/Alc/panning.cpp +++ b/Alc/panning.cpp @@ -715,12 +715,12 @@ void InitHrtfPanning(ALCdevice *device) device->RealOut.NumChannels = device->channelsFromFmt(); - BuildBFormatHrtf(device->HrtfHandle, + BuildBFormatHrtf(device->mHrtf, device->mHrtfState.get(), device->Dry.NumChannels, AmbiPoints, AmbiMatrix, static_cast<ALsizei>(COUNTOF(AmbiPoints)), AmbiOrderHFGain ); - InitNearFieldCtrl(device, device->HrtfHandle->distance, device->AmbiUp ? 2 : 1, + InitNearFieldCtrl(device, device->mHrtf->distance, device->AmbiUp ? 2 : 1, ChansPerOrder); } @@ -871,10 +871,10 @@ void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, con void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appreq, HrtfRequestMode hrtf_userreq) { /* Hold the HRTF the device last used, in case it's used again. */ - Hrtf *old_hrtf{device->HrtfHandle}; + HrtfEntry *old_hrtf{device->mHrtf}; device->mHrtfState = nullptr; - device->HrtfHandle = nullptr; + device->mHrtf = nullptr; device->HrtfName.clear(); device->Render_Mode = NormalRender; @@ -1026,35 +1026,35 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appr if(hrtf_id >= 0 && (size_t)hrtf_id < device->HrtfList.size()) { const EnumeratedHrtf &entry = device->HrtfList[hrtf_id]; - Hrtf *hrtf{GetLoadedHrtf(entry.hrtf)}; + HrtfEntry *hrtf{GetLoadedHrtf(entry.hrtf)}; if(hrtf && hrtf->sampleRate == device->Frequency) { - device->HrtfHandle = hrtf; + device->mHrtf = hrtf; device->HrtfName = entry.name; } else if(hrtf) Hrtf_DecRef(hrtf); } - if(!device->HrtfHandle) + if(!device->mHrtf) { auto find_hrtf = [device](const EnumeratedHrtf &entry) -> bool { - Hrtf *hrtf{GetLoadedHrtf(entry.hrtf)}; + HrtfEntry *hrtf{GetLoadedHrtf(entry.hrtf)}; if(!hrtf) return false; if(hrtf->sampleRate != device->Frequency) { Hrtf_DecRef(hrtf); return false; } - device->HrtfHandle = hrtf; + device->mHrtf = hrtf; device->HrtfName = entry.name; return true; }; std::find_if(device->HrtfList.cbegin(), device->HrtfList.cend(), find_hrtf); } - if(device->HrtfHandle) + if(device->mHrtf) { if(old_hrtf) Hrtf_DecRef(old_hrtf); |