예제 #1
0
        //Can't be stuffed validating that the syncpoint list is correct, and I only actually need to build it here anyway,
        //so just don't worry about allowing construction from existing lists
        //	public BeatSyncSequence(ImmutableList<SyncPoint> syncPoints, double beatInterval, int barLength = 4, double nextBeatOffset = 0)
        //	{
        //		if (syncPoints == null) throw new ArgumentNullException(nameof(syncPoints));
        //		if (syncPoints.Count < 1) throw new ArgumentException("Cannot be empty", nameof(syncPoints));
        //		if (nextBeatOffset < 0) throw new ArgumentOutOfRangeException(nameof(nextBeatOffset), nextBeatOffset, "Cannot be negative.");
        //
        //		this.SyncPoints = syncPoints;
        //		this.BeatPositioner = new BeatPositioner(
        //			firstBeat: syncPoints[0].AudioPos,
        //			interval: beatInterval,
        //			barLength: barLength
        //		);
        //		this.NextSyncAudioOffset = nextBeatOffset;
        //	}

        public BeatSyncSequence(SyncPoint firstSyncPoint, double beatInterval, int barLength = 4, double nextBeatOffset = 0)
            : this(
                beatSequence : new BeatSequence(
                    beatPositioner : new BeatPositioner(
                        firstBeat : firstSyncPoint.AudioPos.Position,
                        interval : beatInterval,
                        barLength : barLength
                        ),
                    nextBeatOffset : nextBeatOffset
                    ),
                videoPositions : ImmutableList.Create(firstSyncPoint.VideoPos.Position)
                )
        {
        }
예제 #2
0
 public SyncedRange(SyncPoint start, SyncPoint end)
 {
     this.Start = start;
     this.End   = end;
 }
예제 #3
0
 public static bool Equals(SyncPoint a, SyncPoint b) => a.VideoPos == b.VideoPos && a.AudioPos == b.AudioPos;