MCPcopy Create free account
hub / github.com/ValveSoftware/steam-audio / CHRTF

Method CHRTF

core/src/core/api_hrtf.cpp:34–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32// --------------------------------------------------------------------------------------------------------------------
33
34CHRTF::CHRTF(CContext* context,
35 IPLAudioSettings* audioSettings,
36 IPLHRTFSettings* hrtfSettings)
37{
38 auto _context = context->mHandle.get();
39 if (!_context)
40 throw Exception(Status::Failure);
41
42 HRTFSettings _hrtfSettings{};
43 _hrtfSettings.type = static_cast<HRTFMapType>(hrtfSettings->type);
44 _hrtfSettings.sofaFileName = hrtfSettings->sofaFileName;
45
46 if (Context::isCallerAPIVersionAtLeast(4, 2))
47 {
48 _hrtfSettings.sofaData = hrtfSettings->sofaData;
49 _hrtfSettings.sofaDataSize = hrtfSettings->sofaDataSize;
50 _hrtfSettings.volume = Loudness::gainToDB(hrtfSettings->volume);
51 }
52
53 if (Context::isCallerAPIVersionAtLeast(4, 3))
54 {
55 _hrtfSettings.normType = static_cast<HRTFNormType>(hrtfSettings->normType);
56 }
57
58 new (&mHandle) Handle<HRTFDatabase>(ipl::make_shared<HRTFDatabase>(_hrtfSettings, audioSettings->samplingRate, audioSettings->frameSize), _context);
59}
60
61IHRTF* CHRTF::retain()
62{

Callers

nothing calls this directly

Calls 2

ExceptionClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected