Mercurial > hg > svcore
diff data/model/Model.h @ 297:c022976d18e8
* Merge from sv-match-alignment branch (excluding alignment-specific document).
- add aggregate wave model (not yet complete enough to be added as a true
model in a layer, but there's potential)
- add play solo mode
- add alignment model -- unused in plain SV
- fix two plugin leaks
- add m3u playlist support (opens all files at once, potentially hazardous)
- fix retrieval of pre-encoded URLs
- add ability to resample audio files on import, so as to match rates with
other files previously loaded; add preference for same
- add preliminary support in transform code for range and rate of transform
input
- reorganise preferences dialog, move dark-background option to preferences,
add option for temporary directory location
author | Chris Cannam |
---|---|
date | Fri, 28 Sep 2007 13:56:38 +0000 |
parents | 92e8dbde73cd |
children | 70a232b1f12a |
line wrap: on
line diff
--- a/data/model/Model.h Fri Sep 21 09:13:11 2007 +0000 +++ b/data/model/Model.h Fri Sep 28 13:56:38 2007 +0000 @@ -60,6 +60,12 @@ virtual size_t getSampleRate() const = 0; /** + * Return the frame rate of the underlying material, if the model + * itself has already been resampled. + */ + virtual size_t getNativeRate() const { return getSampleRate(); } + + /** * Return a copy of this model. * * If the model is not editable, this may be effectively a shallow @@ -104,6 +110,24 @@ return 0; } + /** + * If this model was derived from another, return the model it was + * derived from. The assumption is that the source model's + * alignment will also apply to this model, unless some other + * property indicates otherwise. + */ + virtual Model *getSourceModel() const { + return m_sourceModel; + } + + /** + * Set the source model for this model. + */ + //!!! No way to handle source model deletion &c yet + virtual void setSourceModel(Model *model) { + m_sourceModel = model; + } + virtual void toXml(QTextStream &stream, QString indent = "", QString extraAttributes = "") const; @@ -135,11 +159,13 @@ void completionChanged(); protected: - Model() { } + Model() : m_sourceModel(0) { } // Not provided. Model(const Model &); Model &operator=(const Model &); + + Model *m_sourceModel; }; #endif