Search Results for

    Show / Hide Table of Contents

    Class PlaybackSnapping

    Provides a way to manage snap points for Playback.
    Inheritance
    object
    PlaybackSnapping
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Multimedia
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class PlaybackSnapping

    Properties

    IsEnabled

    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
    Type Description
    bool

    SnapPoints

    Gets all snap points.
    Declaration
    public IEnumerable<SnapPoint> SnapPoints { get; }
    Property Value
    Type Description
    IEnumerable<SnapPoint>

    Methods

    AddSnapPoint(ITimeSpan)

    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
    Type Description
    SnapPoint<Guid> An instance of the SnapPoint<TData> representing a snap point at time.
    Exceptions
    Type Condition
    ArgumentNullException time is null.

    AddSnapPoint<TData>(ITimeSpan, TData)

    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 Description
    SnapPoint<TData> An instance of the SnapPoint<TData> representing a snap point with data at time.
    Type Parameters
    Name Description
    TData Type of data that will be attached to a snap point.
    Exceptions
    Type Condition
    ArgumentNullException time is null.

    Clear()

    Removes all snap points.
    Declaration
    public void Clear()

    RemoveSnapPoint<TData>(SnapPoint<TData>)

    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
    Type Condition
    ArgumentNullException snapPoint is null.

    RemoveSnapPointsByData<TData>(Predicate<TData>)

    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
    Type Condition
    ArgumentNullException predicate is null.

    SnapToGrid(IGrid)

    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
    Type Description
    SnapPointsGroup An instance of the SnapPointsGroup added snap points belong to.
    Exceptions
    Type Condition
    ArgumentNullException grid is null.

    SnapToNotesEnds()

    Adds snap points at end times of notes.
    Declaration
    public SnapPointsGroup SnapToNotesEnds()
    Returns
    Type Description
    SnapPointsGroup An instance of the SnapPointsGroup added snap points belong to.

    SnapToNotesStarts()

    Adds snap points at start times of notes.
    Declaration
    public SnapPointsGroup SnapToNotesStarts()
    Returns
    Type Description
    SnapPointsGroup An instance of the SnapPointsGroup added snap points belong to.
    In this article
    Back to top 2024 / Generated by DocFX