/// <summary> /// Sets playback position to the time of previous snap point (relative to the current /// time of playback) holding the specified data. /// </summary> /// <param name="data">Data of a snap point to move to.</param> /// <returns><c>true</c> if playback position successfully changed to the time of a previous snap point /// with the specified data; otherwise, <c>false</c>.</returns> /// <exception cref="ObjectDisposedException">The current <see cref="Playback"/> is disposed.</exception> /// <exception cref="MidiDeviceException">An error occurred on device.</exception> public bool MoveToPreviousSnapPoint <TData>(TData data) { EnsureIsNotDisposed(); var snapPoint = Snapping.GetPreviousSnapPoint(_clock.CurrentTime, data); return(TryToMoveToSnapPoint(snapPoint)); }
/// <summary> /// Sets playback position to the time of the previous snap point (relative to the current /// time of playback) that belongs to the specified <see cref="SnapPointsGroup"/>. /// </summary> /// <param name="snapPointsGroup"><see cref="SnapPointsGroup"/> that defines snap points to /// select the one from.</param> /// <returns><c>true</c> if playback position successfully changed to the time of a previous snap point /// within <paramref name="snapPointsGroup"/>; otherwise, <c>false</c>.</returns> /// <exception cref="ArgumentNullException"><paramref name="snapPointsGroup"/> is <c>null</c>.</exception> /// <exception cref="ObjectDisposedException">The current <see cref="Playback"/> is disposed.</exception> /// <exception cref="MidiDeviceException">An error occurred on device.</exception> public bool MoveToPreviousSnapPoint(SnapPointsGroup snapPointsGroup) { ThrowIfArgument.IsNull(nameof(snapPointsGroup), snapPointsGroup); EnsureIsNotDisposed(); var snapPoint = Snapping.GetPreviousSnapPoint(_clock.CurrentTime, snapPointsGroup); return(TryToMoveToSnapPoint(snapPoint)); }
/// <summary> /// Sets playback position to the time of the previous snap point (relative to the current /// time of playback). /// </summary> /// <exception cref="ObjectDisposedException">The current <see cref="Playback"/> is disposed.</exception> /// <exception cref="MidiDeviceException">An error occurred on device.</exception> public void MoveToPreviousSnapPoint() { EnsureIsNotDisposed(); var snapPoint = Snapping.GetPreviousSnapPoint(_clock.CurrentTime); if (snapPoint != null) { MoveToTime((MetricTimeSpan)snapPoint.Time); } }
/// <summary> /// Sets playback position to the time of the previous snap point (relative to the current /// time of playback) that belongs to the specified <see cref="SnapPointsGroup"/>. /// </summary> /// <param name="snapPointsGroup"><see cref="SnapPointsGroup"/> that defines snap points to /// select the one from.</param> /// <exception cref="ArgumentNullException"><paramref name="snapPointsGroup"/> is null.</exception> /// <exception cref="ObjectDisposedException">The current <see cref="Playback"/> is disposed.</exception> /// <exception cref="MidiDeviceException">An error occurred on device.</exception> public void MoveToPreviousSnapPoint(SnapPointsGroup snapPointsGroup) { ThrowIfArgument.IsNull(nameof(snapPointsGroup), snapPointsGroup); EnsureIsNotDisposed(); var snapPoint = Snapping.GetPreviousSnapPoint(_clock.CurrentTime, snapPointsGroup); if (snapPoint != null) { MoveToTime((MetricTimeSpan)snapPoint.Time); } }