# HG changeset patch # User Chris Cannam # Date 1163165277 0 # Node ID dbd34ff746c7cee472b2c5ca9010424ff74c30df # Parent ad7df5989d08bcb7481246c93a87d42e5824c551 * Update the main sv.prf for compatibility with Qt 4.2 qmake instead of that from 4.1. Add a README.Qt41 describing how to build with 4.1 if preferred. * Add OSC support for control from external scripts etc (work in progress). diff -r ad7df5989d08 -r dbd34ff746c7 view/ViewManager.cpp --- a/view/ViewManager.cpp Mon Oct 30 12:44:45 2006 +0000 +++ b/view/ViewManager.cpp Fri Nov 10 13:27:57 2006 +0000 @@ -234,17 +234,25 @@ void ViewManager::setPlayLoopMode(bool mode) { - m_playLoopMode = mode; + if (m_playLoopMode != mode) { - emit playLoopModeChanged(); + m_playLoopMode = mode; + + emit playLoopModeChanged(); + emit playLoopModeChanged(mode); + } } void ViewManager::setPlaySelectionMode(bool mode) { - m_playSelectionMode = mode; + if (m_playSelectionMode != mode) { - emit playSelectionModeChanged(); + m_playSelectionMode = mode; + + emit playSelectionModeChanged(); + emit playSelectionModeChanged(mode); + } } size_t diff -r ad7df5989d08 -r dbd34ff746c7 view/ViewManager.h --- a/view/ViewManager.h Mon Oct 30 12:44:45 2006 +0000 +++ b/view/ViewManager.h Fri Nov 10 13:27:57 2006 +0000 @@ -135,9 +135,11 @@ /** Emitted when the play loop mode has been changed. */ void playLoopModeChanged(); + void playLoopModeChanged(bool); /** Emitted when the play selection mode has been changed. */ void playSelectionModeChanged(); + void playSelectionModeChanged(bool); /** Emitted when the overlay mode has been changed. */ void overlayModeChanged(); diff -r ad7df5989d08 -r dbd34ff746c7 widgets/AudioDial.cpp --- a/widgets/AudioDial.cpp Mon Oct 30 12:44:45 2006 +0000 +++ b/widgets/AudioDial.cpp Fri Nov 10 13:27:57 2006 +0000 @@ -332,6 +332,25 @@ } +void AudioDial::setMappedValue(float mappedValue) +{ + if (m_rangeMapper) { + int newPosition = m_rangeMapper->getPositionForValue(mappedValue); + m_mappedValue = mappedValue; + m_noMappedUpdate = true; + std::cerr << "AudioDial::setMappedValue(" << mappedValue << "): new position is " << newPosition << std::endl; + if (newPosition != value()) { + setValue(newPosition); + } else { + emit valueChanged(newPosition); + } + m_noMappedUpdate = false; + } else { + setValue(mappedValue); + } +} + + void AudioDial::setShowToolTip(bool show) { m_showTooltip = show; @@ -401,8 +420,6 @@ bool ok = false; - int newPosition = value(); - if (m_rangeMapper) { float min = m_rangeMapper->getValueForPosition(minimum()); @@ -439,22 +456,13 @@ 4, &ok); - newPosition = m_rangeMapper->getPositionForValue(newValue); - if (ok) { - m_mappedValue = newValue; - m_noMappedUpdate = true; - if (newPosition != value()) { - setValue(newPosition); - } else { - emit valueChanged(newPosition); - } - m_noMappedUpdate = false; + setMappedValue(newValue); } } else { - newPosition = QInputDialog::getInteger + int newPosition = QInputDialog::getInteger (this, tr("Enter new value"), tr("Enter a new value from %1 to %2:") diff -r ad7df5989d08 -r dbd34ff746c7 widgets/AudioDial.h --- a/widgets/AudioDial.h Mon Oct 30 12:44:45 2006 +0000 +++ b/widgets/AudioDial.h Fri Nov 10 13:27:57 2006 +0000 @@ -99,6 +99,8 @@ void setDefaultValue(int defaultValue); + void setMappedValue(float mappedValue); + protected: void drawTick(QPainter &paint, float angle, int size, bool internal); virtual void paintEvent(QPaintEvent *);