changeset 177:dbd34ff746c7

* 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).
author Chris Cannam
date Fri, 10 Nov 2006 13:27:57 +0000
parents ad7df5989d08
children 05015e717a0d
files view/ViewManager.cpp view/ViewManager.h widgets/AudioDial.cpp widgets/AudioDial.h
diffstat 4 files changed, 37 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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();
--- 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:")
--- 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 *);