Captioning\File::getCueFromStart PHP Method

getCueFromStart() public method

public getCueFromStart ( $_start )
    public function getCueFromStart($_start)
    {
        $cueClass = self::getExpectedCueClass($this);
        $start = is_int($_start) ? $_start : $cueClass::tc2ms($_start);
        $prev_stop = 0;
        $i = 0;
        foreach ($this->cues as $cue) {
            if ($start > $prev_stop && $start < $cue->getStart() || $start >= $cue->getStart() && $start < $cue->getStop()) {
                break;
            }
            $prev_stop = $cue->getStop();
            $i++;
        }
        return $i;
    }