diff widgets/PaneStack.cpp @ 19:46d8f5add6f0

* Introduce potentially-separate read and write ring buffers, so we can swap in a new set when something changes -- thus allowing us to respond quickly when something changes during playback, without losing the long buffers * Some fixes for display & editing
author Chris Cannam
date Fri, 27 Jan 2006 18:04:07 +0000
parents 0183ebb725ca
children 651e4e868bcc
line wrap: on
line diff
--- a/widgets/PaneStack.cpp	Thu Jan 26 18:01:38 2006 +0000
+++ b/widgets/PaneStack.cpp	Fri Jan 27 18:04:07 2006 +0000
@@ -157,6 +157,37 @@
     emit currentPaneChanged(m_currentPane);
 }
 
+void
+PaneStack::setCurrentLayer(Pane *pane, Layer *layer) // may be null
+{
+    setCurrentPane(pane);
+
+    if (m_currentPane) {
+
+	std::vector<Pane *>::iterator i = m_panes.begin();
+	std::vector<QWidget *>::iterator j = m_propertyStacks.begin();
+
+	while (i != m_panes.end()) {
+
+	    if (*i == pane) {
+		PropertyStack *stack = dynamic_cast<PropertyStack *>(*j);
+		if (stack) {
+		    if (stack->containsContainer(layer)) {
+			stack->setCurrentIndex(stack->getContainerIndex(layer));
+			emit currentLayerChanged(pane, layer);
+		    } else {
+			stack->setCurrentIndex(stack->getContainerIndex(pane));
+			emit currentLayerChanged(pane, 0);
+		    }
+		}
+		break;
+	    }
+	    ++i;
+	    ++j;
+	}
+    }
+}
+
 Pane *
 PaneStack::getCurrentPane() 
 {