View.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_VIEW_H
17 #define SV_VIEW_H
18 
19 #include <QFrame>
20 #include <QProgressBar>
21 
23 
24 #include "base/ZoomConstraint.h"
25 #include "base/PropertyContainer.h"
26 #include "ViewManager.h"
27 #include "base/XmlExportable.h"
28 #include "base/BaseTypes.h"
29 
30 #include "data/model/Model.h"
31 
32 // #define DEBUG_VIEW_WIDGET_PAINT 1
33 
34 class Layer;
36 
37 class QPushButton;
38 
39 #include <map>
40 #include <set>
41 
55 class View : public QFrame,
56  public XmlExportable,
58 {
59  Q_OBJECT
60 
61 public:
66  virtual ~View();
67 
72  int getId() const override { return m_id; }
73 
79  sv_frame_t getStartFrame() const override;
80 
85  void setStartFrame(sv_frame_t);
86 
93  sv_frame_t getCentreFrame() const override { return m_centreFrame; }
94 
98  void setCentreFrame(sv_frame_t f) { setCentreFrame(f, true); }
99 
105  sv_frame_t getEndFrame() const override;
106 
115  int getXForFrame(sv_frame_t frame) const override;
116 
120  sv_frame_t getFrameForX(int x) const override;
121 
127  int getXForViewX(int viewx) const override { return viewx; }
128 
134  int getViewXForX(int x) const override { return x; }
135 
144  double getYForFrequency(double frequency, double minFreq, double maxFreq,
145  bool logarithmic) const override;
146 
153  double getFrequencyForY(double y, double minFreq, double maxFreq,
154  bool logarithmic) const override;
155 
160  ZoomLevel getZoomLevel() const override;
161 
167  virtual void setZoomLevel(ZoomLevel z);
168 
172  virtual void zoom(bool in);
173 
177  virtual void scroll(bool right, bool lots, bool doEmit = true);
178 
184  virtual void addLayer(Layer *v);
185 
191  virtual void removeLayer(Layer *v);
192 
197  virtual int getLayerCount() const { return int(m_layerStack.size()); }
198 
205  virtual Layer *getLayer(int n) {
206  if (in_range_for(m_layerStack, n)) return m_layerStack[n];
207  else return 0;
208  }
209 
217  virtual Layer *getFixedOrderLayer(int n) {
218  if (n < int(m_fixedOrderLayers.size())) return m_fixedOrderLayers[n];
219  else return 0;
220  }
221 
227  virtual Layer *getInteractionLayer();
228 
229  virtual const Layer *getInteractionLayer() const;
230 
245  virtual Layer *getSelectedLayer();
246 
247  virtual const Layer *getSelectedLayer() const;
248 
258  virtual Layer *getTopLayer() {
259  return m_layerStack.empty() ? 0 : m_layerStack[m_layerStack.size()-1];
260  }
261 
262  virtual void setViewManager(ViewManager *m);
263  virtual void setViewManager(ViewManager *m, sv_frame_t initialFrame);
264  ViewManager *getViewManager() const override { return m_manager; }
265 
266  virtual void setFollowGlobalPan(bool f);
267  virtual bool getFollowGlobalPan() const { return m_followPan; }
268 
269  virtual void setFollowGlobalZoom(bool f);
270  virtual bool getFollowGlobalZoom() const { return m_followZoom; }
271 
272  bool hasLightBackground() const override;
273  QColor getForeground() const override;
274  QColor getBackground() const override;
275 
276  void drawMeasurementRect(QPainter &p, const Layer *,
277  QRect rect, bool focus) const override;
278 
279  bool shouldShowFeatureLabels() const override {
281  }
282  bool shouldIlluminateLocalFeatures(const Layer *, QPoint &) const override {
283  return false;
284  }
285  virtual bool shouldIlluminateLocalSelection(QPoint &, bool &, bool &) const {
286  return false;
287  }
288 
289  virtual void setPlaybackFollow(PlaybackFollowMode m);
291 
292  typedef PropertyContainer::PropertyName PropertyName;
293 
294  // We implement the PropertyContainer API, although we don't
295  // actually subclass PropertyContainer. We have our own
296  // PropertyContainer that we can return on request that just
297  // delegates back to us.
298  virtual PropertyContainer::PropertyList getProperties() const;
299  virtual QString getPropertyLabel(const PropertyName &) const;
300  virtual PropertyContainer::PropertyType getPropertyType(const PropertyName &) const;
301  virtual int getPropertyRangeAndValue(const PropertyName &,
302  int *min, int *max, int *deflt) const;
303  virtual QString getPropertyValueLabel(const PropertyName &,
304  int value) const;
305  virtual void setProperty(const PropertyName &, int value);
306  virtual QString getPropertyContainerName() const {
307  return objectName();
308  }
309  virtual QString getPropertyContainerIconName() const = 0;
310 
311  virtual int getPropertyContainerCount() const;
312 
313  // The 0th property container is the view's own; the rest are the
314  // layers in fixed-order series
315  virtual const PropertyContainer *getPropertyContainer(int i) const;
316  virtual PropertyContainer *getPropertyContainer(int i);
317 
322  virtual QImage *renderToNewImage();
323 
328  virtual QImage *renderPartToNewImage(sv_frame_t f0, sv_frame_t f1);
329 
334  virtual QSize getRenderedImageSize();
335 
340  virtual QSize getRenderedPartImageSize(sv_frame_t f0, sv_frame_t f1);
341 
345  virtual bool renderToSvgFile(QString filename);
346 
351  virtual bool renderPartToSvgFile(QString filename,
352  sv_frame_t f0, sv_frame_t f1);
353 
358  bool getVisibleExtentsForUnit(QString unit, double &min, double &max,
359  bool &log) const override;
360 
368  bool getVisibleExtentsForAnyUnit(double &min, double &max,
369  bool &logarithmic, QString &unit) const;
370 
371  int getTextLabelYCoord(const Layer *layer, QPainter &) const override;
372 
373  void toXml(QTextStream &stream, QString indent = "",
374  QString extraAttributes = "") const override;
375 
376  // First frame actually in model, to right of scale, if present
377  virtual sv_frame_t getFirstVisibleFrame() const;
378  virtual sv_frame_t getLastVisibleFrame() const;
379 
380  sv_frame_t getModelsStartFrame() const override;
381  sv_frame_t getModelsEndFrame() const override;
382 
389  QRect getPaintRect() const override;
390 
391  QSize getPaintSize() const override { return getPaintRect().size(); }
392  int getPaintWidth() const override { return getPaintRect().width(); }
393  int getPaintHeight() const override { return getPaintRect().height(); }
394 
395  double scaleSize(double size) const override;
396  int scalePixelSize(int size) const override;
397  double scalePenWidth(double width) const override;
398  QPen scalePen(QPen pen) const override;
399 
400  typedef std::set<ModelId> ModelSet;
401  ModelSet getModels();
402 
404  void setUseAligningProxy(bool uap) {
405  m_useAligningProxy = uap;
406  }
407 
409  ModelId getAligningModel() const;
410  void getAligningAndReferenceModels(ModelId &aligning, ModelId &reference) const;
411  sv_frame_t alignFromReference(sv_frame_t) const;
412  sv_frame_t alignToReference(sv_frame_t) const;
413  sv_frame_t getAlignedPlaybackFrame() const;
414 
415  void updatePaintRect(QRect r) override { update(r); }
416 
417  View *getView() override { return this; }
418  const View *getView() const override { return this; }
419 
420 signals:
421  void propertyContainerAdded(PropertyContainer *pc);
422  void propertyContainerRemoved(PropertyContainer *pc);
423  void propertyContainerPropertyChanged(PropertyContainer *pc);
424  void propertyContainerPropertyRangeChanged(PropertyContainer *pc);
425  void propertyContainerNameChanged(PropertyContainer *pc);
426  void propertyContainerSelected(PropertyContainer *pc);
427  void propertyChanged(PropertyContainer::PropertyName);
428 
429  void layerModelChanged();
430 
431  void cancelButtonPressed(Layer *);
432 
433  void centreFrameChanged(sv_frame_t frame,
434  bool globalScroll,
435  PlaybackFollowMode followMode);
436 
437  void zoomLevelChanged(ZoomLevel level, bool locked);
438 
439  void contextHelpChanged(const QString &);
440 
441 public slots:
442  virtual void modelChanged(ModelId);
443  virtual void modelChangedWithin(ModelId, sv_frame_t startFrame, sv_frame_t endFrame);
444  virtual void modelCompletionChanged(ModelId);
445  virtual void modelAlignmentCompletionChanged(ModelId);
446  virtual void modelReplaced();
447  virtual void layerParametersChanged();
448  virtual void layerParameterRangesChanged();
449  virtual void layerMeasurementRectsChanged();
450  virtual void layerNameChanged();
451 
452  virtual void globalCentreFrameChanged(sv_frame_t);
453  virtual void viewCentreFrameChanged(View *, sv_frame_t);
454  virtual void viewManagerPlaybackFrameChanged(sv_frame_t);
455  virtual void viewZoomLevelChanged(View *, ZoomLevel, bool);
456 
467  virtual void propertyContainerSelected(View *, PropertyContainer *pc);
468 
469  virtual void selectionChanged();
470  virtual void toolModeChanged();
471  virtual void overlayModeChanged();
472  virtual void zoomWheelsEnabledChanged();
473 
474  virtual void cancelClicked();
475 
476  virtual void progressCheckStalledTimerElapsed();
477 
478 protected:
479  View(QWidget *, bool showProgress);
480 
481  int m_id;
482 
483  void paintEvent(QPaintEvent *e) override;
484  virtual void drawSelections(QPainter &);
485  virtual bool shouldLabelSelections() const { return true; }
486  virtual void drawPlayPointer(QPainter &);
487  virtual bool render(QPainter &paint, int x0, sv_frame_t f0, sv_frame_t f1);
488  virtual void setPaintFont(QPainter &paint);
489 
490  QSize scaledSize(const QSize &s, int factor) {
491  return QSize(s.width() * factor, s.height() * factor);
492  }
493  QRect scaledRect(const QRect &r, int factor) {
494  return QRect(r.x() * factor, r.y() * factor,
495  r.width() * factor, r.height() * factor);
496  }
497 
498  typedef std::vector<Layer *> LayerList;
499 
500  sv_samplerate_t getModelsSampleRate() const;
501  bool areLayersScrollable() const;
502  LayerList getScrollableBackLayers(bool testChanged, bool &changed) const;
503  LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const;
504 
505  Layer *getScaleProvidingLayerForUnit(QString unit) const;
506 
507  ZoomLevel getZoomConstraintLevel(ZoomLevel level,
508  ZoomConstraint::RoundingDirection dir =
509  ZoomConstraint::RoundNearest) const;
510 
511  // These three are slow, intended for indexing GUI thumbwheel stuff
512  int countZoomLevels() const;
513  int getZoomLevelIndex(ZoomLevel level) const;
514  ZoomLevel getZoomLevelByIndex(int ix) const;
515 
516  // True if the top layer(s) use colours for meaningful things. If
517  // this is the case, selections will be shown using unfilled boxes
518  // rather than with a translucent fill.
519  bool areLayerColoursSignificant() const;
520 
521  // True if the top layer has a time axis on the x coordinate (this
522  // is generally the case except for spectrum/slice layers). It
523  // will not be possible to make or display selections if this is
524  // false.
525  bool hasTopLayerTimeXAxis() const;
526 
527  bool setCentreFrame(sv_frame_t f, bool doEmit);
528 
529  void movePlayPointer(sv_frame_t f);
530 
531  void checkProgress(ModelId);
532  void checkAlignmentProgress(ModelId);
533 
534  bool waitForLayersToBeReady(); // returns false if user cancelled waiting
535 
536  int getProgressBarWidth() const; // if visible
537 
538  int effectiveDevicePixelRatio() const;
539 
540  sv_frame_t m_centreFrame;
541  ZoomLevel m_zoomLevel;
546  sv_frame_t m_playPointerFrame;
549 
550  QPixmap *m_cache; // I own this
551  QPixmap *m_buffer; // I own this
553  sv_frame_t m_cacheCentreFrame;
554  ZoomLevel m_cacheZoomLevel;
556 
558 
559  LayerList m_layerStack; // I don't own these, but see dtor note above
562 
564 
565  QString m_lastError;
566 
567  // caches for use in getScrollableBackLayers, getNonScrollableFrontLayers
568  mutable LayerList m_lastScrollableBackLayers;
569  mutable LayerList m_lastNonScrollableBackLayers;
570 
571  struct ProgressBarRec {
572  QPushButton *cancel;
573  QProgressBar *bar;
576  };
577  typedef std::map<Layer *, ProgressBarRec> ProgressMap;
578  ProgressMap m_progressBars; // I own the ProgressBarRecs and their contents
579 
581  ModelId alignedModel;
582  QProgressBar *bar;
583  };
585 
586  ViewManager *m_manager; // I don't own this
588 };
589 
590 
591 // Use this for delegation, because we can't subclass from
592 // PropertyContainer (which is a QObject) ourselves because of
593 // ambiguity with QFrame parent
594 
595 class ViewPropertyContainer : public PropertyContainer
596 {
597  Q_OBJECT
598 
599 public:
601  virtual ~ViewPropertyContainer();
602 
603  PropertyList getProperties() const override { return m_v->getProperties(); }
604  QString getPropertyLabel(const PropertyName &n) const override {
605  return m_v->getPropertyLabel(n);
606  }
607  PropertyType getPropertyType(const PropertyName &n) const override {
608  return m_v->getPropertyType(n);
609  }
610  int getPropertyRangeAndValue(const PropertyName &n, int *min, int *max,
611  int *deflt) const override {
612  return m_v->getPropertyRangeAndValue(n, min, max, deflt);
613  }
614  QString getPropertyValueLabel(const PropertyName &n, int value) const override {
615  return m_v->getPropertyValueLabel(n, value);
616  }
617  QString getPropertyContainerName() const override {
618  return m_v->getPropertyContainerName();
619  }
620  QString getPropertyContainerIconName() const override {
621  return m_v->getPropertyContainerIconName();
622  }
623 
624 public slots:
625  void setProperty(const PropertyName &n, int value) override {
626  m_v->setProperty(n, value);
627  }
628 
629 protected:
631 };
632 
633 #endif
634 
void getAligningAndReferenceModels(ModelId &aligning, ModelId &reference) const
Definition: View.cpp:1550
virtual QString getPropertyValueLabel(const PropertyName &, int value) const
Definition: View.cpp:145
void paintEvent(QPaintEvent *e) override
Definition: View.cpp:2225
virtual QString getPropertyContainerName() const
Definition: View.h:306
bool areLayersScrollable() const
Definition: View.cpp:1630
ZoomLevel m_zoomLevel
Definition: View.h:541
bool hasTopLayerTimeXAxis() const
Definition: View.cpp:1870
virtual const PropertyContainer * getPropertyContainer(int i) const
Definition: View.cpp:183
void propertyContainerNameChanged(PropertyContainer *pc)
sv_frame_t alignFromReference(sv_frame_t) const
Definition: View.cpp:1597
The base class for visual representations of the data found in a Model.
Definition: Layer.h:54
sv_frame_t m_playPointerFrame
Definition: View.h:546
AlignmentProgressBarRec m_alignmentProgressBar
Definition: View.h:584
bool waitForLayersToBeReady()
Definition: View.cpp:3006
virtual QImage * renderToNewImage()
Render the view contents to a new QImage (which may be wider than the visible View).
Definition: View.cpp:3151
virtual void modelChangedWithin(ModelId, sv_frame_t startFrame, sv_frame_t endFrame)
Definition: View.cpp:1137
void movePlayPointer(sv_frame_t f)
Definition: View.cpp:1289
bool m_lightBackground
Definition: View.h:547
int getXForViewX(int viewx) const override
Return the closest pixel x-coordinate corresponding to a given view x-coordinate. ...
Definition: View.h:127
void checkAlignmentProgress(ModelId)
Definition: View.cpp:2080
LayerList m_fixedOrderLayers
Definition: View.h:560
void propertyContainerSelected(PropertyContainer *pc)
QString m_lastError
Definition: View.h:565
bool m_followPlayIsDetached
Definition: View.h:545
bool m_followZoom
Definition: View.h:543
bool m_deleting
Definition: View.h:557
View * getView() override
Definition: View.h:417
int scalePixelSize(int size) const override
Definition: View.cpp:1834
int getId() const override
Retrieve the id of this object.
Definition: View.h:72
QString getPropertyLabel(const PropertyName &n) const override
Definition: View.h:604
LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const
Definition: View.cpp:1676
virtual void setProperty(const PropertyName &, int value)
Definition: View.cpp:160
void updatePaintRect(QRect r) override
Definition: View.h:415
void propertyContainerRemoved(PropertyContainer *pc)
bool getVisibleExtentsForUnit(QString unit, double &min, double &max, bool &log) const override
Return the visible vertical extents for the given unit, if any.
Definition: View.cpp:197
ZoomLevel getZoomConstraintLevel(ZoomLevel level, ZoomConstraint::RoundingDirection dir=ZoomConstraint::RoundNearest) const
Definition: View.cpp:1708
sv_samplerate_t getModelsSampleRate() const
Definition: View.cpp:1500
double getFrequencyForY(double y, double minFreq, double maxFreq, bool logarithmic) const override
Return the closest frequency to the given pixel y-coordinate, if the frequency range is as specified...
Definition: View.cpp:700
ZoomLevel m_cacheZoomLevel
Definition: View.h:554
virtual void modelReplaced()
Definition: View.cpp:1202
virtual int getLayerCount() const
Return the number of layers, regardless of whether visible or dormant, i.e.
Definition: View.h:197
int getViewXForX(int x) const override
Return the closest view x-coordinate corresponding to a given pixel x-coordinate. ...
Definition: View.h:134
QProgressBar * bar
Definition: View.h:582
int effectiveDevicePixelRatio() const
Definition: View.cpp:741
virtual void modelChanged(ModelId)
Definition: View.cpp:1104
double scalePenWidth(double width) const override
Definition: View.cpp:1843
virtual void zoom(bool in)
Zoom in or out.
Definition: View.cpp:1879
virtual ~View()
Deleting a View does not delete any of its layers.
Definition: View.cpp:83
sv_frame_t getCentreFrame() const override
Return the centre frame of the visible widget.
Definition: View.h:93
QColor getForeground() const override
Definition: View.cpp:824
ProgressMap m_progressBars
Definition: View.h:578
int getPropertyRangeAndValue(const PropertyName &n, int *min, int *max, int *deflt) const override
Definition: View.h:610
bool shouldShowFeatureLabels() const
Definition: ViewManager.h:243
sv_frame_t alignToReference(sv_frame_t) const
Definition: View.cpp:1606
virtual void selectionChanged()
Definition: View.cpp:1423
std::vector< Layer * > LayerList
Definition: View.h:498
QTimer * stallCheckTimer
Definition: View.h:575
void propertyContainerPropertyChanged(PropertyContainer *pc)
PropertyType getPropertyType(const PropertyName &n) const override
Definition: View.h:607
virtual void layerParameterRangesChanged()
Definition: View.cpp:1229
virtual int getPropertyRangeAndValue(const PropertyName &, int *min, int *max, int *deflt) const
Definition: View.cpp:122
virtual void addLayer(Layer *v)
Add a layer to the view.
Definition: View.cpp:838
LayerList m_layerStack
Definition: View.h:559
bool areLayerColoursSignificant() const
Definition: View.cpp:1859
virtual void drawPlayPointer(QPainter &)
Definition: View.cpp:2733
void checkProgress(ModelId)
Definition: View.cpp:1946
virtual Layer * getTopLayer()
Return the "top" layer in the view, whether visible or dormant.
Definition: View.h:258
virtual void setViewManager(ViewManager *m)
Definition: View.cpp:1002
virtual bool shouldLabelSelections() const
Definition: View.h:485
void propertyContainerAdded(PropertyContainer *pc)
sv_frame_t m_cacheCentreFrame
Definition: View.h:553
QRect scaledRect(const QRect &r, int factor)
Definition: View.h:493
Interface for classes that provide geometry information (such as size, start frame, and a large number of other properties) about the disposition of a layer.
virtual void setPaintFont(QPainter &paint)
Definition: View.cpp:2190
virtual QSize getRenderedImageSize()
Calculate and return the size of image that will be generated by renderToNewImage().
Definition: View.cpp:3183
ViewManager * m_manager
Definition: View.h:586
bool shouldIlluminateLocalFeatures(const Layer *, QPoint &) const override
Definition: View.h:282
void centreFrameChanged(sv_frame_t frame, bool globalScroll, PlaybackFollowMode followMode)
virtual QImage * renderPartToNewImage(sv_frame_t f0, sv_frame_t f1)
Render the view contents between the given frame extents to a new QImage (which may be wider than the...
Definition: View.cpp:3164
sv_frame_t getFrameForX(int x) const override
Return the closest frame to the given pixel x-coordinate.
Definition: View.cpp:600
int getPaintWidth() const override
Definition: View.h:392
ZoomLevel getZoomLevel() const override
Return the zoom level, i.e.
Definition: View.cpp:732
virtual bool render(QPainter &paint, int x0, sv_frame_t f0, sv_frame_t f1)
Definition: View.cpp:3078
virtual PropertyContainer::PropertyType getPropertyType(const PropertyName &) const
Definition: View.cpp:113
QColor getBackground() const override
Definition: View.cpp:804
void setStartFrame(sv_frame_t)
Set the widget pan based on the given first visible frame.
Definition: View.cpp:457
virtual void viewZoomLevelChanged(View *, ZoomLevel, bool)
Definition: View.cpp:1412
virtual void modelCompletionChanged(ModelId)
Definition: View.cpp:1184
int getZoomLevelIndex(ZoomLevel level) const
Definition: View.cpp:1782
virtual void cancelClicked()
Definition: View.cpp:1925
sv_frame_t getAlignedPlaybackFrame() const
Definition: View.cpp:1615
void propertyChanged(PropertyContainer::PropertyName)
Layer * getScaleProvidingLayerForUnit(QString unit) const
Definition: View.cpp:246
void cancelButtonPressed(Layer *)
const View * getView() const override
Definition: View.h:418
int getTextLabelYCoord(const Layer *layer, QPainter &) const override
Return a y-coordinate at which text labels for individual items in a layer may be drawn...
Definition: View.cpp:367
void setProperty(const PropertyName &n, int value) override
Definition: View.h:625
bool m_selectionCached
Definition: View.h:555
PlaybackFollowMode
Definition: ViewManager.h:38
virtual void setZoomLevel(ZoomLevel z)
Set the zoom level, i.e.
Definition: View.cpp:760
QSize scaledSize(const QSize &s, int factor)
Definition: View.h:490
QString getPropertyContainerIconName() const override
Definition: View.h:620
int countZoomLevels() const
Definition: View.cpp:1738
LayerList getScrollableBackLayers(bool testChanged, bool &changed) const
Definition: View.cpp:1640
virtual void layerParametersChanged()
Definition: View.cpp:1212
virtual bool renderToSvgFile(QString filename)
Render the view contents to a new SVG file.
Definition: View.cpp:3201
ZoomLevel getZoomLevelByIndex(int ix) const
Definition: View.cpp:1757
ModelId getAligningModel() const
!!
Definition: View.cpp:1542
QRect getPaintRect() const override
To be called from a layer, to obtain the extent of the surface that the layer is currently painting t...
Definition: View.cpp:2219
bool m_cacheValid
Definition: View.h:552
virtual bool shouldIlluminateLocalSelection(QPoint &, bool &, bool &) const
Definition: View.h:285
virtual Layer * getFixedOrderLayer(int n)
Return the nth layer, counted in the order they were added.
Definition: View.h:217
virtual PlaybackFollowMode getPlaybackFollow() const
Definition: View.h:290
int lastStallCheckValue
Definition: View.h:574
QPushButton * cancel
Definition: View.h:572
bool m_useAligningProxy
Definition: View.h:563
virtual sv_frame_t getLastVisibleFrame() const
Definition: View.cpp:1442
sv_frame_t m_centreFrame
Definition: View.h:540
PropertyContainer::PropertyName PropertyName
Definition: View.h:292
QProgressBar * bar
Definition: View.h:573
bool shouldShowFeatureLabels() const override
Definition: View.h:279
bool m_haveSelectedLayer
Definition: View.h:561
virtual void drawSelections(QPainter &)
Definition: View.cpp:2571
void setUseAligningProxy(bool uap)
!!??? poor name, probably poor api, consider this
Definition: View.h:404
virtual bool getFollowGlobalPan() const
Definition: View.h:267
virtual void layerNameChanged()
Definition: View.cpp:1243
virtual Layer * getLayer(int n)
Return the nth layer, counted in stacking order.
Definition: View.h:205
QSize getPaintSize() const override
Definition: View.h:391
PlaybackFollowMode m_followPlay
Definition: View.h:544
void contextHelpChanged(const QString &)
void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const override
Definition: View.cpp:3230
virtual void progressCheckStalledTimerElapsed()
Definition: View.cpp:2146
void setCentreFrame(sv_frame_t f)
Set the centre frame of the visible widget.
Definition: View.h:98
virtual int getPropertyContainerCount() const
Definition: View.cpp:177
LayerList m_lastScrollableBackLayers
Definition: View.h:568
virtual void setFollowGlobalPan(bool f)
Definition: View.cpp:1083
QString getPropertyContainerName() const override
Definition: View.h:617
virtual PropertyContainer::PropertyList getProperties() const
Definition: View.cpp:94
int getProgressBarWidth() const
Definition: View.cpp:2173
QPixmap * m_buffer
Definition: View.h:551
sv_frame_t getModelsStartFrame() const override
Definition: View.cpp:1451
bool hasLightBackground() const override
Definition: View.cpp:774
void propertyContainerPropertyRangeChanged(PropertyContainer *pc)
virtual void setPlaybackFollow(PlaybackFollowMode m)
Definition: View.cpp:1097
virtual void modelAlignmentCompletionChanged(ModelId)
Definition: View.cpp:1193
bool m_followPan
Definition: View.h:542
virtual QString getPropertyLabel(const PropertyName &) const
Definition: View.cpp:104
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
Definition: View.h:55
virtual void removeLayer(Layer *v)
Remove a layer from the view.
Definition: View.cpp:905
virtual void viewManagerPlaybackFrameChanged(sv_frame_t)
Definition: View.cpp:1269
The ViewManager manages properties that may need to be synchronised between separate Views...
Definition: ViewManager.h:78
virtual void toolModeChanged()
Definition: View.cpp:426
virtual void zoomWheelsEnabledChanged()
Definition: View.cpp:439
View(QWidget *, bool showProgress)
Definition: View.cpp:56
int m_id
Definition: View.h:481
virtual bool getFollowGlobalZoom() const
Definition: View.h:270
std::map< Layer *, ProgressBarRec > ProgressMap
Definition: View.h:577
bool m_showProgress
Definition: View.h:548
LayerList m_lastNonScrollableBackLayers
Definition: View.h:569
sv_frame_t getStartFrame() const override
Retrieve the first visible sample frame on the widget.
Definition: View.cpp:445
double scaleSize(double size) const override
Definition: View.cpp:1807
int getPaintHeight() const override
Definition: View.h:393
virtual Layer * getSelectedLayer()
Return the layer most recently selected by the user.
Definition: View.cpp:986
virtual void overlayModeChanged()
Definition: View.cpp:432
QString getPropertyValueLabel(const PropertyName &n, int value) const override
Definition: View.h:614
sv_frame_t getModelsEndFrame() const override
Definition: View.cpp:1475
bool getVisibleExtentsForAnyUnit(double &min, double &max, bool &logarithmic, QString &unit) const
Return some visible vertical extents and unit.
Definition: View.cpp:323
virtual void scroll(bool right, bool lots, bool doEmit=true)
Scroll left or right by a smallish or largish amount.
Definition: View.cpp:1899
sv_frame_t getEndFrame() const override
Retrieve the last visible sample frame on the widget.
Definition: View.cpp:451
virtual void setFollowGlobalZoom(bool f)
Definition: View.cpp:1090
QPen scalePen(QPen pen) const override
Definition: View.cpp:1853
PropertyList getProperties() const override
Definition: View.h:603
double getYForFrequency(double frequency, double minFreq, double maxFreq, bool logarithmic) const override
Return the pixel y-coordinate corresponding to a given frequency, if the frequency range is as specif...
Definition: View.cpp:666
virtual void viewCentreFrameChanged(View *, sv_frame_t)
Definition: View.cpp:1263
void layerModelChanged()
void drawMeasurementRect(QPainter &p, const Layer *, QRect rect, bool focus) const override
Definition: View.cpp:2767
virtual sv_frame_t getFirstVisibleFrame() const
Definition: View.cpp:1433
virtual Layer * getInteractionLayer()
Return the layer currently active for tool interaction.
Definition: View.cpp:960
ViewManager * getViewManager() const override
Definition: View.h:264
void zoomLevelChanged(ZoomLevel level, bool locked)
ModelSet getModels()
Definition: View.cpp:1521
virtual QString getPropertyContainerIconName() const =0
virtual void layerMeasurementRectsChanged()
Definition: View.cpp:1236
virtual void globalCentreFrameChanged(sv_frame_t)
Definition: View.cpp:1250
virtual bool renderPartToSvgFile(QString filename, sv_frame_t f0, sv_frame_t f1)
Render the view contents between the given frame extents to a new SVG file.
Definition: View.cpp:3210
QPixmap * m_cache
Definition: View.h:550
int getXForFrame(sv_frame_t frame) const override
Return the pixel x-coordinate corresponding to a given sample frame.
Definition: View.cpp:527
ViewPropertyContainer * m_propertyContainer
Definition: View.h:587
std::set< ModelId > ModelSet
Definition: View.h:400
virtual QSize getRenderedPartImageSize(sv_frame_t f0, sv_frame_t f1)
Calculate and return the size of image that will be generated by renderPartToNewImage(f0, f1).
Definition: View.cpp:3192