Seek() public method

public Seek ( System.TimeSpan offset ) : void
offset System.TimeSpan
return void
コード例 #1
0
        public void Play()
        {
            if (Status == PointCloudPlayerStatus.NotLoaded)
            {
                return;
            }

            if (Status != PointCloudPlayerStatus.Playing)
            {
                var playOffset = CurrentTimeUTC - MinTimeUTC;
                _playbackStartUTC = DateTime.Now - playOffset;
                _soundPlayer.Seek(playOffset);
            }
            Status = PointCloudPlayerStatus.Playing;
            _soundPlayer.Play();
        }
コード例 #2
0
        public void Seek(int frameNumber)
        {
            if (frameNumber < 0 || frameNumber > MaxFrameIndex)
            {
                throw new ArgumentOutOfRangeException("frameNumber");
            }

            if (Status == PointCloudPlayerStatus.Playing)
            {
                //TODO recalculate _playbackStartUTC
            }

            //TODO: intelligently reset buffer
            _bufferedFrames.Clear();
            _nextFrameToLoadIndex = frameNumber;
            CurrentFrameIndex     = frameNumber;

            MotionFrameHeader header = _serializer.LoadHeader(_filesToLoad[frameNumber]);

            var timeOffset = header.TimeUTC - MinTimeUTC;

            _soundPlayer.Seek(timeOffset);
        }