Exemple #1
0
 public void Reset()
 {
     _beatCursor            = 0.0;
     _lastBeatSpacePosition = 0.0;
     _segments       = new Queue <SongSegment>(_originalSegments);
     _currentSegment = _segments.Dequeue();
 }
Exemple #2
0
        public double CalculateNoteTime(double beatSpacePosition)
        {
            SongSegment segment;

            if (beatSpacePosition < _lastBeatSpacePosition)
            {
                segment = _originalSegments.First(x => x.BeatSpace.End > beatSpacePosition);
                Debug.WriteLine(
                    "Calculating note times out of order is less efficient, consider sorting your notes beforehand");
            }
            else
            {
                _lastBeatSpacePosition = beatSpacePosition;

                while (_currentSegment.BeatSpace.End < beatSpacePosition)
                {
                    _currentSegment = _segments.Dequeue();
                }

                segment = _currentSegment;
            }

            return(segment.BeatSpace.MapTo(segment.SongTime, beatSpacePosition));
        }
Exemple #3
0
 public static double CalculateNoteTime(double beatSpacePosition, SongSegment segment)
 {
     return(segment.BeatSpace.MapTo(segment.SongTime, beatSpacePosition));
 }
Exemple #4
0
 public void addSegment(SongSegment x)
 {
     songData.Add(x);
 }
Exemple #5
0
 public void addSegment(SongSegment x)
 {
     songData.Add(x);
 }