changeset 626:7256926d3af1 tonioni

cleanup
author gyorgyf
date Sat, 13 Apr 2013 15:36:54 +0100
parents 1336439dc055
children 640c3792977f
files layer/FlexiNoteLayer.cpp layer/LayerFactory.cpp layer/NoteLayer.cpp
diffstat 3 files changed, 8 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp	Sat Apr 13 13:39:17 2013 +0100
+++ b/layer/FlexiNoteLayer.cpp	Sat Apr 13 15:36:54 2013 +0100
@@ -63,9 +63,8 @@
 }
 
 void
-FlexiNoteLayer::setModel(FlexiNoteModel *model) // THIS FUNCTION FAILS
+FlexiNoteLayer::setModel(FlexiNoteModel *model) 
 {
-	std::cerr << "NOTE: FlexiNoteLayer::setModel called" << std::endl; //delete this!!
     if (m_model == model) return;
     m_model = model;
 
@@ -75,7 +74,6 @@
 
     m_scaleMinimum = 0;
     m_scaleMaximum = 0;
-	std::cerr << "NOTE: FlexiNoteLayer::NoteModel set" << std::endl; //delete this!!
 
     emit modelReplaced();
 }
--- 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 *
--- a/layer/NoteLayer.cpp	Sat Apr 13 13:39:17 2013 +0100
+++ b/layer/NoteLayer.cpp	Sat Apr 13 15:36:54 2013 +0100
@@ -54,9 +54,7 @@
 
 void
 NoteLayer::setModel(NoteModel *model)
-{
-	std::cerr << "NOTE: called NoteLayer::setModel" << std::endl; //delete this!!
-	
+{	
     if (m_model == model) return;
     m_model = model;
 
@@ -67,8 +65,6 @@
     m_scaleMinimum = 0;
     m_scaleMaximum = 0;
 
-	std::cerr << "NOTE: NoteLayer::NoteModel set" << std::endl; //delete this!!
-
     emit modelReplaced();
 }