# HG changeset patch # User Chris Cannam # Date 1481916957 0 # Node ID a68c25ba1153ae20c0a387f28a7a79be243d69b2 # Parent 808d375a3b12281f78b6253ba325f8b189106762 Fix incorrect initial display levels in LevelPanWidget diff -r 808d375a3b12 -r a68c25ba1153 widgets/LevelPanWidget.cpp --- a/widgets/LevelPanWidget.cpp Fri Dec 16 16:29:53 2016 +0000 +++ b/widgets/LevelPanWidget.cpp Fri Dec 16 19:35:57 2016 +0000 @@ -43,6 +43,8 @@ m_includeMute(true) { setToolTip(tr("Drag vertically to adjust level, horizontally to adjust pan")); + setLevel(1.0); + setPan(0.0); } LevelPanWidget::~LevelPanWidget() @@ -124,7 +126,8 @@ float LevelPanWidget::getLevel() const { - return levelToAudioLevel(m_level, m_includeMute); + float flevel = levelToAudioLevel(m_level, m_includeMute); + return flevel; } int @@ -196,14 +199,12 @@ void LevelPanWidget::emitLevelChanged() { - cerr << "emitting levelChanged(" << getLevel() << ")" << endl; emit levelChanged(getLevel()); } void LevelPanWidget::emitPanChanged() { - cerr << "emitting panChanged(" << getPan() << ")" << endl; emit panChanged(getPan()); } diff -r 808d375a3b12 -r a68c25ba1153 widgets/LevelPanWidget.h --- a/widgets/LevelPanWidget.h Fri Dec 16 16:29:53 2016 +0000 +++ b/widgets/LevelPanWidget.h Fri Dec 16 19:35:57 2016 +0000 @@ -29,7 +29,8 @@ LevelPanWidget(QWidget *parent = 0); ~LevelPanWidget(); - /// Return level as a gain value in the range [0,1] + /// Return level as a gain value. The basic level range is [0,1] but the + /// gain scale may go up to 4.0 float getLevel() const; /// Return pan as a value in the range [-1,1] @@ -47,10 +48,11 @@ QSize sizeHint() const; public slots: - /// Set level in the range [0,1] -- will be rounded + /// Set level. The basic level range is [0,1] but the scale may go + /// higher. The value will be rounded. void setLevel(float); - /// Set pan in the range [-1,1] -- will be rounded + /// Set pan in the range [-1,1]. The value will be rounded void setPan(float); /// Set left and right peak monitoring levels in the range [0,1]