comparison 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
comparison
equal deleted inserted replaced
296:2b6c99b607f1 297:c022976d18e8
58 * Return the frame rate in frames per second. 58 * Return the frame rate in frames per second.
59 */ 59 */
60 virtual size_t getSampleRate() const = 0; 60 virtual size_t getSampleRate() const = 0;
61 61
62 /** 62 /**
63 * Return the frame rate of the underlying material, if the model
64 * itself has already been resampled.
65 */
66 virtual size_t getNativeRate() const { return getSampleRate(); }
67
68 /**
63 * Return a copy of this model. 69 * Return a copy of this model.
64 * 70 *
65 * If the model is not editable, this may be effectively a shallow 71 * If the model is not editable, this may be effectively a shallow
66 * copy. If the model is editable, however, this operation must 72 * copy. If the model is editable, however, this operation must
67 * properly copy all of the model's editable data. 73 * properly copy all of the model's editable data.
102 */ 108 */
103 virtual const ZoomConstraint *getZoomConstraint() const { 109 virtual const ZoomConstraint *getZoomConstraint() const {
104 return 0; 110 return 0;
105 } 111 }
106 112
113 /**
114 * If this model was derived from another, return the model it was
115 * derived from. The assumption is that the source model's
116 * alignment will also apply to this model, unless some other
117 * property indicates otherwise.
118 */
119 virtual Model *getSourceModel() const {
120 return m_sourceModel;
121 }
122
123 /**
124 * Set the source model for this model.
125 */
126 //!!! No way to handle source model deletion &c yet
127 virtual void setSourceModel(Model *model) {
128 m_sourceModel = model;
129 }
130
107 virtual void toXml(QTextStream &stream, 131 virtual void toXml(QTextStream &stream,
108 QString indent = "", 132 QString indent = "",
109 QString extraAttributes = "") const; 133 QString extraAttributes = "") const;
110 134
111 virtual QString toXmlString(QString indent = "", 135 virtual QString toXmlString(QString indent = "",
133 * refreshing the actual view. 157 * refreshing the actual view.
134 */ 158 */
135 void completionChanged(); 159 void completionChanged();
136 160
137 protected: 161 protected:
138 Model() { } 162 Model() : m_sourceModel(0) { }
139 163
140 // Not provided. 164 // Not provided.
141 Model(const Model &); 165 Model(const Model &);
142 Model &operator=(const Model &); 166 Model &operator=(const Model &);
167
168 Model *m_sourceModel;
143 }; 169 };
144 170
145 #endif 171 #endif