Class PlaybackSnapping
Provides a way to manage snap points for
Playback.
Inheritance
PlaybackSnapping
Assembly: Melanchall.DryWetMidi.dll
public sealed class PlaybackSnapping
Properties
Gets or sets a value indicating whether playback snapping is enabled or not. The property
lets turn on or off all snap points at once.
Declaration
public bool IsEnabled { get; set; }
Property Value
Gets all snap points.
Declaration
public IEnumerable<SnapPoint> SnapPoints { get; }
Property Value
Methods
Adds a snap point at the specified time.
Declaration
public SnapPoint<Guid> AddSnapPoint(ITimeSpan time)
Parameters
Type |
Name |
Description |
ITimeSpan |
time |
Time to add snap point at. |
Returns
Exceptions
Adds a snap point with the specified data at given time.
Declaration
public SnapPoint<TData> AddSnapPoint<TData>(ITimeSpan time, TData data)
Parameters
Type |
Name |
Description |
ITimeSpan |
time |
Time to add snap point at. |
TData |
data |
Data to attach to snap point. |
Returns
Type Parameters
Name |
Description |
TData |
Type of data that will be attached to a snap point. |
Exceptions
Removes all snap points.
Declaration
Removes a snap point.
Declaration
public void RemoveSnapPoint<TData>(SnapPoint<TData> snapPoint)
Parameters
Type |
Name |
Description |
SnapPoint<TData> |
snapPoint |
Snap point to remove. |
Type Parameters
Name |
Description |
TData |
Type of data attached to snapPoint . |
Exceptions
Removes all snap points that match the conditions defined by the specified predicate.
Declaration
public void RemoveSnapPointsByData<TData>(Predicate<TData> predicate)
Parameters
Type |
Name |
Description |
Predicate<TData> |
predicate |
The Predicate<T> delegate that defines the conditions
of snap points to remove. |
Type Parameters
Name |
Description |
TData |
Type of data attached to snap points to remove. |
Exceptions
Adds snap points at times defined by the specified grid.
Declaration
public SnapPointsGroup SnapToGrid(IGrid grid)
Parameters
Type |
Name |
Description |
IGrid |
grid |
The grid that defines times to add snap points to. |
Returns
Exceptions
Adds snap points at end times of notes.
Declaration
public SnapPointsGroup SnapToNotesEnds()
Returns
Adds snap points at start times of notes.
Declaration
public SnapPointsGroup SnapToNotesStarts()
Returns