| 89 | } |
| 90 | |
| 91 | float ClientCompCurveWidget::curveOutputDb(float inDb) const |
| 92 | { |
| 93 | if (!m_comp) return inDb; |
| 94 | const float T = m_comp->thresholdDb(); |
| 95 | const float W = m_comp->kneeDb(); |
| 96 | const float ratio = std::max(1.0f, m_comp->ratio()); |
| 97 | const float slope = 1.0f - 1.0f / ratio; // 0 = unity, 1 = limit |
| 98 | const float over = inDb - T; |
| 99 | |
| 100 | float gain; |
| 101 | if (W <= 0.0f) { |
| 102 | gain = (over > 0.0f) ? -over * slope : 0.0f; |
| 103 | } else if (over <= -0.5f * W) { |
| 104 | gain = 0.0f; |
| 105 | } else if (over >= 0.5f * W) { |
| 106 | gain = -over * slope; |
| 107 | } else { |
| 108 | const float x = over + 0.5f * W; |
| 109 | gain = -slope * (x * x) / (2.0f * W); |
| 110 | } |
| 111 | return inDb + gain + m_comp->makeupDb(); |
| 112 | } |
| 113 | |
| 114 | void ClientCompCurveWidget::paintEvent(QPaintEvent*) |
| 115 | { |
nothing calls this directly
no test coverage detected