summaryrefslogtreecommitdiff
path: root/dgedit/player.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-15 13:06:28 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-15 13:06:28 +0200
commit4aa5b796ba7186892d14e20226d6cef942d0c60d (patch)
treefc4613b4983dd4f1ae1eaa95fe702475fe87fc19 /dgedit/player.cc
parentb16d0b91acba045026fdeab6f9cd43ef9bd7d2c3 (diff)
Added updatePeakDB. Fixed setGainDB (it was reverse).
Diffstat (limited to 'dgedit/player.cc')
-rw-r--r--dgedit/player.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/dgedit/player.cc b/dgedit/player.cc
index a7f09c3..cb6b986 100644
--- a/dgedit/player.cc
+++ b/dgedit/player.cc
@@ -88,17 +88,18 @@ void Player::run()
void Player::setGainScalar(double g)
{
- gain_scalar = g / 10000.0;
+ gain_scalar = g;
}
void Player::setGainDB(double gain_db)
{
- setGainScalar(20*log10(gain_db));
+ setGainScalar(pow(10, gain_db/ 20.0));
}
void Player::reportTimeout()
{
emit peakUpdate(peak);
+ emit peakUpdateDB(20 * log10(peak));
peak = 0.0;
emit positionUpdate(pos);