comparison view/View.h @ 806:4c8ca536b54f warnfix_no_size_t

Some more unsigned/long removal
author Chris Cannam
date Tue, 17 Jun 2014 15:36:56 +0100
parents 56ba2b03508e
children 40c6c9344ff6
comparison
equal deleted inserted replaced
805:1d526ba11a24 806:4c8ca536b54f
60 /** 60 /**
61 * Retrieve the first visible sample frame on the widget. 61 * Retrieve the first visible sample frame on the widget.
62 * This is a calculated value based on the centre-frame, widget 62 * This is a calculated value based on the centre-frame, widget
63 * width and zoom level. The result may be negative. 63 * width and zoom level. The result may be negative.
64 */ 64 */
65 long getStartFrame() const; 65 int getStartFrame() const;
66 66
67 /** 67 /**
68 * Set the widget pan based on the given first visible frame. The 68 * Set the widget pan based on the given first visible frame. The
69 * frame value may be negative. 69 * frame value may be negative.
70 */ 70 */
71 void setStartFrame(long); 71 void setStartFrame(int);
72 72
73 /** 73 /**
74 * Return the centre frame of the visible widget. This is an 74 * Return the centre frame of the visible widget. This is an
75 * exact value that does not depend on the zoom block size. Other 75 * exact value that does not depend on the zoom block size. Other
76 * frame values (start, end) are calculated from this based on the 76 * frame values (start, end) are calculated from this based on the
77 * zoom and other factors. 77 * zoom and other factors.
78 */ 78 */
79 size_t getCentreFrame() const { return m_centreFrame; } 79 int getCentreFrame() const { return m_centreFrame; }
80 80
81 /** 81 /**
82 * Set the centre frame of the visible widget. 82 * Set the centre frame of the visible widget.
83 */ 83 */
84 void setCentreFrame(size_t f) { setCentreFrame(f, true); } 84 void setCentreFrame(int f) { setCentreFrame(f, true); }
85 85
86 /** 86 /**
87 * Retrieve the last visible sample frame on the widget. 87 * Retrieve the last visible sample frame on the widget.
88 * This is a calculated value based on the centre-frame, widget 88 * This is a calculated value based on the centre-frame, widget
89 * width and zoom level. 89 * width and zoom level.
90 */ 90 */
91 size_t getEndFrame() const; 91 int getEndFrame() const;
92 92
93 /** 93 /**
94 * Return the pixel x-coordinate corresponding to a given sample 94 * Return the pixel x-coordinate corresponding to a given sample
95 * frame (which may be negative). 95 * frame (which may be negative).
96 */ 96 */
97 int getXForFrame(long frame) const; 97 int getXForFrame(int frame) const;
98 98
99 /** 99 /**
100 * Return the closest frame to the given pixel x-coordinate. 100 * Return the closest frame to the given pixel x-coordinate.
101 */ 101 */
102 long getFrameForX(int x) const; 102 int getFrameForX(int x) const;
103 103
104 /** 104 /**
105 * Return the pixel y-coordinate corresponding to a given 105 * Return the pixel y-coordinate corresponding to a given
106 * frequency, if the frequency range is as specified. This does 106 * frequency, if the frequency range is as specified. This does
107 * not imply any policy about layer frequency ranges, but it might 107 * not imply any policy about layer frequency ranges, but it might
129 /** 129 /**
130 * Set the zoom level, i.e. the number of frames per pixel. The 130 * Set the zoom level, i.e. the number of frames per pixel. The
131 * centre frame will be unchanged; the start and end frames will 131 * centre frame will be unchanged; the start and end frames will
132 * change. 132 * change.
133 */ 133 */
134 virtual void setZoomLevel(size_t z); 134 virtual void setZoomLevel(int z);
135 135
136 /** 136 /**
137 * Zoom in or out. 137 * Zoom in or out.
138 */ 138 */
139 virtual void zoom(bool in); 139 virtual void zoom(bool in);
173 */ 173 */
174 virtual Layer *getSelectedLayer(); 174 virtual Layer *getSelectedLayer();
175 virtual const Layer *getSelectedLayer() const; 175 virtual const Layer *getSelectedLayer() const;
176 176
177 virtual void setViewManager(ViewManager *m); 177 virtual void setViewManager(ViewManager *m);
178 virtual void setViewManager(ViewManager *m, long initialFrame); 178 virtual void setViewManager(ViewManager *m, int initialFrame);
179 virtual ViewManager *getViewManager() const { return m_manager; } 179 virtual ViewManager *getViewManager() const { return m_manager; }
180 180
181 virtual void setFollowGlobalPan(bool f); 181 virtual void setFollowGlobalPan(bool f);
182 virtual bool getFollowGlobalPan() const { return m_followPan; } 182 virtual bool getFollowGlobalPan() const { return m_followPan; }
183 183
230 virtual QString getPropertyContainerName() const { 230 virtual QString getPropertyContainerName() const {
231 return objectName(); 231 return objectName();
232 } 232 }
233 virtual QString getPropertyContainerIconName() const = 0; 233 virtual QString getPropertyContainerIconName() const = 0;
234 234
235 virtual size_t getPropertyContainerCount() const; 235 virtual int getPropertyContainerCount() const;
236 236
237 virtual const PropertyContainer *getPropertyContainer(size_t i) const; 237 virtual const PropertyContainer *getPropertyContainer(int i) const;
238 virtual PropertyContainer *getPropertyContainer(size_t i); 238 virtual PropertyContainer *getPropertyContainer(int i);
239 239
240 // Render the contents on a wide canvas 240 // Render the contents on a wide canvas
241 virtual QImage *toNewImage(size_t f0, size_t f1); 241 virtual QImage *toNewImage(int f0, int f1);
242 virtual QImage *toNewImage(); 242 virtual QImage *toNewImage();
243 virtual QSize getImageSize(size_t f0, size_t f1); 243 virtual QSize getImageSize(int f0, int f1);
244 virtual QSize getImageSize(); 244 virtual QSize getImageSize();
245 245
246 virtual int getTextLabelHeight(const Layer *layer, QPainter &) const; 246 virtual int getTextLabelHeight(const Layer *layer, QPainter &) const;
247 247
248 virtual bool getValueExtents(QString unit, float &min, float &max, 248 virtual bool getValueExtents(QString unit, float &min, float &max,
250 250
251 virtual void toXml(QTextStream &stream, QString indent = "", 251 virtual void toXml(QTextStream &stream, QString indent = "",
252 QString extraAttributes = "") const; 252 QString extraAttributes = "") const;
253 253
254 // First frame actually in model, to right of scale, if present 254 // First frame actually in model, to right of scale, if present
255 virtual size_t getFirstVisibleFrame() const; 255 virtual int getFirstVisibleFrame() const;
256 virtual size_t getLastVisibleFrame() const; 256 virtual int getLastVisibleFrame() const;
257 257
258 size_t getModelsStartFrame() const; 258 int getModelsStartFrame() const;
259 size_t getModelsEndFrame() const; 259 int getModelsEndFrame() const;
260 260
261 typedef std::set<Model *> ModelSet; 261 typedef std::set<Model *> ModelSet;
262 ModelSet getModels(); 262 ModelSet getModels();
263 263
264 //!!! 264 //!!!
265 Model *getAligningModel() const; 265 Model *getAligningModel() const;
266 size_t alignFromReference(size_t) const; 266 int alignFromReference(int) const;
267 size_t alignToReference(size_t) const; 267 int alignToReference(int) const;
268 int getAlignedPlaybackFrame() const; 268 int getAlignedPlaybackFrame() const;
269 269
270 signals: 270 signals:
271 void propertyContainerAdded(PropertyContainer *pc); 271 void propertyContainerAdded(PropertyContainer *pc);
272 void propertyContainerRemoved(PropertyContainer *pc); 272 void propertyContainerRemoved(PropertyContainer *pc);
276 void propertyContainerSelected(PropertyContainer *pc); 276 void propertyContainerSelected(PropertyContainer *pc);
277 void propertyChanged(PropertyContainer::PropertyName); 277 void propertyChanged(PropertyContainer::PropertyName);
278 278
279 void layerModelChanged(); 279 void layerModelChanged();
280 280
281 void centreFrameChanged(unsigned long frame, 281 void centreFrameChanged(int frame,
282 bool globalScroll, 282 bool globalScroll,
283 PlaybackFollowMode followMode); 283 PlaybackFollowMode followMode);
284 284
285 void zoomLevelChanged(unsigned long, bool); 285 void zoomLevelChanged(int, bool);
286 286
287 void contextHelpChanged(const QString &); 287 void contextHelpChanged(const QString &);
288 288
289 public slots: 289 public slots:
290 virtual void modelChanged(); 290 virtual void modelChanged();
291 virtual void modelChanged(size_t startFrame, size_t endFrame); 291 virtual void modelChangedWithin(int startFrame, int endFrame);
292 virtual void modelCompletionChanged(); 292 virtual void modelCompletionChanged();
293 virtual void modelAlignmentCompletionChanged(); 293 virtual void modelAlignmentCompletionChanged();
294 virtual void modelReplaced(); 294 virtual void modelReplaced();
295 virtual void layerParametersChanged(); 295 virtual void layerParametersChanged();
296 virtual void layerParameterRangesChanged(); 296 virtual void layerParameterRangesChanged();
297 virtual void layerMeasurementRectsChanged(); 297 virtual void layerMeasurementRectsChanged();
298 virtual void layerNameChanged(); 298 virtual void layerNameChanged();
299 299
300 virtual void globalCentreFrameChanged(unsigned long); 300 virtual void globalCentreFrameChanged(int);
301 virtual void viewCentreFrameChanged(View *, unsigned long); 301 virtual void viewCentreFrameChanged(View *, int);
302 virtual void viewManagerPlaybackFrameChanged(unsigned long); 302 virtual void viewManagerPlaybackFrameChanged(int);
303 virtual void viewZoomLevelChanged(View *, unsigned long, bool); 303 virtual void viewZoomLevelChanged(View *, int, bool);
304 304
305 virtual void propertyContainerSelected(View *, PropertyContainer *pc); 305 virtual void propertyContainerSelected(View *, PropertyContainer *pc);
306 306
307 virtual void selectionChanged(); 307 virtual void selectionChanged();
308 virtual void toolModeChanged(); 308 virtual void toolModeChanged();
314 protected: 314 protected:
315 View(QWidget *, bool showProgress); 315 View(QWidget *, bool showProgress);
316 virtual void paintEvent(QPaintEvent *e); 316 virtual void paintEvent(QPaintEvent *e);
317 virtual void drawSelections(QPainter &); 317 virtual void drawSelections(QPainter &);
318 virtual bool shouldLabelSelections() const { return true; } 318 virtual bool shouldLabelSelections() const { return true; }
319 virtual bool render(QPainter &paint, int x0, size_t f0, size_t f1); 319 virtual bool render(QPainter &paint, int x0, int f0, int f1);
320 virtual void setPaintFont(QPainter &paint); 320 virtual void setPaintFont(QPainter &paint);
321 321
322 typedef std::vector<Layer *> LayerList; 322 typedef std::vector<Layer *> LayerList;
323 323
324 int getModelsSampleRate() const; 324 int getModelsSampleRate() const;
325 bool areLayersScrollable() const; 325 bool areLayersScrollable() const;
326 LayerList getScrollableBackLayers(bool testChanged, bool &changed) const; 326 LayerList getScrollableBackLayers(bool testChanged, bool &changed) const;
327 LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const; 327 LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const;
328 size_t getZoomConstraintBlockSize(size_t blockSize, 328 int getZoomConstraintBlockSize(int blockSize,
329 ZoomConstraint::RoundingDirection dir = 329 ZoomConstraint::RoundingDirection dir =
330 ZoomConstraint::RoundNearest) const; 330 ZoomConstraint::RoundNearest) const;
331 331
332 // True if the top layer(s) use colours for meaningful things. If 332 // True if the top layer(s) use colours for meaningful things. If
333 // this is the case, selections will be shown using unfilled boxes 333 // this is the case, selections will be shown using unfilled boxes
338 // is generally the case except for spectrum/slice layers). It 338 // is generally the case except for spectrum/slice layers). It
339 // will not be possible to make or display selections if this is 339 // will not be possible to make or display selections if this is
340 // false. 340 // false.
341 bool hasTopLayerTimeXAxis() const; 341 bool hasTopLayerTimeXAxis() const;
342 342
343 bool setCentreFrame(size_t f, bool doEmit); 343 bool setCentreFrame(int f, bool doEmit);
344 344
345 void movePlayPointer(unsigned long f); 345 void movePlayPointer(int f);
346 346
347 void checkProgress(void *object); 347 void checkProgress(void *object);
348 int getProgressBarWidth() const; // if visible 348 int getProgressBarWidth() const; // if visible
349 349
350 size_t m_centreFrame; 350 int m_centreFrame;
351 int m_zoomLevel; 351 int m_zoomLevel;
352 bool m_followPan; 352 bool m_followPan;
353 bool m_followZoom; 353 bool m_followZoom;
354 PlaybackFollowMode m_followPlay; 354 PlaybackFollowMode m_followPlay;
355 size_t m_playPointerFrame; 355 int m_playPointerFrame;
356 bool m_lightBackground; 356 bool m_lightBackground;
357 bool m_showProgress; 357 bool m_showProgress;
358 358
359 QPixmap *m_cache; 359 QPixmap *m_cache;
360 size_t m_cacheCentreFrame; 360 int m_cacheCentreFrame;
361 int m_cacheZoomLevel; 361 int m_cacheZoomLevel;
362 bool m_selectionCached; 362 bool m_selectionCached;
363 363
364 bool m_deleting; 364 bool m_deleting;
365 365