# HG changeset patch # User Chris Cannam # Date 1563366517 -3600 # Node ID 3c5dc95bea91319763e4d97ed51b8edb1e32ce0b # Parent ad5917362158cf733f9b8ae812e64f296a09d029 Tidy diff -r ad5917362158 -r 3c5dc95bea91 audio/AudioGenerator.cpp --- a/audio/AudioGenerator.cpp Wed Jul 17 11:20:24 2019 +0100 +++ b/audio/AudioGenerator.cpp Wed Jul 17 13:28:37 2019 +0100 @@ -166,15 +166,6 @@ void AudioGenerator::playClipIdChanged(int playableId, QString) { - /*!!! - const Model *model = dynamic_cast(playable); - if (!model) { - cerr << "WARNING: AudioGenerator::playClipIdChanged: playable " - << playable << " is not a supported model type" - << endl; - return; - } - */ ModelId modelId; modelId.untyped = playableId; diff -r ad5917362158 -r 3c5dc95bea91 framework/Document.cpp --- a/framework/Document.cpp Wed Jul 17 11:20:24 2019 +0100 +++ b/framework/Document.cpp Wed Jul 17 13:28:37 2019 +0100 @@ -291,18 +291,6 @@ delete this; } - void cancel() { -/*!!! todo: restore - foreach (Layer *layer, m_primary) { - ModelId model = layer->getModel(); - //!!! todo: restore this behaviour - if (model) { - model->abandon(); - } - } -*/ - } - private: Document *m_doc; vector m_primary; @@ -345,13 +333,6 @@ return amc; } -void -Document::cancelAsyncLayerCreation(Document::LayerCreationAsyncHandle h) -{ - AdditionalModelConverter *conv = static_cast(h); - conv->cancel(); -} - vector Document::createLayersForDerivedModels(vector newModels, QStringList names) @@ -1067,7 +1048,6 @@ return models; } -//!!! what is this used for? bool Document::isKnownModel(const ModelId modelId) const { @@ -1562,10 +1542,6 @@ // 'type="transform"' in the derivation element. const Transform &transform = rec.transform; - - //!!! in cases like these, where we think we have the model handle - //!!! and nobody else should be releasing it, we probably ought to - //!!! throw std::logic_error if !targetModel auto targetModel = ModelById::get(targetModelId); if (!targetModel) return; diff -r ad5917362158 -r 3c5dc95bea91 framework/Document.h --- a/framework/Document.h Wed Jul 17 11:20:24 2019 +0100 +++ b/framework/Document.h Wed Jul 17 13:28:37 2019 +0100 @@ -158,21 +158,13 @@ * transformer process, and the layers are returned through a * subsequent call to the provided handler (which must be * non-null). The handle returned will be passed through to the - * handler callback, and may be also used for cancelling the task. + * handler callback. */ LayerCreationAsyncHandle createDerivedLayersAsync(const Transforms &, const ModelTransformer::Input &, LayerCreationHandler *handler); /** - * Indicate that the async layer creation task associated with the - * given handle should be cancelled. There is no guarantee about - * what this will mean, and the handler callback may still be - * called. - */ - void cancelAsyncLayerCreation(LayerCreationAsyncHandle handle); - - /** * Delete the given layer, and also its associated model if no * longer used by any other layer. In general, this should be the * only method used to delete layers -- doing so directly is a bit @@ -196,7 +188,11 @@ std::vector getTransformInputModels(); - //??? investigate & document + /** + * Return true if the model id is known to be the main model or + * one of the other existing models that can be shown in a new + * layer. + */ bool isKnownModel(ModelId) const; /** diff -r ad5917362158 -r 3c5dc95bea91 framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Wed Jul 17 11:20:24 2019 +0100 +++ b/framework/SVFileReader.cpp Wed Jul 17 13:28:37 2019 +0100 @@ -476,19 +476,10 @@ continue; } - //!!! todo: review this (i.e. who causes the release of what) + m_document->addNonDerivedModel(modelId); - // don't want to add alignment models to the document, because - // their lifespans are entirely dictated by the models that - // "own" them even though they were read independently from - // the .sv file. (pity we don't have a nicer way to handle - // this) - if (!ModelById::isa(modelId)) { - m_document->addNonDerivedModel(modelId); - } - - // but we add all models including alignment ones to the added - // set, so they don't get released by our own destructor + // make a note of all models that have been added to the + // document, so they don't get released by our own destructor m_addedModels.insert(modelId); } }