From 29a27053cd60e213c1fe45bbfdffd1d56c41e93e Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Mon, 18 Feb 2008 14:49:14 +0000 Subject: [PATCH] qualitymapperdialog.cpp \ util.cpp: - updated updateXQualityLabel and relative2QualityValf methods - added call to updateXQualityLabel at xSpinbox value change --- src/fgt/edit_quality/qualitymapperdialog.cpp | 4 +++- src/fgt/edit_quality/util.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fgt/edit_quality/qualitymapperdialog.cpp b/src/fgt/edit_quality/qualitymapperdialog.cpp index d446414d3..b6e888fb3 100644 --- a/src/fgt/edit_quality/qualitymapperdialog.cpp +++ b/src/fgt/edit_quality/qualitymapperdialog.cpp @@ -1094,6 +1094,8 @@ void QualityMapperDialog::on_xSpinBox_valueChanged(double newX) this->manageBorderTfHandles(_currentTfHandle); //restoring the correct order for TfHandles (they're drawn in the same order as they're stored) this->updateTfHandlesOrder(_currentTfHandle->getChannel()); + //updating x-quality Label + this->updateXQualityLabel(_currentTfHandle->getRelativeX()); //refresh of TF this->drawTransferFunction(); } @@ -1255,7 +1257,7 @@ void QualityMapperDialog::on_TF_view_doubleClicked(QPointF pos) void QualityMapperDialog::updateXQualityLabel(float xPos) { - float exp = log10(0.5f) / log10((float)_equalizerMidHandlePercentilePosition); + float exp = log10((float)_equalizerMidHandlePercentilePosition) / log10(0.5f); _currentTfHandleQualityValue.setNum(relative2QualityValf(xPos, ui.minSpinBox->value(), ui.maxSpinBox->value(), exp)); ui.xQualityLabel->setText(_currentTfHandleQualityValue); } diff --git a/src/fgt/edit_quality/util.cpp b/src/fgt/edit_quality/util.cpp index a7d3a590a..1422f7239 100644 --- a/src/fgt/edit_quality/util.cpp +++ b/src/fgt/edit_quality/util.cpp @@ -20,7 +20,7 @@ int absolute2RelativeVali(float absolute_val, float max_val) float relative2QualityValf(float relative_val, float min_q, float max_q, float exp) { assert( (relative_val>=-1.0f) && (relative_val<=2.0f) ); - assert( (exp>=0) && (exp<=1) ); +// assert( (exp>=0) && (exp<=1) ); assert(min_q<=max_q); relative_val = pow( relative_val, exp ); return ( relative_val * (max_q - min_q) ) + min_q;