comparison main/MainWindow.cpp @ 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 aaf806ce329a
children 98ba77e0d897
comparison
equal deleted inserted replaced
176:4c120dfffe1d 177:5bde373ad5ca
135 m_rwdAction(0), 135 m_rwdAction(0),
136 m_documentModified(false), 136 m_documentModified(false),
137 m_openingAudioFile(false), 137 m_openingAudioFile(false),
138 m_abandoning(false), 138 m_abandoning(false),
139 m_preferencesDialog(0), 139 m_preferencesDialog(0),
140 m_layerTreeView(0),
140 m_keyReference(new KeyReference()) 141 m_keyReference(new KeyReference())
141 { 142 {
142 setWindowTitle(tr("Sonic Visualiser")); 143 setWindowTitle(tr("Sonic Visualiser"));
143 144
144 UnitDatabase *udb = UnitDatabase::getInstance(); 145 UnitDatabase *udb = UnitDatabase::getInstance();
345 delete m_playSource; 346 delete m_playSource;
346 delete m_viewManager; 347 delete m_viewManager;
347 delete m_oscQueue; 348 delete m_oscQueue;
348 delete m_keyReference; 349 delete m_keyReference;
349 delete m_preferencesDialog; 350 delete m_preferencesDialog;
351 delete m_layerTreeView;
350 Profiles::getInstance()->dump(); 352 Profiles::getInstance()->dump();
351 } 353 }
352 354
353 QString 355 QString
354 MainWindow::getOpenFileName(FileFinder::FileType type) 356 MainWindow::getOpenFileName(FileFinder::FileType type)
3198 m_preferencesDialog->isVisible()) { 3200 m_preferencesDialog->isVisible()) {
3199 closeSession(); // otherwise we'll have to wait for prefs changes 3201 closeSession(); // otherwise we'll have to wait for prefs changes
3200 m_preferencesDialog->applicationClosing(false); 3202 m_preferencesDialog->applicationClosing(false);
3201 } 3203 }
3202 3204
3205 if (m_layerTreeView &&
3206 m_layerTreeView->isVisible()) {
3207 delete m_layerTreeView;
3208 }
3209
3203 e->accept(); 3210 e->accept();
3204 return; 3211 return;
3205 } 3212 }
3206 3213
3207 bool 3214 bool
4454 } 4461 }
4455 4462
4456 void 4463 void
4457 MainWindow::showLayerTree() 4464 MainWindow::showLayerTree()
4458 { 4465 {
4459 QTreeView *view = new QTreeView(); 4466 if (!m_layerTreeView.isNull()) {
4467 m_layerTreeView->show();
4468 m_layerTreeView->raise();
4469 return;
4470 }
4471
4472 //!!! should use an actual dialog class
4473
4474 m_layerTreeView = new QTreeView();
4460 LayerTreeModel *tree = new LayerTreeModel(m_paneStack); 4475 LayerTreeModel *tree = new LayerTreeModel(m_paneStack);
4461 view->setModel(tree); 4476 m_layerTreeView->resize(500, 300); //!!!
4462 view->expandAll(); 4477 m_layerTreeView->setModel(tree);
4463 view->resize(500, 300); //!!! 4478 m_layerTreeView->expandAll();
4464 view->show(); 4479 m_layerTreeView->show();
4465 } 4480 }
4466 4481
4467 void 4482 void
4468 MainWindow::pollOSC() 4483 MainWindow::pollOSC()
4469 { 4484 {