# HG changeset patch # User Chris Cannam # Date 1238420820 0 # Node ID c7fd7bce3c09713c2a5204518420efc4dc5a0201 # Parent 3228b7913aa44eb82ab55571f7f2875540b00572 * fix to rounding problems in plugin parameter box diff -r 3228b7913aa4 -r c7fd7bce3c09 widgets/PluginParameterBox.cpp --- a/widgets/PluginParameterBox.cpp Fri Mar 27 16:25:52 2009 +0000 +++ b/widgets/PluginParameterBox.cpp Mon Mar 30 13:47:00 2009 +0000 @@ -120,7 +120,7 @@ if (!(hint & PortHint::Logarithmic)) { if (qtz > 0.0) { - imax = int((max - min) / qtz); + imax = lrintf((max - min) / qtz); } else { qtz = (max - min) / 100.0; } @@ -258,7 +258,7 @@ newValue = min + ival * qtz; } - std::cerr << "PluginParameterBox::dialChanged: newValue = " << newValue << std::endl; +// std::cerr << "PluginParameterBox::dialChanged: newValue = " << newValue << std::endl; QDoubleSpinBox *spin = m_params[identifier].spin; if (spin) { @@ -267,6 +267,8 @@ spin->blockSignals(false); } +// std::cerr << "setting plugin parameter \"" << identifier.toStdString() << "\" to value " << newValue << std::endl; + m_plugin->setParameter(identifier.toStdString(), newValue); updateProgramCombo(); @@ -325,14 +327,14 @@ if (params.isQuantized) qtz = params.quantizeStep; if (qtz > 0.0) { - int step = int((value - min) / qtz); + int step = lrintf((value - min) / qtz); value = min + step * qtz; } int imax = 100; if (qtz > 0.0) { - imax = int((max - min) / qtz); + imax = lrintf((max - min) / qtz); } else { qtz = (max - min) / 100.0; } @@ -350,6 +352,8 @@ dial->blockSignals(false); } + std::cerr << "setting plugin parameter \"" << identifier.toStdString() << "\" to value " << value << std::endl; + m_plugin->setParameter(identifier.toStdString(), value); updateProgramCombo();