ChordRest* Selection::activeCR() const { if ((_state != SEL_RANGE) || !_activeSegment) return 0; if (_activeSegment == _startSegment) return firstChordRest(_activeTrack); else return lastChordRest(_activeTrack); }
int Selection::tickEnd() const { switch (_state) { case SelState::RANGE: { if (_endSegment) { return _endSegment->tick(); } else { // endsegment == 0 if end of score Measure* m = _score->lastMeasure(); return m->tick() + m->ticks(); } break; } case SelState::LIST: { ChordRest* cr = lastChordRest(); return (cr) ? cr->tick() : -1; break; } default: return -1; } }