comparison data/model/Model.h @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents d03b3d956358
children a1cd5abcb38b
comparison
equal deleted inserted replaced
1037:bf0e5944289b 1038:cc27f35aa75c
19 #include <vector> 19 #include <vector>
20 #include <QObject> 20 #include <QObject>
21 21
22 #include "base/XmlExportable.h" 22 #include "base/XmlExportable.h"
23 #include "base/Playable.h" 23 #include "base/Playable.h"
24 #include "base/BaseTypes.h"
24 25
25 typedef std::vector<float> SampleBlock; 26 typedef std::vector<float> SampleBlock;
26 27
27 class ZoomConstraint; 28 class ZoomConstraint;
28 class AlignmentModel; 29 class AlignmentModel;
48 virtual bool isOK() const = 0; 49 virtual bool isOK() const = 0;
49 50
50 /** 51 /**
51 * Return the first audio frame spanned by the model. 52 * Return the first audio frame spanned by the model.
52 */ 53 */
53 virtual int getStartFrame() const = 0; 54 virtual sv_frame_t getStartFrame() const = 0;
54 55
55 /** 56 /**
56 * Return the last audio frame spanned by the model. 57 * Return the last audio frame spanned by the model.
57 */ 58 */
58 virtual int getEndFrame() const = 0; 59 virtual sv_frame_t getEndFrame() const = 0;
59 60
60 /** 61 /**
61 * Return the frame rate in frames per second. 62 * Return the frame rate in frames per second.
62 */ 63 */
63 virtual int getSampleRate() const = 0; 64 virtual int getSampleRate() const = 0;
198 199
199 /** 200 /**
200 * Return the frame number of the reference model that corresponds 201 * Return the frame number of the reference model that corresponds
201 * to the given frame number in this model. 202 * to the given frame number in this model.
202 */ 203 */
203 virtual int alignToReference(int frame) const; 204 virtual sv_frame_t alignToReference(sv_frame_t frame) const;
204 205
205 /** 206 /**
206 * Return the frame number in this model that corresponds to the 207 * Return the frame number in this model that corresponds to the
207 * given frame number of the reference model. 208 * given frame number of the reference model.
208 */ 209 */
209 virtual int alignFromReference(int referenceFrame) const; 210 virtual sv_frame_t alignFromReference(sv_frame_t referenceFrame) const;
210 211
211 /** 212 /**
212 * Return the completion percentage for the alignment model: 100 213 * Return the completion percentage for the alignment model: 100
213 * if there is no alignment model or it has been entirely 214 * if there is no alignment model or it has been entirely
214 * calculated, or less than 100 if it is still being calculated. 215 * calculated, or less than 100 if it is still being calculated.
234 QString extraAttributes = "") const; 235 QString extraAttributes = "") const;
235 236
236 virtual QString toDelimitedDataString(QString delimiter) const { 237 virtual QString toDelimitedDataString(QString delimiter) const {
237 return toDelimitedDataStringSubset(delimiter, getStartFrame(), getEndFrame()); 238 return toDelimitedDataStringSubset(delimiter, getStartFrame(), getEndFrame());
238 } 239 }
239 virtual QString toDelimitedDataStringSubset(QString, int /* f0 */, int /* f1 */) const { 240 virtual QString toDelimitedDataStringSubset(QString, sv_frame_t /* f0 */, sv_frame_t /* f1 */) const {
240 return ""; 241 return "";
241 } 242 }
242 243
243 public slots: 244 public slots:
244 void aboutToDelete(); 245 void aboutToDelete();
253 254
254 /** 255 /**
255 * Emitted when a model has been edited (or more data retrieved 256 * Emitted when a model has been edited (or more data retrieved
256 * from cache, in the case of a cached model that generates slowly) 257 * from cache, in the case of a cached model that generates slowly)
257 */ 258 */
258 void modelChangedWithin(int startFrame, int endFrame); 259 void modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame);
259 260
260 /** 261 /**
261 * Emitted when some internal processing has advanced a stage, but 262 * Emitted when some internal processing has advanced a stage, but
262 * the model has not changed externally. Views should respond by 263 * the model has not changed externally. Views should respond by
263 * updating any progress meters or other monitoring, but not 264 * updating any progress meters or other monitoring, but not