Mercurial > hg > svgui
comparison widgets/PropertyBox.cpp @ 168:d4be66d61c04
* Make audio dial remember its more accurate mapped value as well as its
display position
* Add tool tip support to audio dial to show values
author | Chris Cannam |
---|---|
date | Tue, 17 Oct 2006 13:04:49 +0000 |
parents | 53b9c7656798 |
children | bdba24db0446 |
comparison
equal
deleted
inserted
replaced
167:53b9c7656798 | 168:d4be66d61c04 |
---|---|
179 gainDial->setMaximum(50); | 179 gainDial->setMaximum(50); |
180 gainDial->setPageStep(1); | 180 gainDial->setPageStep(1); |
181 gainDial->setFixedWidth(24); | 181 gainDial->setFixedWidth(24); |
182 gainDial->setFixedHeight(24); | 182 gainDial->setFixedHeight(24); |
183 gainDial->setNotchesVisible(false); | 183 gainDial->setNotchesVisible(false); |
184 gainDial->setToolTip(tr("Playback Level")); | 184 //!!! gainDial->setToolTip(tr("Playback Level")); |
185 gainDial->setDefaultValue(0); | 185 gainDial->setDefaultValue(0); |
186 gainDial->setObjectName(tr("Playback Level")); | 186 gainDial->setObjectName(tr("Playback Gain")); |
187 gainDial->setRangeMapper(new LinearRangeMapper | 187 gainDial->setRangeMapper(new LinearRangeMapper |
188 (-50, 50, -25, 25, tr("dB"))); | 188 (-50, 50, -25, 25, tr("dB"))); |
189 gainDial->setShowToolTip(true); | |
189 connect(gainDial, SIGNAL(valueChanged(int)), | 190 connect(gainDial, SIGNAL(valueChanged(int)), |
190 this, SLOT(playGainDialChanged(int))); | 191 this, SLOT(playGainDialChanged(int))); |
191 connect(params, SIGNAL(playGainChanged(float)), | 192 connect(params, SIGNAL(playGainChanged(float)), |
192 this, SLOT(playGainChanged(float))); | 193 this, SLOT(playGainChanged(float))); |
193 connect(this, SIGNAL(changePlayGain(float)), | 194 connect(this, SIGNAL(changePlayGain(float)), |
205 panDial->setFixedWidth(24); | 206 panDial->setFixedWidth(24); |
206 panDial->setFixedHeight(24); | 207 panDial->setFixedHeight(24); |
207 panDial->setNotchesVisible(false); | 208 panDial->setNotchesVisible(false); |
208 panDial->setToolTip(tr("Playback Pan / Balance")); | 209 panDial->setToolTip(tr("Playback Pan / Balance")); |
209 panDial->setDefaultValue(0); | 210 panDial->setDefaultValue(0); |
210 gainDial->setObjectName(tr("Playback Pan / Balance")); | 211 panDial->setObjectName(tr("Playback Pan / Balance")); |
212 panDial->setShowToolTip(true); | |
211 connect(panDial, SIGNAL(valueChanged(int)), | 213 connect(panDial, SIGNAL(valueChanged(int)), |
212 this, SLOT(playPanDialChanged(int))); | 214 this, SLOT(playPanDialChanged(int))); |
213 connect(params, SIGNAL(playPanChanged(float)), | 215 connect(params, SIGNAL(playPanChanged(float)), |
214 this, SLOT(playPanChanged(float))); | 216 this, SLOT(playPanChanged(float))); |
215 connect(this, SIGNAL(changePlayPan(float)), | 217 connect(this, SIGNAL(changePlayPan(float)), |
322 dial->setMaximum(max); | 324 dial->setMaximum(max); |
323 dial->setPageStep(1); | 325 dial->setPageStep(1); |
324 dial->setNotchesVisible((max - min) <= 12); | 326 dial->setNotchesVisible((max - min) <= 12); |
325 dial->setDefaultValue(value); | 327 dial->setDefaultValue(value); |
326 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); | 328 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); |
329 dial->setShowToolTip(true); | |
327 connect(dial, SIGNAL(valueChanged(int)), | 330 connect(dial, SIGNAL(valueChanged(int)), |
328 this, SLOT(propertyControllerChanged(int))); | 331 this, SLOT(propertyControllerChanged(int))); |
329 | 332 |
330 if (inGroup) { | 333 if (inGroup) { |
331 dial->setFixedWidth(24); | 334 dial->setFixedWidth(24); |
332 dial->setFixedHeight(24); | 335 dial->setFixedHeight(24); |
333 dial->setToolTip(propertyLabel); | 336 //!!! dial->setToolTip(propertyLabel); |
334 m_groupLayouts[groupName]->addWidget(dial); | 337 m_groupLayouts[groupName]->addWidget(dial); |
335 } else { | 338 } else { |
336 dial->setFixedWidth(32); | 339 dial->setFixedWidth(32); |
337 dial->setFixedHeight(32); | 340 dial->setFixedHeight(32); |
338 m_layout->addWidget(dial, row, 1); | 341 m_layout->addWidget(dial, row, 1); |
483 } | 486 } |
484 } else if (type != PropertyContainer::InvalidProperty) { | 487 } else if (type != PropertyContainer::InvalidProperty) { |
485 m_container->setPropertyWithCommand(name, value); | 488 m_container->setPropertyWithCommand(name, value); |
486 } | 489 } |
487 | 490 |
488 if (type == PropertyContainer::RangeProperty) { | 491 // if (type == PropertyContainer::RangeProperty) { |
489 AudioDial *dial = dynamic_cast<AudioDial *>(m_propertyControllers[name]); | 492 // AudioDial *dial = dynamic_cast<AudioDial *>(m_propertyControllers[name]); |
490 if (dial) { | 493 //!!! if (dial) { |
491 dial->setToolTip(QString("%1: %2").arg(name).arg(value)); | 494 // dial->setToolTip(QString("%1: %2").arg(name).arg(value)); |
492 //!!! unfortunately this doesn't update an already-visible tooltip | 495 // //!!! unfortunately this doesn't update an already-visible tooltip |
493 } | 496 // } |
494 } | 497 // } |
495 } | 498 } |
496 | 499 |
497 void | 500 void |
498 PropertyBox::playGainChanged(float gain) | 501 PropertyBox::playGainChanged(float gain) |
499 { | 502 { |