Logo Search packages:      
Sourcecode: csound version File versions

int csound::Score::indexAtTime ( double  time  )  [virtual]

Return the index of the first event at or after the specified time, that is, return "begin" for the time; if the time is not found, return the size of the score. Iterating from indexAtTime(t1) to indexAfterTime(t2) is guaranteed to iterate over all and only those events included between t1 and t2.

Definition at line 930 of file Score.cpp.

Referenced by csound::VoiceleadingNode::transform().

  {
    int index = size();
    std::vector<Event>::iterator it = std::find_if(begin(), end(), TimeAtComparator(time));
    if (it != end()) {
      index = (it - begin());
    }
    return index;
  }


Generated by  Doxygen 1.6.0   Back to index