00025 {
00026 if(_lastPos < 0) _lastPos = 0;
00027 if(_lastPos >= _timeSpans.length) _lastPos = _timeSpans.length - 1;
00028
00029 int start = _timeSpans[_lastPos].start;
00030 int end = _timeSpans[_lastPos].end;
00031
00032 if(frameNr > end) {
00033 _lastPos++;
00034 while(_lastPos < _timeSpans.length) {
00035 start = _timeSpans[_lastPos].start;
00036 end = _timeSpans[_lastPos].end;
00037 if(frameNr <= end) {
00038 if(frameNr >= start) return _lastPos;
00039 else return -1;
00040 }
00041 _lastPos++;
00042 }
00043 return -1;
00044 }
00045 else if(frameNr < start) {
00046 _lastPos--;
00047 while(_lastPos >= 0) {
00048 start = _timeSpans[_lastPos].start;
00049 end = _timeSpans[_lastPos].end;
00050 if(frameNr >= start) {
00051 if(frameNr <= end) return _lastPos;
00052 else return -1;
00053 }
00054 _lastPos--;
00055 }
00056 return -1;
00057 }
00058 else
00059 return _lastPos;
00060 }