comparison data/model/DenseThreeDimensionalModel.h @ 1599:ce185d4dd408 bqaudiostream

Merge from default branch
author Chris Cannam
date Wed, 23 Jan 2019 14:43:43 +0000
parents ad5f892c0c4d
children 73077ec5aed6
comparison
equal deleted inserted replaced
1598:d2555df635ec 1599:ce185d4dd408
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _DENSE_THREE_DIMENSIONAL_MODEL_H_ 16 #ifndef SV_DENSE_THREE_DIMENSIONAL_MODEL_H
17 #define _DENSE_THREE_DIMENSIONAL_MODEL_H_ 17 #define SV_DENSE_THREE_DIMENSIONAL_MODEL_H
18 18
19 #include "Model.h" 19 #include "Model.h"
20 #include "TabularModel.h" 20 #include "TabularModel.h"
21 #include "base/ColumnOp.h" 21 #include "base/ColumnOp.h"
22 #include "base/ZoomConstraint.h" 22 #include "base/ZoomConstraint.h"
116 */ 116 */
117 bool isOverThreshold(int x, int y, float threshold) { 117 bool isOverThreshold(int x, int y, float threshold) {
118 return getValueAt(x, y) > threshold; 118 return getValueAt(x, y) > threshold;
119 } 119 }
120 120
121 QString getTypeName() const { return tr("Dense 3-D"); } 121 QString getTypeName() const override { return tr("Dense 3-D"); }
122 122
123 virtual int getCompletion() const = 0; 123 virtual int getCompletion() const = 0;
124 124
125 /* 125 /*
126 TabularModel methods. 126 TabularModel methods.
127 This class is non-editable -- subclasses may be editable. 127 This class is non-editable -- subclasses may be editable.
128 Row and column are transposed for the tabular view (which is 128 Row and column are transposed for the tabular view (which is
129 "on its side"). 129 "on its side").
130 */ 130 */
131 131
132 virtual int getRowCount() const { return getWidth(); } 132 int getRowCount() const override { return getWidth(); }
133 virtual int getColumnCount() const { return getHeight() + 2; } 133 int getColumnCount() const override { return getHeight() + 2; }
134 134
135 virtual QString getHeading(int column) const 135 QString getHeading(int column) const override
136 { 136 {
137 switch (column) { 137 switch (column) {
138 case 0: return tr("Time"); 138 case 0: return tr("Time");
139 case 1: return tr("Frame"); 139 case 1: return tr("Frame");
140 default: 140 default:
144 } 144 }
145 return name; 145 return name;
146 } 146 }
147 } 147 }
148 148
149 virtual QVariant getData(int row, int column, int) const 149 QVariant getData(int row, int column, int) const
150 { 150 override {
151 switch (column) { 151 switch (column) {
152 case 0: { 152 case 0: {
153 RealTime rt = RealTime::frame2RealTime 153 RealTime rt = RealTime::frame2RealTime
154 (row * getResolution() + getStartFrame(), getSampleRate()); 154 (row * getResolution() + getStartFrame(), getSampleRate());
155 return rt.toText().c_str(); 155 return rt.toText().c_str();
159 default: 159 default:
160 return getValueAt(row, column - 2); 160 return getValueAt(row, column - 2);
161 } 161 }
162 } 162 }
163 163
164 virtual bool isColumnTimeValue(int col) const { 164 bool isColumnTimeValue(int col) const override {
165 return col < 2; 165 return col < 2;
166 } 166 }
167 virtual SortType getSortType(int) const { 167 SortType getSortType(int) const override {
168 return SortNumeric; 168 return SortNumeric;
169 } 169 }
170 170
171 virtual sv_frame_t getFrameForRow(int row) const { 171 sv_frame_t getFrameForRow(int row) const override {
172 return sv_frame_t(row) * getResolution() + getStartFrame(); 172 return sv_frame_t(row) * getResolution() + getStartFrame();
173 } 173 }
174 virtual int getRowForFrame(sv_frame_t frame) const { 174 int getRowForFrame(sv_frame_t frame) const override {
175 return int((frame - getStartFrame()) / getResolution()); 175 return int((frame - getStartFrame()) / getResolution());
176 } 176 }
177 177
178 protected: 178 protected:
179 DenseThreeDimensionalModel() { } 179 DenseThreeDimensionalModel() { }