Mercurial > hg > svgui
comparison widgets/LevelPanWidget.cpp @ 1201:a68c25ba1153 levelpanwidget
Fix incorrect initial display levels in LevelPanWidget
author | Chris Cannam |
---|---|
date | Fri, 16 Dec 2016 19:35:57 +0000 |
parents | 91aac85406fb |
children | 8ef67917c301 |
comparison
equal
deleted
inserted
replaced
1200:808d375a3b12 | 1201:a68c25ba1153 |
---|---|
41 m_monitorRight(-1), | 41 m_monitorRight(-1), |
42 m_editable(true), | 42 m_editable(true), |
43 m_includeMute(true) | 43 m_includeMute(true) |
44 { | 44 { |
45 setToolTip(tr("Drag vertically to adjust level, horizontally to adjust pan")); | 45 setToolTip(tr("Drag vertically to adjust level, horizontally to adjust pan")); |
46 setLevel(1.0); | |
47 setPan(0.0); | |
46 } | 48 } |
47 | 49 |
48 LevelPanWidget::~LevelPanWidget() | 50 LevelPanWidget::~LevelPanWidget() |
49 { | 51 { |
50 } | 52 } |
122 } | 124 } |
123 | 125 |
124 float | 126 float |
125 LevelPanWidget::getLevel() const | 127 LevelPanWidget::getLevel() const |
126 { | 128 { |
127 return levelToAudioLevel(m_level, m_includeMute); | 129 float flevel = levelToAudioLevel(m_level, m_includeMute); |
130 return flevel; | |
128 } | 131 } |
129 | 132 |
130 int | 133 int |
131 LevelPanWidget::audioPanToPan(float audioPan) | 134 LevelPanWidget::audioPanToPan(float audioPan) |
132 { | 135 { |
194 } | 197 } |
195 | 198 |
196 void | 199 void |
197 LevelPanWidget::emitLevelChanged() | 200 LevelPanWidget::emitLevelChanged() |
198 { | 201 { |
199 cerr << "emitting levelChanged(" << getLevel() << ")" << endl; | |
200 emit levelChanged(getLevel()); | 202 emit levelChanged(getLevel()); |
201 } | 203 } |
202 | 204 |
203 void | 205 void |
204 LevelPanWidget::emitPanChanged() | 206 LevelPanWidget::emitPanChanged() |
205 { | 207 { |
206 cerr << "emitting panChanged(" << getPan() << ")" << endl; | |
207 emit panChanged(getPan()); | 208 emit panChanged(getPan()); |
208 } | 209 } |
209 | 210 |
210 void | 211 void |
211 LevelPanWidget::mousePressEvent(QMouseEvent *e) | 212 LevelPanWidget::mousePressEvent(QMouseEvent *e) |