# HG changeset patch # User Chris Cannam # Date 1402907292 -3600 # Node ID 85879408f6657f4076d73839d590c9fb80b78e73 # Parent defbe5bc47b78b19914b4091aa724f9e5d39e055 Cancel async layer creation in Tony when selection is changed during it diff -r defbe5bc47b7 -r 85879408f665 transform/ModelTransformerFactory.cpp --- a/transform/ModelTransformerFactory.cpp Fri Jun 13 17:39:01 2014 +0100 +++ b/transform/ModelTransformerFactory.cpp Mon Jun 16 09:28:12 2014 +0100 @@ -106,7 +106,6 @@ } else if (RealTimePluginFactory::instanceFor(id)) { RealTimePluginFactory *factory = RealTimePluginFactory::instanceFor(id); - const RealTimePluginDescriptor *desc = factory->getPluginDescriptor(id); size_t sampleRate = inputModel->getSampleRate(); size_t blockSize = 1024; @@ -234,7 +233,7 @@ QString trn = TransformFactory::getInstance()->getTransformFriendlyName (transforms[0].getIdentifier()); - for (int i = 0; i < models.size(); ++i) { + for (int i = 0; i < (int)models.size(); ++i) { if (imn != "") { if (trn != "") { models[i]->setObjectName(tr("%1: %2").arg(imn).arg(trn)); diff -r defbe5bc47b7 -r 85879408f665 transform/ModelTransformerFactory.h --- a/transform/ModelTransformerFactory.h Fri Jun 13 17:39:01 2014 +0100 +++ b/transform/ModelTransformerFactory.h Mon Jun 16 09:28:12 2014 +0100 @@ -84,7 +84,8 @@ * Return the output model resulting from applying the named * transform to the given input model. The transform may still be * working in the background when the model is returned; check the - * output model's isReady completion status for more details. + * output model's isReady completion status for more details. To + * cancel a background transform, call abandon() on its model. * * If the transform is unknown or the input model is not an * appropriate type for the given transform, or if some other @@ -116,7 +117,8 @@ * (as appropriate). Models will be returned in the same order as * the transforms were given. The plugin may still be working in * the background when the model is returned; check the output - * models' isReady completion statuses for more details. + * models' isReady completion statuses for more details. To cancel + * a background transform, call abandon() on its model. * * If a transform is unknown or the transforms are insufficiently * closely related or the input model is not an appropriate type @@ -130,7 +132,10 @@ * is provided here, its moreModelsAvailable method will be called * when those models become available, and ownership of those * models will be transferred to the handler. Otherwise (if the - * handler is null) any such models will be discarded. + * handler is null) any such models will be discarded. Note that + * calling abandon() on any one of the models returned by + * transformMultiple is sufficient to cancel all background + * transform activity associated with these output models. * * The returned models are owned by the caller and must be deleted * when no longer needed.