Mercurial > hg > svcore
comparison data/model/SparseOneDimensionalModel.h @ 1580:c01cbe41aeb5 fix-static-analysis
Use override throughout
author | Chris Cannam |
---|---|
date | Mon, 26 Nov 2018 13:48:45 +0000 |
parents | 48e9f538e6e9 |
children | ad5f892c0c4d |
comparison
equal
deleted
inserted
replaced
1579:232d6ddf257d | 1580:c01cbe41aeb5 |
---|---|
86 virtual ~SparseOneDimensionalModel() | 86 virtual ~SparseOneDimensionalModel() |
87 { | 87 { |
88 PlayParameterRepository::getInstance()->removePlayable(this); | 88 PlayParameterRepository::getInstance()->removePlayable(this); |
89 } | 89 } |
90 | 90 |
91 virtual bool canPlay() const { return true; } | 91 bool canPlay() const override { return true; } |
92 | 92 |
93 virtual QString getDefaultPlayClipId() const | 93 QString getDefaultPlayClipId() const override |
94 { | 94 { |
95 return "tap"; | 95 return "tap"; |
96 } | 96 } |
97 | 97 |
98 int getIndexOf(const Point &point) | 98 int getIndexOf(const Point &point) |
105 if (!comparator(*j, point) && !comparator(point, *j)) return i; | 105 if (!comparator(*j, point) && !comparator(point, *j)) return i; |
106 } | 106 } |
107 return -1; | 107 return -1; |
108 } | 108 } |
109 | 109 |
110 QString getTypeName() const { return tr("Sparse 1-D"); } | 110 QString getTypeName() const override { return tr("Sparse 1-D"); } |
111 | 111 |
112 /** | 112 /** |
113 * TabularModel methods. | 113 * TabularModel methods. |
114 */ | 114 */ |
115 | 115 |
116 virtual int getColumnCount() const | 116 int getColumnCount() const override |
117 { | 117 { |
118 return 3; | 118 return 3; |
119 } | 119 } |
120 | 120 |
121 virtual QString getHeading(int column) const | 121 QString getHeading(int column) const override |
122 { | 122 { |
123 switch (column) { | 123 switch (column) { |
124 case 0: return tr("Time"); | 124 case 0: return tr("Time"); |
125 case 1: return tr("Frame"); | 125 case 1: return tr("Frame"); |
126 case 2: return tr("Label"); | 126 case 2: return tr("Label"); |
127 default: return tr("Unknown"); | 127 default: return tr("Unknown"); |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 virtual QVariant getData(int row, int column, int role) const | 131 QVariant getData(int row, int column, int role) const override |
132 { | 132 { |
133 if (column < 2) { | 133 if (column < 2) { |
134 return SparseModel<OneDimensionalPoint>::getData | 134 return SparseModel<OneDimensionalPoint>::getData |
135 (row, column, role); | 135 (row, column, role); |
136 } | 136 } |
142 case 2: return i->label; | 142 case 2: return i->label; |
143 default: return QVariant(); | 143 default: return QVariant(); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) | 147 Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override |
148 { | 148 { |
149 if (column < 2) { | 149 if (column < 2) { |
150 return SparseModel<OneDimensionalPoint>::getSetDataCommand | 150 return SparseModel<OneDimensionalPoint>::getSetDataCommand |
151 (row, column, value, role); | 151 (row, column, value, role); |
152 } | 152 } |
166 command->addPoint(point); | 166 command->addPoint(point); |
167 return command->finish(); | 167 return command->finish(); |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 virtual bool isColumnTimeValue(int column) const | 171 bool isColumnTimeValue(int column) const override |
172 { | 172 { |
173 return (column < 2); | 173 return (column < 2); |
174 } | 174 } |
175 | 175 |
176 virtual SortType getSortType(int column) const | 176 SortType getSortType(int column) const override |
177 { | 177 { |
178 if (column == 2) return SortAlphabetical; | 178 if (column == 2) return SortAlphabetical; |
179 return SortNumeric; | 179 return SortNumeric; |
180 } | 180 } |
181 | 181 |
182 /** | 182 /** |
183 * NoteExportable methods. | 183 * NoteExportable methods. |
184 */ | 184 */ |
185 | 185 |
186 NoteList getNotes() const { | 186 NoteList getNotes() const override { |
187 return getNotesWithin(getStartFrame(), getEndFrame()); | 187 return getNotesWithin(getStartFrame(), getEndFrame()); |
188 } | 188 } |
189 | 189 |
190 NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const { | 190 NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const override { |
191 | 191 |
192 PointList points = getPoints(startFrame, endFrame); | 192 PointList points = getPoints(startFrame, endFrame); |
193 NoteList notes; | 193 NoteList notes; |
194 | 194 |
195 for (PointList::iterator pli = | 195 for (PointList::iterator pli = |