Exemple #1
0
void Effect::setEnabled(bool enabled) {
    if (enabled != m_bEnabled) {
        m_bEnabled = enabled;
        updateEngineState();
        emit(enabledChanged(m_bEnabled));
    }
}
Exemple #2
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();
}
Exemple #3
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();
}
Exemple #4
0
void EffectParameter::setValue(double value) {
    // TODO(XXX) Handle inf, -inf, and nan
    m_value = value;

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

    m_value = value;

    updateEngineState();
    emit(valueChanged(m_value));
}