Mercurial > hg > svgui
diff layer/Layer.h @ 1554:a0b2f3b4dd2f spectrogram-export
Start work on spectrogram export code
author | Chris Cannam |
---|---|
date | Mon, 06 Jan 2020 14:46:25 +0000 (2020-01-06) |
parents | e6362cf5ff1d |
children | 073ef72e8e60 |
line wrap: on
line diff
--- a/layer/Layer.h Fri Nov 22 14:12:50 2019 +0000 +++ b/layer/Layer.h Mon Jan 06 14:46:25 2020 +0000 @@ -71,6 +71,30 @@ * model here, return None. */ ModelId getSourceModel() const; + + /** + * Return the ID of a model representing the contents of this + * layer in a form suitable for export to a tabular file format + * such as CSV. + * + * In most cases this will be the same as returned by + * getModel(). The exceptions are those layers such as + * SpectrogramLayer, that are "only" alternative views of + * time-domain sample data. For such layers, getModel() will + * return the backing time-domain data, for example as a + * ReadOnlyWaveFileModel; but getExportModel() will return a + * model, possibly "local to" the layer, which adapts this into + * the form shown in the layer for a given view so that the export + * matches the layer's visible contents. + * + * Because this is supposed to match the contents of the view + * rather than the backing model, it's necessary to pass in a view + * (or LayerGeometryProvider) so that the layer can retrieve its + * vertical extents for export. + */ + virtual ModelId getExportModel(LayerGeometryProvider *) const { + return getModel(); + } /** * Return a zoom constraint object defining the supported zoom