diff transform/FeatureExtractionModelTransformer.cpp @ 923:defbe5bc47b7 tonioni

Add an experimental cancel button to view progress bars
author Chris Cannam
date Fri, 13 Jun 2014 17:39:01 +0100
parents c3656035240f
children d03b3d956358
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Fri Jun 13 16:35:15 2014 +0100
+++ b/transform/FeatureExtractionModelTransformer.cpp	Fri Jun 13 17:39:01 2014 +0100
@@ -1018,6 +1018,7 @@
 	SparseOneDimensionalModel *model =
             getConformingOutput<SparseOneDimensionalModel>(n);
 	if (!model) return;
+        if (model->isAbandoning()) abandon();
 	model->setCompletion(completion, true);
 
     } else if (isOutput<SparseTimeValueModel>(n)) {
@@ -1025,24 +1026,28 @@
 	SparseTimeValueModel *model =
             getConformingOutput<SparseTimeValueModel>(n);
 	if (!model) return;
+        if (model->isAbandoning()) abandon();
 	model->setCompletion(completion, true);
 
     } else if (isOutput<NoteModel>(n)) {
 
 	NoteModel *model = getConformingOutput<NoteModel>(n);
 	if (!model) return;
+        if (model->isAbandoning()) abandon();
 	model->setCompletion(completion, true);
 	
-	} else if (isOutput<FlexiNoteModel>(n)) {
+    } else if (isOutput<FlexiNoteModel>(n)) {
 
 	FlexiNoteModel *model = getConformingOutput<FlexiNoteModel>(n);
 	if (!model) return;
+        if (model->isAbandoning()) abandon();
 	model->setCompletion(completion, true);
 
     } else if (isOutput<RegionModel>(n)) {
 
 	RegionModel *model = getConformingOutput<RegionModel>(n);
 	if (!model) return;
+        if (model->isAbandoning()) abandon();
 	model->setCompletion(completion, true);
 
     } else if (isOutput<EditableDenseThreeDimensionalModel>(n)) {
@@ -1050,6 +1055,7 @@
 	EditableDenseThreeDimensionalModel *model =
             getConformingOutput<EditableDenseThreeDimensionalModel>(n);
 	if (!model) return;
+        if (model->isAbandoning()) abandon();
 	model->setCompletion(completion, true); //!!!m_context.updates);
     }
 }