comparison layer/NoteLayer.h @ 1414:fa986b91d77f

Merge from branch fix-static-analysis
author Chris Cannam
date Wed, 09 Jan 2019 15:24:51 +0000
parents a18e78b9c78b
children 6f51297a0250
comparison
equal deleted inserted replaced
1413:0930a27ebea2 1414:fa986b91d77f
33 Q_OBJECT 33 Q_OBJECT
34 34
35 public: 35 public:
36 NoteLayer(); 36 NoteLayer();
37 37
38 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; 38 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
39 39
40 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; 40 int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override;
41 virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; 41 void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override;
42 42
43 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; 43 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
44 44
45 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, 45 bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
46 int &resolution, 46 int &resolution,
47 SnapType snap) const; 47 SnapType snap) const override;
48 48
49 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); 49 void drawStart(LayerGeometryProvider *v, QMouseEvent *) override;
50 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); 50 void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override;
51 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); 51 void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override;
52 52
53 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); 53 void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override;
54 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); 54 void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override;
55 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); 55 void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override;
56 56
57 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); 57 void editStart(LayerGeometryProvider *v, QMouseEvent *) override;
58 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); 58 void editDrag(LayerGeometryProvider *v, QMouseEvent *) override;
59 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); 59 void editEnd(LayerGeometryProvider *v, QMouseEvent *) override;
60 60
61 virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); 61 bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override;
62 62
63 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); 63 void moveSelection(Selection s, sv_frame_t newStartFrame) override;
64 virtual void resizeSelection(Selection s, Selection newSize); 64 void resizeSelection(Selection s, Selection newSize) override;
65 virtual void deleteSelection(Selection s); 65 void deleteSelection(Selection s) override;
66 66
67 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); 67 void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override;
68 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, 68 bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset,
69 bool interactive); 69 bool interactive) override;
70 70
71 virtual const Model *getModel() const { return m_model; } 71 const Model *getModel() const override { return m_model; }
72 void setModel(NoteModel *model); 72 void setModel(NoteModel *model);
73 73
74 virtual PropertyList getProperties() const; 74 PropertyList getProperties() const override;
75 virtual QString getPropertyLabel(const PropertyName &) const; 75 QString getPropertyLabel(const PropertyName &) const override;
76 virtual PropertyType getPropertyType(const PropertyName &) const; 76 PropertyType getPropertyType(const PropertyName &) const override;
77 virtual QString getPropertyGroupName(const PropertyName &) const; 77 QString getPropertyGroupName(const PropertyName &) const override;
78 virtual int getPropertyRangeAndValue(const PropertyName &, 78 int getPropertyRangeAndValue(const PropertyName &,
79 int *min, int *max, int *deflt) const; 79 int *min, int *max, int *deflt) const override;
80 virtual QString getPropertyValueLabel(const PropertyName &, 80 QString getPropertyValueLabel(const PropertyName &,
81 int value) const; 81 int value) const override;
82 virtual void setProperty(const PropertyName &, int value); 82 void setProperty(const PropertyName &, int value) override;
83 83
84 enum VerticalScale { 84 enum VerticalScale {
85 AutoAlignScale, 85 AutoAlignScale,
86 LinearScale, 86 LinearScale,
87 LogScale, 87 LogScale,
89 }; 89 };
90 90
91 void setVerticalScale(VerticalScale scale); 91 void setVerticalScale(VerticalScale scale);
92 VerticalScale getVerticalScale() const { return m_verticalScale; } 92 VerticalScale getVerticalScale() const { return m_verticalScale; }
93 93
94 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; 94 bool isLayerScrollable(const LayerGeometryProvider *v) const override;
95 95
96 virtual bool isLayerEditable() const { return true; } 96 bool isLayerEditable() const override { return true; }
97 97
98 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } 98 int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); }
99 99
100 virtual bool getValueExtents(double &min, double &max, 100 bool getValueExtents(double &min, double &max,
101 bool &log, QString &unit) const; 101 bool &log, QString &unit) const override;
102 102
103 virtual bool getDisplayExtents(double &min, double &max) const; 103 bool getDisplayExtents(double &min, double &max) const override;
104 virtual bool setDisplayExtents(double min, double max); 104 bool setDisplayExtents(double min, double max) override;
105 105
106 virtual int getVerticalZoomSteps(int &defaultStep) const; 106 int getVerticalZoomSteps(int &defaultStep) const override;
107 virtual int getCurrentVerticalZoomStep() const; 107 int getCurrentVerticalZoomStep() const override;
108 virtual void setVerticalZoomStep(int); 108 void setVerticalZoomStep(int) override;
109 virtual RangeMapper *getNewVerticalZoomRangeMapper() const; 109 RangeMapper *getNewVerticalZoomRangeMapper() const override;
110 110
111 /** 111 /**
112 * Add a note-on. Used when recording MIDI "live". The note will 112 * Add a note-on. Used when recording MIDI "live". The note will
113 * not be finally added to the layer until the corresponding 113 * not be finally added to the layer until the corresponding
114 * note-off. 114 * note-off.
124 /** 124 /**
125 * Abandon all pending note-on events. 125 * Abandon all pending note-on events.
126 */ 126 */
127 void abandonNoteOns(); 127 void abandonNoteOns();
128 128
129 virtual void toXml(QTextStream &stream, QString indent = "", 129 void toXml(QTextStream &stream, QString indent = "",
130 QString extraAttributes = "") const; 130 QString extraAttributes = "") const override;
131 131
132 void setProperties(const QXmlAttributes &attributes); 132 void setProperties(const QXmlAttributes &attributes) override;
133 133
134 /// VerticalScaleLayer methods 134 /// VerticalScaleLayer methods
135 virtual int getYForValue(LayerGeometryProvider *v, double value) const; 135 int getYForValue(LayerGeometryProvider *v, double value) const override;
136 virtual double getValueForY(LayerGeometryProvider *v, int y) const; 136 double getValueForY(LayerGeometryProvider *v, int y) const override;
137 virtual QString getScaleUnits() const; 137 QString getScaleUnits() const override;
138 138
139 protected: 139 protected:
140 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; 140 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const;
141 bool shouldConvertMIDIToHz() const; 141 bool shouldConvertMIDIToHz() const;
142 142
143 virtual int getDefaultColourHint(bool dark, bool &impose); 143 int getDefaultColourHint(bool dark, bool &impose) override;
144 144
145 NoteModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; 145 NoteModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const;
146 146
147 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, NoteModel::Point &) const; 147 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, NoteModel::Point &) const;
148 148