/// <summary> /// Shut the stream; no further appends may be accepted. /// </summary> /// <param name="finalDuration">The possibly fractional duration to be associated with the stream; /// must be strictly equal to, or less than one sample smaller than, the discrete duration.</param> public override void Shut(ContinuousDuration finalDuration) { HoloDebug.Assert(!IsShut); // Should always have as many samples as the rounded-up finalDuration. // The precise time matching behavior is that a loop will play either Math.Floor(finalDuration) // or Math.Ceiling(finalDuration) samples on each iteration, such that it remains perfectly in // time with finalDuration's fractional value. So, a shut loop should have DiscreteDuration // equal to rounded-up ContinuousDuration. HoloDebug.Assert((int)Math.Ceiling((double)finalDuration) == (int)DiscreteDuration); base.Shut(finalDuration); }
public override void Shut(ContinuousDuration finalDuration) { base.Shut(finalDuration); // swap out our mappers, we're looping now if (_useContinuousLoopingMapper) { _intervalMapper = new LoopingIntervalMapper <TTime, TValue>(this); } else { _intervalMapper = new SimpleLoopingIntervalMapper <TTime, TValue>(this); } #if SPAMAUDIO foreach (TimedSlice <TTime, TValue> timedSlice in _data) { Spam.Audio.WriteLine("BufferedSliceStream.Shut: next slice time " + timedSlice.InitialTime + ", slice " + timedSlice.Slice); } #endif }
/// <summary> /// Shut the stream; no further appends may be accepted. /// </summary> /// <param name="finalDuration">The possibly fractional duration to be associated with the stream; /// must be strictly equal to, or less than one sample smaller than, the discrete duration.</param> public virtual void Shut(ContinuousDuration finalDuration) { HoloDebug.Assert(!IsShut); _isShut = true; _continuousDuration = finalDuration; }