Mercurial > hg > svapp
diff framework/Document.h @ 588:d122d3595a32
Store aggregate models in the document and release them when they are invalidated (because their components have been released). They're no longer leaked, but we still don't save them in the session file.
author | Chris Cannam |
---|---|
date | Mon, 27 Feb 2017 16:26:37 +0000 |
parents | b23db4cef02f |
children | b23bebfdfaba |
line wrap: on
line diff
--- a/framework/Document.h Mon Feb 27 13:24:11 2017 +0000 +++ b/framework/Document.h Mon Feb 27 16:26:37 2017 +0000 @@ -29,6 +29,7 @@ class Layer; class View; class WaveFileModel; +class AggregateWaveModel; class AdditionalModelConverter; @@ -234,6 +235,17 @@ * with a layer. */ void addImportedModel(Model *); + + /** + * Add an aggregate model (one which represents a set of component + * wave models as one model per channel in a single wave + * model). Aggregate models are unusual in that they are created + * for a single transform each and have no refcount. (This + * probably isn't ideal!) They are recorded separately from other + * models, and will be deleted if any of their component models + * are removed. + */ + void addAggregateModel(AggregateWaveModel *); /** * Associate the given model with the given layer. The model must @@ -309,6 +321,9 @@ void activity(QString); +protected slots: + void aggregateModelInvalidated(); + protected: void releaseModel(Model *model); @@ -364,6 +379,8 @@ */ void addAdditionalModel(Model *); + std::set<Model *> m_aggregateModels; + class AddLayerCommand : public Command { public: