comparison data/model/DenseThreeDimensionalModel.h @ 1173:abb78e824820 3.0-integration

Merge from default branch
author Chris Cannam
date Fri, 04 Mar 2016 12:38:20 +0000
parents 546d4e417346 fa1bec83441e
children fd40a5335968
comparison
equal deleted inserted replaced
1170:6877f4200912 1173:abb78e824820
142 142
143 virtual QVariant getData(int row, int column, int) const 143 virtual QVariant getData(int row, int column, int) const
144 { 144 {
145 switch (column) { 145 switch (column) {
146 case 0: { 146 case 0: {
147 RealTime rt = RealTime::frame2RealTime(row * getResolution(), 147 RealTime rt = RealTime::frame2RealTime
148 getSampleRate()); 148 (row * getResolution() + getStartFrame(), getSampleRate());
149 return rt.toText().c_str(); 149 return rt.toText().c_str();
150 } 150 }
151 case 1: 151 case 1:
152 return int(row * getResolution()); 152 return int(row * getResolution() + getStartFrame());
153 default: 153 default:
154 return getValueAt(row, column - 2); 154 return getValueAt(row, column - 2);
155 } 155 }
156 } 156 }
157 157
161 virtual SortType getSortType(int) const { 161 virtual SortType getSortType(int) const {
162 return SortNumeric; 162 return SortNumeric;
163 } 163 }
164 164
165 virtual sv_frame_t getFrameForRow(int row) const { 165 virtual sv_frame_t getFrameForRow(int row) const {
166 return sv_frame_t(row) * getResolution(); 166 return sv_frame_t(row) * getResolution() + getStartFrame();
167 } 167 }
168 virtual int getRowForFrame(sv_frame_t frame) const { 168 virtual int getRowForFrame(sv_frame_t frame) const {
169 return int(frame / getResolution()); 169 return int((frame - getStartFrame()) / getResolution());
170 } 170 }
171 171
172 protected: 172 protected:
173 DenseThreeDimensionalModel() { } 173 DenseThreeDimensionalModel() { }
174 }; 174 };