Пример #1
0
double Coeff(int *pt, int di, double shift, myCSField sf) {
    double x[sf->d];
    getPoint(pt, x, sf);
    x[di] += shift;
    /* double xx=0.5; */
    /* printf("x=%.12f, field=%f\n", xx, CalcCoeff(&xx, sf)); */
    /* assert(0); */
    return CalcCoeff(x, sf);
}
int
EAP_MultibandDrcControlInt32_UpdateLimiterRelease(
    const EAP_MultibandDrcControlInt32 *instance,
    EAP_MdrcInternalEventLimiterReleaseCoeffInt32 *event, float releaseTimeMs)
{
  event->common.type = UpdateLimiterRelease;
  event->coeff = CalcCoeff(releaseTimeMs, instance->m_sampleRate);

  return 0;
}
int
EAP_MultibandDrcControlInt32_UpdateLimiterAttack(
    const EAP_MultibandDrcControlInt32 *instance,
    EAP_MdrcInternalEventLimiterAttackCoeffInt32 *event, float attackTimeMs)
{
  event->common.type = UpdateLimiterAttack;
  event->coeff = CalcCoeff(attackTimeMs, instance->m_sampleRate);

  return 0;
}
int
EAP_MultibandDrcControlInt32_UpdateCompanderRelease(
    const EAP_MultibandDrcControlInt32 *instance,
    EAP_MdrcInternalEventCompanderReleaseCoeffInt32 *event,
    float releaseTimeMs, int band)
{
  event->common.type = UpdateCompanderRelease;

  if (band >= 0 && instance->m_bandCount > band)
  {
    event->band = band;
    event->coeff =
        CalcCoeff(releaseTimeMs,
                  instance->m_sampleRate * 0.5 * instance->m_oneOverFactor);

    return 0;
  }

  return -1;
}