Exemple #1
0
        public void TimingPointAtTimeSpan()
        {
            TimingPoint t;

            t = timingPoints.TimingPointAtTime(TimeSpan.FromSeconds(1.5));
            Assert.AreEqual(timingPoints[0], t);

            t = timingPoints.TimingPointAtTime(TimeSpan.FromSeconds(3));
            Assert.AreEqual(timingPoints[1], t);

            t = timingPoints.TimingPointAtTime(TimeSpan.FromSeconds(4.5));
            Assert.AreEqual(timingPoints[1], t);

            t = timingPoints.TimingPointAtTime(TimeSpan.FromSeconds(6));
            Assert.AreEqual(timingPoints[2], t);

            t = timingPoints.TimingPointAtTime(TimeSpan.FromSeconds(7));
            Assert.AreEqual(timingPoints[3], t);

            t = timingPoints.TimingPointAtTime(TimeSpan.FromSeconds(10));
            Assert.AreEqual(timingPoints[4], t);
        }
        /// <summary>Gets the end time position of the track based on the <seealso cref="TimingPointList"/> of the <seealso cref="GuidelineEditorPreset"/>.</summary>
        /// <param name="timingPoints">The <seealso cref="TimingPointList"/> of the <seealso cref="GuidelineEditorPreset"/>.</param>
        public MeasuredTimePosition GetEnd(TimingPointList timingPoints)
        {
            var max = events.Maximum;

            return(max.GetEnd(timingPoints.TimingPointAtTime(max.TimePosition).TimeSignature));
        }