changeset 227:718aaac046e7

* Update overview when current pane changes
author Chris Cannam
date Tue, 11 Dec 2007 17:36:56 +0000
parents a2abdc72c390
children b99c6449c2ed
files main/MainWindow.cpp main/MainWindow.h
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Tue Dec 11 17:36:22 2007 +0000
+++ b/main/MainWindow.cpp	Tue Dec 11 17:36:56 2007 +0000
@@ -3119,6 +3119,25 @@
 }
 
 void
+MainWindow::currentPaneChanged(Pane *pane)
+{
+    if (!pane || !m_panLayer) return;
+    for (int i = pane->getLayerCount(); i > 0; ) {
+        --i;
+        Layer *layer = pane->getLayer(i);
+        if (LayerFactory::getInstance()->getLayerType(layer) ==
+            LayerFactory::Waveform) {
+            RangeSummarisableTimeValueModel *tvm = 
+                dynamic_cast<RangeSummarisableTimeValueModel *>(layer->getModel());
+            if (tvm) {
+                m_panLayer->setModel(tvm);
+                return;
+            }
+        }
+    }
+}
+
+void
 MainWindow::updateVisibleRangeDisplay(Pane *p) const
 {
     if (!getMainModel() || !p) {
--- a/main/MainWindow.h	Tue Dec 11 17:36:22 2007 +0000
+++ b/main/MainWindow.h	Tue Dec 11 17:36:56 2007 +0000
@@ -139,6 +139,8 @@
     virtual void playSoloToggled();
     virtual void alignToggled();
 
+    virtual void currentPaneChanged(Pane *);
+
     virtual void speedUpPlayback();
     virtual void slowDownPlayback();
     virtual void restoreNormalPlayback();