diff view/PaneStack.cpp @ 277:8acd30ed735c

* Fix up and simplify the LayerTreeModel, removing a horrible memory leak * Move phase-unwrapped frequency estimation from SpectrogramLayer to FFTDataServer * Make the spectrum show peak phase-unwrapped frequencies as well (still needs work) * Start adding piano keyboard horizontal scale to spectrum * Debug output for id3 tags
author Chris Cannam
date Tue, 03 Jul 2007 12:46:18 +0000
parents 1a49bd0d8375
children 6de6f78b13a1
line wrap: on
line diff
--- a/view/PaneStack.cpp	Mon Jul 02 14:58:34 2007 +0000
+++ b/view/PaneStack.cpp	Tue Jul 03 12:46:18 2007 +0000
@@ -172,7 +172,22 @@
 Pane *
 PaneStack::getPane(int n)
 {
-    return m_panes[n].pane;
+    if (n < m_panes.size()) {
+        return m_panes[n].pane;
+    } else {
+        return 0;
+    }
+}
+
+int
+PaneStack::getPaneIndex(Pane *pane)
+{
+    for (int i = 0; i < getPaneCount(); ++i) {
+        if (pane == getPane(i)) {
+            return i;
+        }
+    }
+    return -1;
 }
 
 Pane *