changeset 510:683c46d7500b

* Handle zero-velocity note ons as well as note offs (can't believe I fell for that one) * Add Peek Left / Peek Right (alt+left/right) and change peek-drag (i.e. dragging without moving playback pointer or other panes) from ctrl+drag to alt+drag for symmetry
author Chris Cannam
date Thu, 26 Feb 2009 10:49:08 +0000
parents f8b98f63f200
children 455810e65543
files view/Pane.cpp view/Pane.h view/View.cpp view/View.h
diffstat 4 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/view/Pane.cpp	Wed Feb 25 17:41:34 2009 +0000
+++ b/view/Pane.cpp	Thu Feb 26 10:49:08 2009 +0000
@@ -64,6 +64,7 @@
     m_clickedInRange(false),
     m_shiftPressed(false),
     m_ctrlPressed(false),
+    m_altPressed(false),
     m_navigating(false),
     m_resizing(false),
     m_editing(false),
@@ -1237,6 +1238,7 @@
     m_editingSelectionEdge = 0;
     m_shiftPressed = (e->modifiers() & Qt::ShiftModifier);
     m_ctrlPressed = (e->modifiers() & Qt::ControlModifier);
+    m_altPressed = (e->modifiers() & Qt::AltModifier);
     m_dragMode = UnresolvedDrag;
 
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
@@ -1739,7 +1741,7 @@
         }
                 
         if (getXForFrame(m_centreFrame) != getXForFrame(newCentreFrame)) {
-            setCentreFrame(newCentreFrame, !m_ctrlPressed);
+            setCentreFrame(newCentreFrame, !m_altPressed);
         }
     }
 
@@ -1925,6 +1927,7 @@
     m_clickedInRange = true;
     m_shiftPressed = (e->modifiers() & Qt::ShiftModifier);
     m_ctrlPressed = (e->modifiers() & Qt::ControlModifier);
+    m_altPressed = (e->modifiers() & Qt::AltModifier);
 
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
     if (m_manager) mode = m_manager->getToolMode();
--- a/view/Pane.h	Wed Feb 25 17:41:34 2009 +0000
+++ b/view/Pane.h	Thu Feb 26 10:49:08 2009 +0000
@@ -140,6 +140,7 @@
     bool m_clickedInRange;
     bool m_shiftPressed;
     bool m_ctrlPressed;
+    bool m_altPressed;
 
     bool m_navigating;
     bool m_resizing;
--- a/view/View.cpp	Wed Feb 25 17:41:34 2009 +0000
+++ b/view/View.cpp	Thu Feb 26 10:49:08 2009 +0000
@@ -1354,7 +1354,7 @@
 }
 
 void
-View::scroll(bool right, bool lots)
+View::scroll(bool right, bool lots, bool e)
 {
     long delta;
     if (lots) {
@@ -1365,11 +1365,11 @@
     if (right) delta = -delta;
 
     if (int(m_centreFrame) < delta) {
-	setCentreFrame(0);
+	setCentreFrame(0, e);
     } else if (int(m_centreFrame) - delta >= int(getModelsEndFrame())) {
-	setCentreFrame(getModelsEndFrame());
+	setCentreFrame(getModelsEndFrame(), e);
     } else {
-	setCentreFrame(m_centreFrame - delta);
+	setCentreFrame(m_centreFrame - delta, e);
     }
 }
 
--- a/view/View.h	Wed Feb 25 17:41:34 2009 +0000
+++ b/view/View.h	Thu Feb 26 10:49:08 2009 +0000
@@ -141,7 +141,7 @@
     /**
      * Scroll left or right by a smallish or largish amount.
      */
-    virtual void scroll(bool right, bool lots);
+    virtual void scroll(bool right, bool lots, bool doEmit = true);
 
     virtual void addLayer(Layer *v);
     virtual void removeLayer(Layer *v); // does not delete the layer