changeset 177:5bde373ad5ca

* Layer tree view updating when visibility / audibility changed (and layers updating when they are changed in view) -- still some problems when a model is loaded while the tree is visible * FFTW_MEASURE throughout -- it does turn out to make an appreciable difference sometimes
author Chris Cannam
date Thu, 16 Aug 2007 16:47:07 +0000
parents 4c120dfffe1d
children 3e5a32a2acf4
files audioio/PhaseVocoderTimeStretcher.cpp main/MainWindow.cpp main/MainWindow.h
diffstat 3 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/PhaseVocoderTimeStretcher.cpp	Tue Aug 14 19:37:10 2007 +0000
+++ b/audioio/PhaseVocoderTimeStretcher.cpp	Thu Aug 16 16:47:07 2007 +0000
@@ -88,8 +88,8 @@
         m_freq[c] = (fftf_complex *)fftf_malloc(sizeof(fftf_complex) *
                                                   (m_wlen / 2 + 1));
         
-        m_plan[c] = fftf_plan_dft_r2c_1d(m_wlen, m_time[c], m_freq[c], FFTW_ESTIMATE);
-        m_iplan[c] = fftf_plan_dft_c2r_1d(m_wlen, m_freq[c], m_time[c], FFTW_ESTIMATE);
+        m_plan[c] = fftf_plan_dft_r2c_1d(m_wlen, m_time[c], m_freq[c], FFTW_MEASURE);
+        m_iplan[c] = fftf_plan_dft_c2r_1d(m_wlen, m_freq[c], m_time[c], FFTW_MEASURE);
 
         m_outbuf[c] = new RingBuffer<float>
             ((m_maxOutputBlockSize + m_wlen) * 2);
--- a/main/MainWindow.cpp	Tue Aug 14 19:37:10 2007 +0000
+++ b/main/MainWindow.cpp	Thu Aug 16 16:47:07 2007 +0000
@@ -137,6 +137,7 @@
     m_openingAudioFile(false),
     m_abandoning(false),
     m_preferencesDialog(0),
+    m_layerTreeView(0),
     m_keyReference(new KeyReference())
 {
     setWindowTitle(tr("Sonic Visualiser"));
@@ -347,6 +348,7 @@
     delete m_oscQueue;
     delete m_keyReference;
     delete m_preferencesDialog;
+    delete m_layerTreeView;
     Profiles::getInstance()->dump();
 }
 
@@ -3200,6 +3202,11 @@
         m_preferencesDialog->applicationClosing(false);
     }
 
+    if (m_layerTreeView &&
+        m_layerTreeView->isVisible()) {
+        delete m_layerTreeView;
+    }
+
     e->accept();
     return;
 }
@@ -4456,12 +4463,20 @@
 void
 MainWindow::showLayerTree()
 {
-    QTreeView *view = new QTreeView();
+    if (!m_layerTreeView.isNull()) {
+        m_layerTreeView->show();
+        m_layerTreeView->raise();
+        return;
+    }
+
+    //!!! should use an actual dialog class
+        
+    m_layerTreeView = new QTreeView();
     LayerTreeModel *tree = new LayerTreeModel(m_paneStack);
-    view->setModel(tree);
-    view->expandAll();
-    view->resize(500, 300); //!!!
-    view->show();
+    m_layerTreeView->resize(500, 300); //!!!
+    m_layerTreeView->setModel(tree);
+    m_layerTreeView->expandAll();
+    m_layerTreeView->show();
 }
 
 void
--- a/main/MainWindow.h	Tue Aug 14 19:37:10 2007 +0000
+++ b/main/MainWindow.h	Thu Aug 16 16:47:07 2007 +0000
@@ -49,6 +49,7 @@
 class QLabel;
 class QCheckBox;
 class PreferencesDialog;
+class QTreeView;
 class QPushButton;
 class OSCQueue;
 class OSCMessage;
@@ -299,6 +300,7 @@
     mutable QString          m_myStatusMessage;
 
     QPointer<PreferencesDialog> m_preferencesDialog;
+    QPointer<QTreeView>      m_layerTreeView;
 
     KeyReference            *m_keyReference;