comparison view/View.h @ 1266:a34a2a25907c

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 37f86e26a8d2
children 13d9b422f7fe
comparison
equal deleted inserted replaced
1265:6e724c81f18f 1266:a34a2a25907c
49 * mechanisms for doing so (as well as any other operations and 49 * mechanisms for doing so (as well as any other operations and
50 * properties available) depend on the subclass. 50 * properties available) depend on the subclass.
51 */ 51 */
52 52
53 class View : public QFrame, 53 class View : public QFrame,
54 public XmlExportable, 54 public XmlExportable,
55 public LayerGeometryProvider 55 public LayerGeometryProvider
56 { 56 {
57 Q_OBJECT 57 Q_OBJECT
58 58
59 public: 59 public:
134 * be useful for layers to match theirs up if desired. 134 * be useful for layers to match theirs up if desired.
135 * 135 *
136 * Not thread-safe in logarithmic mode. Call only from GUI thread. 136 * Not thread-safe in logarithmic mode. Call only from GUI thread.
137 */ 137 */
138 double getYForFrequency(double frequency, double minFreq, double maxFreq, 138 double getYForFrequency(double frequency, double minFreq, double maxFreq,
139 bool logarithmic) const; 139 bool logarithmic) const;
140 140
141 /** 141 /**
142 * Return the closest frequency to the given pixel y-coordinate, 142 * Return the closest frequency to the given pixel y-coordinate,
143 * if the frequency range is as specified. 143 * if the frequency range is as specified.
144 * 144 *
271 271
272 virtual bool shouldShowFeatureLabels() const { 272 virtual bool shouldShowFeatureLabels() const {
273 return m_manager && m_manager->shouldShowFeatureLabels(); 273 return m_manager && m_manager->shouldShowFeatureLabels();
274 } 274 }
275 virtual bool shouldIlluminateLocalFeatures(const Layer *, QPoint &) const { 275 virtual bool shouldIlluminateLocalFeatures(const Layer *, QPoint &) const {
276 return false; 276 return false;
277 } 277 }
278 virtual bool shouldIlluminateLocalSelection(QPoint &, bool &, bool &) const { 278 virtual bool shouldIlluminateLocalSelection(QPoint &, bool &, bool &) const {
279 return false; 279 return false;
280 } 280 }
281 281
282 virtual void setPlaybackFollow(PlaybackFollowMode m); 282 virtual void setPlaybackFollow(PlaybackFollowMode m);
283 virtual PlaybackFollowMode getPlaybackFollow() const { return m_followPlay; } 283 virtual PlaybackFollowMode getPlaybackFollow() const { return m_followPlay; }
284 284
290 // delegates back to us. 290 // delegates back to us.
291 virtual PropertyContainer::PropertyList getProperties() const; 291 virtual PropertyContainer::PropertyList getProperties() const;
292 virtual QString getPropertyLabel(const PropertyName &) const; 292 virtual QString getPropertyLabel(const PropertyName &) const;
293 virtual PropertyContainer::PropertyType getPropertyType(const PropertyName &) const; 293 virtual PropertyContainer::PropertyType getPropertyType(const PropertyName &) const;
294 virtual int getPropertyRangeAndValue(const PropertyName &, 294 virtual int getPropertyRangeAndValue(const PropertyName &,
295 int *min, int *max, int *deflt) const; 295 int *min, int *max, int *deflt) const;
296 virtual QString getPropertyValueLabel(const PropertyName &, 296 virtual QString getPropertyValueLabel(const PropertyName &,
297 int value) const; 297 int value) const;
298 virtual void setProperty(const PropertyName &, int value); 298 virtual void setProperty(const PropertyName &, int value);
299 virtual QString getPropertyContainerName() const { 299 virtual QString getPropertyContainerName() const {
300 return objectName(); 300 return objectName();
301 } 301 }
302 virtual QString getPropertyContainerIconName() const = 0; 302 virtual QString getPropertyContainerIconName() const = 0;
303 303
304 virtual int getPropertyContainerCount() const; 304 virtual int getPropertyContainerCount() const;
305 305
455 sv_samplerate_t getModelsSampleRate() const; 455 sv_samplerate_t getModelsSampleRate() const;
456 bool areLayersScrollable() const; 456 bool areLayersScrollable() const;
457 LayerList getScrollableBackLayers(bool testChanged, bool &changed) const; 457 LayerList getScrollableBackLayers(bool testChanged, bool &changed) const;
458 LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const; 458 LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const;
459 int getZoomConstraintBlockSize(int blockSize, 459 int getZoomConstraintBlockSize(int blockSize,
460 ZoomConstraint::RoundingDirection dir = 460 ZoomConstraint::RoundingDirection dir =
461 ZoomConstraint::RoundNearest) const; 461 ZoomConstraint::RoundNearest) const;
462 462
463 // True if the top layer(s) use colours for meaningful things. If 463 // True if the top layer(s) use colours for meaningful things. If
464 // this is the case, selections will be shown using unfilled boxes 464 // this is the case, selections will be shown using unfilled boxes
465 // rather than with a translucent fill. 465 // rather than with a translucent fill.
466 bool areLayerColoursSignificant() const; 466 bool areLayerColoursSignificant() const;
537 PropertyList getProperties() const { return m_v->getProperties(); } 537 PropertyList getProperties() const { return m_v->getProperties(); }
538 QString getPropertyLabel(const PropertyName &n) const { 538 QString getPropertyLabel(const PropertyName &n) const {
539 return m_v->getPropertyLabel(n); 539 return m_v->getPropertyLabel(n);
540 } 540 }
541 PropertyType getPropertyType(const PropertyName &n) const { 541 PropertyType getPropertyType(const PropertyName &n) const {
542 return m_v->getPropertyType(n); 542 return m_v->getPropertyType(n);
543 } 543 }
544 int getPropertyRangeAndValue(const PropertyName &n, int *min, int *max, 544 int getPropertyRangeAndValue(const PropertyName &n, int *min, int *max,
545 int *deflt) const { 545 int *deflt) const {
546 return m_v->getPropertyRangeAndValue(n, min, max, deflt); 546 return m_v->getPropertyRangeAndValue(n, min, max, deflt);
547 } 547 }
548 QString getPropertyValueLabel(const PropertyName &n, int value) const { 548 QString getPropertyValueLabel(const PropertyName &n, int value) const {
549 return m_v->getPropertyValueLabel(n, value); 549 return m_v->getPropertyValueLabel(n, value);
550 } 550 }
551 QString getPropertyContainerName() const { 551 QString getPropertyContainerName() const {
552 return m_v->getPropertyContainerName(); 552 return m_v->getPropertyContainerName();
553 } 553 }
554 QString getPropertyContainerIconName() const { 554 QString getPropertyContainerIconName() const {
555 return m_v->getPropertyContainerIconName(); 555 return m_v->getPropertyContainerIconName();
556 } 556 }
557 557
558 public slots: 558 public slots:
559 virtual void setProperty(const PropertyName &n, int value) { 559 virtual void setProperty(const PropertyName &n, int value) {
560 m_v->setProperty(n, value); 560 m_v->setProperty(n, value);
561 } 561 }
562 562
563 protected: 563 protected:
564 View *m_v; 564 View *m_v;
565 }; 565 };