comparison data/model/Model.h @ 1453:4b496a258782

Merge from branch streaming-csv-writer
author Chris Cannam
date Tue, 17 Apr 2018 10:52:06 +0100
parents 6e9615bde1f9
children 9d37c8cf9686
comparison
equal deleted inserted replaced
1429:48e9f538e6e9 1453:4b496a258782
51 * Return the first audio frame spanned by the model. 51 * Return the first audio frame spanned by the model.
52 */ 52 */
53 virtual sv_frame_t getStartFrame() const = 0; 53 virtual sv_frame_t getStartFrame() const = 0;
54 54
55 /** 55 /**
56 * Return the last audio frame spanned by the model. 56 * Return the audio frame at the end of the model, i.e. 1 more
57 * than the final frame contained within the model. The end frame
58 * minus the start frame should yield the total duration in frames
59 * spanned by the model. This is consistent with the definition of
60 * the end frame of a Selection object.
57 */ 61 */
58 virtual sv_frame_t getEndFrame() const = 0; 62 virtual sv_frame_t getEndFrame() const = 0;
59 63
60 /** 64 /**
61 * Return the frame rate in frames per second. 65 * Return the frame rate in frames per second.
88 /** 92 /**
89 * Return the type of the model. For display purposes only. 93 * Return the type of the model. For display purposes only.
90 */ 94 */
91 virtual QString getTypeName() const = 0; 95 virtual QString getTypeName() const = 0;
92 96
97 /**
98 * Return true if this is a sparse model.
99 */
100 virtual bool isSparse() const { return false; }
101
93 /** 102 /**
94 * Mark the model as abandoning. This means that the application 103 * Mark the model as abandoning. This means that the application
95 * no longer needs it, so it can stop doing any background 104 * no longer needs it, so it can stop doing any background
96 * calculations it may be involved in. Note that as far as the 105 * calculations it may be involved in. Note that as far as the
97 * model API is concerned, this does nothing more than tell the 106 * model API is concerned, this does nothing more than tell the
218 QString indent = "", 227 QString indent = "",
219 QString extraAttributes = "") const; 228 QString extraAttributes = "") const;
220 229
221 virtual QString toDelimitedDataString(QString delimiter) const { 230 virtual QString toDelimitedDataString(QString delimiter) const {
222 return toDelimitedDataStringSubset 231 return toDelimitedDataStringSubset
223 (delimiter, getStartFrame(), getEndFrame() + 1); 232 (delimiter, getStartFrame(), getEndFrame());
224 } 233 }
225 virtual QString toDelimitedDataStringWithOptions(QString delimiter, DataExportOptions opts) const { 234 virtual QString toDelimitedDataStringWithOptions(QString delimiter, DataExportOptions opts) const {
226 return toDelimitedDataStringSubsetWithOptions 235 return toDelimitedDataStringSubsetWithOptions
227 (delimiter, opts, getStartFrame(), getEndFrame() + 1); 236 (delimiter, opts, getStartFrame(), getEndFrame());
228 } 237 }
229 virtual QString toDelimitedDataStringSubset(QString, sv_frame_t /* f0 */, sv_frame_t /* f1 */) const { 238 virtual QString toDelimitedDataStringSubset(QString, sv_frame_t /* f0 */, sv_frame_t /* f1 */) const {
230 return ""; 239 return "";
231 } 240 }
232 virtual QString toDelimitedDataStringSubsetWithOptions(QString delimiter, DataExportOptions, sv_frame_t f0, sv_frame_t f1) const { 241 virtual QString toDelimitedDataStringSubsetWithOptions(QString delimiter, DataExportOptions, sv_frame_t f0, sv_frame_t f1) const {