Logo Search packages:      
Sourcecode: rosegarden version File versions

EventSelection::RangeList Rosegarden::EventSelection::getRanges (  )  const

Return a set of ranges spanned by the selection, such that each range covers only events within the selection.

Definition at line 166 of file Selection.cpp.

References contains(), getEndTime(), and getStartTime().

Referenced by getRangeTimes(), and Rosegarden::Quantizer::quantize().

    RangeList ranges;

    Segment::iterator i = m_originalSegment.findTime(getStartTime());
    Segment::iterator j = i;
    Segment::iterator k = m_originalSegment.findTime(getEndTime());

    while (j != k) {

        for (j = i; j != k && contains(*j); ++j);

        if (j != i) {
            ranges.push_back(RangeList::value_type(i, j));

      for (i = j; i != k && !contains(*i); ++i);
      j = i;

    return ranges;

Generated by  Doxygen 1.6.0   Back to index