Ejemplo n.º 1
0
void EffectParameter::setMaximum(double maximum) {
    m_maximum = maximum;
    if (m_maximum > m_parameter.getMaximum()) {
        qWarning() << debugString() << "WARNING: Maximum value is less than plugin's absolute maximum, clamping.";
        m_maximum = m_parameter.getMaximum();
    }

    if (m_maximum < m_minimum) {
        qWarning() << debugString() << "WARNING: New maximum was below the minimum, clamped.";
        m_maximum = m_minimum;
    }

    // There's a degenerate case here where the minimum could be larger
    // than the manifest maximum. If that's the case, then the maximum
    // value is currently above the manifest maximum. Since similar
    // guards exist in the setMinimum call, this should not be able to
    // happen.
    Q_ASSERT(m_maximum <= m_parameter.getMaximum());

    if (clampValue()) {
        qWarning() << debugString() << "WARNING: Value was outside of new maximum, clamped.";
    }

    if (clampDefault()) {
        qWarning() << debugString() << "WARNING: Default was outside of new maximum, clamped.";
    }

    updateEngineState();
}
Ejemplo n.º 2
0
void EffectParameter::setDefault(double dflt) {
    m_default = dflt;

    if (clampDefault()) {
        qWarning() << debugString() << "WARNING: Default parameter value was outside of range, clamped.";
    }

    m_default = dflt;

    updateEngineState();
}