MCPcopy Create free account
hub / github.com/LabSound/LabSound / gain

Method gain

src/internal/src/Distance.cpp:20–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20double DistanceEffect::gain(double distance)
21{
22 // don't go beyond maximum distance
23 distance = min(distance, m_maxDistance);
24
25 // if clamped, don't get closer than reference distance
26 if (m_isClamped)
27 distance = max(distance, m_refDistance);
28
29 switch (m_model)
30 {
31 default:
32 case ModelLinear:
33 return linearGain(distance);
34 case ModelInverse:
35 return inverseGain(distance);
36 case ModelExponential:
37 return exponentialGain(distance);
38 }
39 ASSERT_NOT_REACHED();
40 return 0.0;
41}
42
43double DistanceEffect::linearGain(double distance)
44{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected