Mercurial > hg > svgui
diff widgets/PluginParameterBox.cpp @ 530:c7fd7bce3c09
* fix to rounding problems in plugin parameter box
author | Chris Cannam |
---|---|
date | Mon, 30 Mar 2009 13:47:00 +0000 |
parents | 4cb5cd9ccac7 |
children | 1fe7951a61e8 |
line wrap: on
line diff
--- 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();