| 218 | } |
| 219 | |
| 220 | void LabelTrack::Clear(double b, double e) |
| 221 | { |
| 222 | // May DELETE labels, so use subscripts to iterate |
| 223 | for (size_t i = 0; i < mLabels.size(); ++i) { |
| 224 | auto &labelStruct = mLabels[i]; |
| 225 | LabelStruct::TimeRelations relation = |
| 226 | labelStruct.RegionRelation(b, e, this); |
| 227 | if (relation == LabelStruct::BEFORE_LABEL) |
| 228 | labelStruct.selectedRegion.move(- (e-b)); |
| 229 | else if (relation == LabelStruct::SURROUNDS_LABEL) { |
| 230 | DeleteLabel( i ); |
| 231 | --i; |
| 232 | } |
| 233 | else if (relation == LabelStruct::ENDS_IN_LABEL) |
| 234 | labelStruct.selectedRegion.setTimes( |
| 235 | b, |
| 236 | labelStruct.getT1() - (e - b)); |
| 237 | else if (relation == LabelStruct::BEGINS_IN_LABEL) |
| 238 | labelStruct.selectedRegion.setT1(b); |
| 239 | else if (relation == LabelStruct::WITHIN_LABEL) |
| 240 | labelStruct.selectedRegion.moveT1( - (e-b)); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | #if 0 |
| 245 | //used when we want to use clear only on the labels |
nothing calls this directly
no test coverage detected