public static PlaySource Create(NormalPlaySource playSource, PlayRange playRange) { // Note: 是否在自动垫片上操作? if (playSource == null) { throw new ArgumentNullException("playSource"); } playRange = playSource.Adjust(playRange); if (playRange == playSource.PlayRange) { return(playSource); } return(new PlaySourceSegment(playSource, playRange)); }
public override void Split(TimeSpan duration, out PlaybillItem first, out PlaybillItem second) { if (duration <= TimeSpan.Zero) { throw new ArgumentOutOfRangeException("duration", string.Format("<{0}>无效,必须大于TimeSpan.Zero。", duration)); } // Note: 是否在自动垫片上操作? PlayRange firstRange, secondRange; this.PlaySource.Break(duration, out firstRange, out secondRange); var segment = this.PlaySource as PlaySourceSegment; NormalPlaySource source = segment != null ? segment.PlaySource : (NormalPlaySource)this.PlaySource; var firstSource = PlaySourceSegment.Create(source, firstRange); first = CreateInternal(firstSource); var secondSource = PlaySourceSegment.Create(source, secondRange); second = CreateInternal(secondSource); }
private AutoPlaybillItem(NormalPlaySource playSource) : base(playSource, ScheduleMode.Auto) { }
private PlaySourceSegment(NormalPlaySource playSource, PlayRange playRange) { this.PlayRange = playRange; this.PlaySource = playSource; }
private TimingPlaybillItem(DateTime startTime, NormalPlaySource playSource, bool isBreak) : base(playSource, isBreak ? ScheduleMode.TimingBreak : ScheduleMode.Timing) { _scheduleInfo = new ScheduleInfo(startTime, this.PlaySource.PlayRange.Duration, this.ScheduleMode); }