diff layer/LayerFactory.cpp @ 626:7256926d3af1 tonioni

cleanup
author gyorgyf
date Sat, 13 Apr 2013 15:36:54 +0100
parents 1336439dc055
children 917039d333bb
line wrap: on
line diff
--- a/layer/LayerFactory.cpp	Sat Apr 13 13:39:17 2013 +0100
+++ b/layer/LayerFactory.cpp	Sat Apr 13 15:36:54 2013 +0100
@@ -161,13 +161,12 @@
     }
 
     if (dynamic_cast<NoteModel *>(model)) {
-	// types.insert(FlexiNotes);
 	types.insert(Notes);
     }
 
+	// NOTE: GF: types is a set, so order of insertion does not matter
     if (dynamic_cast<FlexiNoteModel *>(model)) {
 	types.insert(FlexiNotes);
-	// types.insert(Notes);
     }
 
     if (dynamic_cast<RegionModel *>(model)) {
@@ -296,8 +295,6 @@
 //    if (trySetModel<WaveformLayer, RangeSummarisableTimeValueModel>(layer, model))
 //	return;
 	
-	std::cerr << "LayerFactory::setModel called... " << std::endl;
-
     if (trySetModel<WaveformLayer, WaveFileModel>(layer, model))
 	return;
 
@@ -316,20 +313,13 @@
     if (trySetModel<TimeValueLayer, SparseTimeValueModel>(layer, model))
 	return;
 
-    if (trySetModel<NoteLayer, NoteModel>(layer, model)) {
-		std::cerr << "trying to set note layer model" << std::endl;
-	return; }
+    if (trySetModel<NoteLayer, NoteModel>(layer, model)) 
+	return; 
 
-    if (trySetModel<FlexiNoteLayer, FlexiNoteModel>(layer, model)) {
-		std::cerr << "trying to set flexi note layer model" << std::endl;
-	return; }
+	// GF: added FlexiNoteLayer
+    if (trySetModel<FlexiNoteLayer, FlexiNoteModel>(layer, model)) 
+	return; 
 	
-	FlexiNoteLayer *clayer = dynamic_cast<FlexiNoteLayer *>(layer);
-	if (!clayer) { std::cerr << "layer cast failed" << std::endl; return; }
-	FlexiNoteModel *cmodel = dynamic_cast<FlexiNoteModel *>(model);
-	if (!cmodel) { std::cerr << "model cast failed" << std::endl; return; }
-	clayer->setModel(cmodel);
-
     if (trySetModel<RegionLayer, RegionModel>(layer, model))
 	return;
 
@@ -350,7 +340,6 @@
 
 //    if (trySetModel<SliceLayer, DenseThreeDimensionalModel>(layer, model)) 
 //        return;
-	std::cerr << "LayerFactory::setModel done... " << std::endl;
 }
 
 Model *