Chris@193: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@193: Chris@193: /* Chris@193: Sonic Visualiser Chris@193: An audio file viewer and annotation editor. Chris@193: Centre for Digital Music, Queen Mary, University of London. Chris@193: This file copyright 2007 QMUL. Chris@193: Chris@193: This program is free software; you can redistribute it and/or Chris@193: modify it under the terms of the GNU General Public License as Chris@193: published by the Free Software Foundation; either version 2 of the Chris@193: License, or (at your option) any later version. See the file Chris@193: COPYING included with this distribution for more information. Chris@193: */ Chris@193: Chris@193: #ifndef _SLICEABLE_LAYER_H_ Chris@193: #define _SLICEABLE_LAYER_H_ Chris@193: Chris@193: #include "Layer.h" Chris@193: Chris@193: /** Chris@193: * Base class for layers that can be sliced, that is, that contain Chris@193: * models appropriate for use in a SliceLayer. Chris@193: */ Chris@193: Chris@193: class SliceableLayer : public Layer Chris@193: { Chris@193: Q_OBJECT Chris@193: Chris@193: public: Chris@193: // Get a model that can be sliced, i.e. a Chris@193: // DenseThreeDimensionalModel. This may be the layer's usual Chris@193: // model, or it may be a model derived from it (e.g. FFTModel in a Chris@193: // spectrogram that was constructed from a DenseTimeValueModel). Chris@193: // The SliceableLayer retains ownership of the model, and will Chris@193: // emit sliceableModelReplaced if it is about to become invalid. Chris@193: virtual const Model *getSliceableModel() const = 0; Chris@193: Chris@193: signals: Chris@193: // Emitted when a model that was obtained through Chris@193: // getSliceableModel is about to be deleted. If replacement is Chris@193: // non-NULL, it may be used instead. Chris@193: void sliceableModelReplaced(const Model *modelToBeReplaced, Chris@193: const Model *replacement); Chris@193: }; Chris@193: Chris@193: #endif Chris@193: Chris@193: Chris@193: