public void Reset() { _beatCursor = 0.0; _lastBeatSpacePosition = 0.0; _segments = new Queue <SongSegment>(_originalSegments); _currentSegment = _segments.Dequeue(); }
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)); }
public static double CalculateNoteTime(double beatSpacePosition, SongSegment segment) { return(segment.BeatSpace.MapTo(segment.SongTime, beatSpacePosition)); }
public void addSegment(SongSegment x) { songData.Add(x); }