comparison main/MainWindow.cpp @ 238:cdb227563bc1

* Add pitch range in octaves, semitones and cents to the measurement rect as well as in Hz * Avoid crash when adding time ruler This commit contains a lot of debug output (will be slow)
author Chris Cannam
date Wed, 06 Feb 2008 16:21:29 +0000
parents 198915eac073
children d936e3d77b95
comparison
equal deleted inserted replaced
237:99fa3387dfef 238:cdb227563bc1
2901 m_toolActions[ViewManager::DrawMode]->trigger(); 2901 m_toolActions[ViewManager::DrawMode]->trigger();
2902 } 2902 }
2903 2903
2904 } else { 2904 } else {
2905 2905
2906 // newLayer = m_document->createMainModelLayer(type); 2906 if (!i->second.sourceModel) {
2907 newLayer = m_document->createLayer(type); 2907 // e.g. time ruler
2908 if (m_document->isKnownModel(i->second.sourceModel)) { 2908 newLayer = m_document->createMainModelLayer(type);
2909 m_document->setChannel(newLayer, i->second.channel);
2910 m_document->setModel(newLayer, i->second.sourceModel);
2911 } else { 2909 } else {
2912 std::cerr << "WARNING: MainWindow::addLayer: unknown model " 2910 newLayer = m_document->createLayer(type);
2913 << i->second.sourceModel 2911 if (m_document->isKnownModel(i->second.sourceModel)) {
2914 << " (\"" 2912 m_document->setChannel(newLayer, i->second.channel);
2915 << i->second.sourceModel->objectName().toStdString() 2913 m_document->setModel(newLayer, i->second.sourceModel);
2916 << "\") in layer action map" 2914 } else {
2917 << std::endl; 2915 std::cerr << "WARNING: MainWindow::addLayer: unknown model "
2916 << i->second.sourceModel
2917 << " (\""
2918 << (i->second.sourceModel ? i->second.sourceModel->objectName().toStdString() : "")
2919 << "\") in layer action map"
2920 << std::endl;
2921 }
2918 } 2922 }
2919 } 2923 }
2920 2924
2921 if (newLayer) { 2925 if (newLayer) {
2922 m_document->addLayerToView(pane, newLayer); 2926 m_document->addLayerToView(pane, newLayer);
2923 m_paneStack->setCurrentLayer(pane, newLayer); 2927 m_paneStack->setCurrentLayer(pane, newLayer);
2924 } 2928 }