Mercurial > hg > svgui
comparison widgets/AudioDial.cpp @ 586:1ae54a29e59e
Merge from debug-output branch
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 14:48:29 +0100 |
parents | f4960f8ce798 |
children | 4806715f7a19 |
comparison
equal
deleted
inserted
replaced
583:4c484636d5ec | 586:1ae54a29e59e |
---|---|
97 } | 97 } |
98 | 98 |
99 | 99 |
100 void AudioDial::setRangeMapper(RangeMapper *mapper) | 100 void AudioDial::setRangeMapper(RangeMapper *mapper) |
101 { | 101 { |
102 // std::cerr << "AudioDial[" << this << "][\"" << objectName().toStdString() << "\"::setRangeMapper(" << mapper << ") [current is " << m_rangeMapper << "] (have " << dialsExtant << " dials extant)" << std::endl; | 102 // std::cerr << "AudioDial[" << this << "][\"" << objectName() << "\"::setRangeMapper(" << mapper << ") [current is " << m_rangeMapper << "] (have " << dialsExtant << " dials extant)" << std::endl; |
103 | 103 |
104 if (m_rangeMapper == mapper) return; | 104 if (m_rangeMapper == mapper) return; |
105 | 105 |
106 if (!m_rangeMapper && mapper) { | 106 if (!m_rangeMapper && mapper) { |
107 connect(this, SIGNAL(valueChanged(int)), | 107 connect(this, SIGNAL(valueChanged(int)), |
363 if (m_rangeMapper) { | 363 if (m_rangeMapper) { |
364 int newPosition = m_rangeMapper->getPositionForValue(mappedValue); | 364 int newPosition = m_rangeMapper->getPositionForValue(mappedValue); |
365 bool changed = (m_mappedValue != mappedValue); | 365 bool changed = (m_mappedValue != mappedValue); |
366 m_mappedValue = mappedValue; | 366 m_mappedValue = mappedValue; |
367 m_noMappedUpdate = true; | 367 m_noMappedUpdate = true; |
368 std::cerr << "AudioDial::setMappedValue(" << mappedValue << "): new position is " << newPosition << std::endl; | 368 DEBUG << "AudioDial::setMappedValue(" << mappedValue << "): new position is " << newPosition << endl; |
369 if (newPosition != value()) { | 369 if (newPosition != value()) { |
370 setValue(newPosition); | 370 setValue(newPosition); |
371 } else if (changed) { | 371 } else if (changed) { |
372 emit valueChanged(newPosition); | 372 emit valueChanged(newPosition); |
373 } | 373 } |
388 | 388 |
389 | 389 |
390 float AudioDial::mappedValue() const | 390 float AudioDial::mappedValue() const |
391 { | 391 { |
392 if (m_rangeMapper) { | 392 if (m_rangeMapper) { |
393 // std::cerr << "AudioDial::mappedValue(): value = " << value() << ", mappedValue = " << m_mappedValue << std::endl; | 393 // DEBUG << "AudioDial::mappedValue(): value = " << value() << ", mappedValue = " << m_mappedValue << endl; |
394 return m_mappedValue; | 394 return m_mappedValue; |
395 } | 395 } |
396 return value(); | 396 return value(); |
397 } | 397 } |
398 | 398 |