Пример #1
0
 /// <summary>Returns the index of the specified <seealso cref="TimingPoint"/> in the list.</summary>
 /// <param name="timingPoint">The <seealso cref="TimingPoint"/> whose index in the list to get.</param>
 public int IndexOf(TimingPoint timingPoint) => timingPoints.BinarySearch(timingPoint);
Пример #2
0
 /// <summary>Adds a <seealso cref="TimingPoint"/> to the list.</summary>
 /// <param name="timingPoint">The <seealso cref="TimingPoint"/> to add to the list.</param>
 public void Add(TimingPoint timingPoint) => RecalculateTimePositions(timingPoints.Insert(timingPoint) + 1);
Пример #3
0
 private static int CompareTimingPoints(TimingPoint left, TimingPoint right) => left.GetRelativeTimePosition().CompareTo(right.GetRelativeTimePosition());
Пример #4
0
 /// <inheritdoc/>
 public override void CalculateTimePosition(TimingPoint previous) => CalculateAbsoluteTimePosition(previous);
Пример #5
0
 /// <inheritdoc/>
 protected override int CompareTimePosition(TimingPoint other) => TimePosition.CompareTo(other.GetRelativeTimePosition());
Пример #6
0
 /// <summary>Calculates the absolute time position of this relative timing poing based on a previous <seealso cref="TimingPoint"/>.</summary>
 /// <param name="previous">The previous <seealso cref="TimingPoint"/> based on which to calculate the absolute time position.</param>
 public void CalculateAbsoluteTimePosition(TimingPoint previous)
 {
     // F**k this is so long
     AbsoluteTimePosition = previous.GetAbsoluteTimePosition() + previous.BPM.GetDurationTimeSpan(TimePosition.DistanceFrom(previous.GetRelativeTimePosition(), previous.TimeSignature), previous.TimeSignature);
 }