diff framework/Document.cpp @ 70:716e9d2f91c7

* Skip ID3 block when reading MP3 files (so long as ID3 support is included) * Show progress when retrieving audio file from playlist * Avoid -- but do not actually fix -- segmentation fault on exit. I am totally stumped at the moment about why both the PA and JACK audio targets should crash when properly shut down. For the moment, we just don't shut them down... * Fix incorrect behaviour (introduced on Friday as part of a different fix) when replacing main model in situation where no current main model exists
author Chris Cannam
date Fri, 30 Nov 2007 17:31:09 +0000
parents cedeab01d4c8
children 4aa40182321f 22bf057ea151
line wrap: on
line diff
--- a/framework/Document.cpp	Thu Nov 29 17:10:53 2007 +0000
+++ b/framework/Document.cpp	Fri Nov 30 17:31:09 2007 +0000
@@ -259,8 +259,8 @@
     // using one of these.  Carry out this replacement before we
     // delete any of the models.
 
-    std::cerr << "Document::setMainModel: Have "
-              << m_layers.size() << " layers" << std::endl;
+//    std::cerr << "Document::setMainModel: Have "
+//              << m_layers.size() << " layers" << std::endl;
 
     for (LayerSet::iterator i = m_layers.begin(); i != m_layers.end(); ++i) {
 
@@ -271,13 +271,13 @@
 //                  << (model ? model->objectName().toStdString() : "(null)") << " in layer "
 //                  << layer->objectName().toStdString() << std::endl;
 
-	if (model && (model == oldMainModel)) {
+	if (model == oldMainModel) {
 //            std::cerr << "... it uses the old main model, replacing" << std::endl;
 	    LayerFactory::getInstance()->setModel(layer, m_mainModel);
 	    continue;
 	}
 
-	if (m_models.find(model) == m_models.end()) {
+	if (model && (m_models.find(model) == m_models.end())) {
 	    std::cerr << "WARNING: Document::setMainModel: Unknown model "
 		      << model << " in layer " << layer << std::endl;
 	    // get rid of this hideous degenerate
@@ -285,7 +285,8 @@
 	    continue;
 	}
 	    
-	if (m_models[model].source && (m_models[model].source == oldMainModel)) {
+	if (m_models[model].source &&
+            (m_models[model].source == oldMainModel)) {
 
 //            std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl;
 
@@ -311,12 +312,12 @@
                 }
 		obsoleteLayers.push_back(layer);
 	    } else {
-                std::cerr << "Replacing model " << model << " (type "
-                          << typeid(*model).name() << ") with model "
-                          << replacementModel << " (type "
-                          << typeid(*replacementModel).name() << ") in layer "
-                          << layer << " (name " << layer->objectName().toStdString() << ")"
-                          << std::endl;
+//                std::cerr << "Replacing model " << model << " (type "
+//                          << typeid(*model).name() << ") with model "
+//                          << replacementModel << " (type "
+//                          << typeid(*replacementModel).name() << ") in layer "
+//                          << layer << " (name " << layer->objectName().toStdString() << ")"
+//                          << std::endl;
                 RangeSummarisableTimeValueModel *rm =
                     dynamic_cast<RangeSummarisableTimeValueModel *>(replacementModel);
                 if (rm) {