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

Method CPathEffect

core/src/core/api_path_effect.cpp:55–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55CPathEffect::CPathEffect(CContext* context,
56 IPLAudioSettings* audioSettings,
57 IPLPathEffectSettings* effectSettings)
58{
59 auto _context = context->mHandle.get();
60 if (!_context)
61 throw Exception(Status::Failure);
62
63 AudioSettings _audioSettings{};
64 _audioSettings.samplingRate = audioSettings->samplingRate;
65 _audioSettings.frameSize = audioSettings->frameSize;
66
67 SpeakerLayout _speakerLayout{};
68
69 PathEffectSettings _effectSettings{};
70 _effectSettings.maxOrder = effectSettings->maxOrder;
71
72 if (Context::isCallerAPIVersionAtLeast(4, 4))
73 {
74 _effectSettings.spatialize = (effectSettings->spatialize == IPL_TRUE);
75
76 _speakerLayout = SpeakerLayout(static_cast<SpeakerLayoutType>(effectSettings->speakerLayout.type),
77 effectSettings->speakerLayout.numSpeakers,
78 reinterpret_cast<Vector3f*>(effectSettings->speakerLayout.speakers));
79
80 _effectSettings.speakerLayout = &_speakerLayout;
81
82 _effectSettings.hrtf = effectSettings->hrtf ? reinterpret_cast<CHRTF*>(effectSettings->hrtf)->mHandle.get().get() : nullptr;
83 }
84
85 new (&mHandle) Handle<PathEffect>(ipl::make_shared<PathEffect>(_audioSettings, _effectSettings), _context);
86}
87
88IPathEffect* CPathEffect::retain()
89{

Callers

nothing calls this directly

Calls 3

ExceptionClass · 0.85
SpeakerLayoutClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected