Search Results for

    Show / Hide Table of Contents

    Class ObjectsMerger

    Provides merging logic for group of objects. More info in the Merger article.
    Inheritance
    object
    ObjectsMerger
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Tools
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public class ObjectsMerger

    Constructors

    ObjectsMerger(ILengthedObject)

    Initializes a new instance of the ObjectsMerger with the specified first object.
    Declaration
    public ObjectsMerger(ILengthedObject obj)
    Parameters
    Type Name Description
    ILengthedObject obj First object of the current group of objects that should be merged.

    Fields

    _objects

    Collection of objects that should be merged.
    Declaration
    protected readonly List<ILengthedObject> _objects
    Field Value
    Type Description
    List<ILengthedObject>

    _objectsType

    The type of objects in the current group.
    Declaration
    protected readonly Type _objectsType
    Field Value
    Type Description
    Type

    Properties

    EndTime

    Gets the end time of the last object in the current group.
    Declaration
    public long EndTime { get; }
    Property Value
    Type Description
    long

    Methods

    AddObject(ILengthedObject)

    Adds the specified object to the current group.
    Declaration
    public void AddObject(ILengthedObject obj)
    Parameters
    Type Name Description
    ILengthedObject obj Object to add to the current group

    CanAddObject(ILengthedObject, TempoMap, ObjectsMergingSettings)

    Returns a value indicating whether the specified object can be added to the current group or not. In other words, the method determines if the object should be merged with the group.
    Declaration
    public virtual bool CanAddObject(ILengthedObject obj, TempoMap tempoMap, ObjectsMergingSettings settings)
    Parameters
    Type Name Description
    ILengthedObject obj Object to check.
    TempoMap tempoMap Tempo map used for merging.
    ObjectsMergingSettings settings Settings according to which merging process should be done.
    Returns
    Type Description
    bool true if the obj should be added to the current group; otherwise, false.

    MergeObjects(ObjectsMergingSettings)

    Merges objects within the current group into single object.
    Declaration
    public virtual ILengthedObject MergeObjects(ObjectsMergingSettings settings)
    Parameters
    Type Name Description
    ObjectsMergingSettings settings Settings according to which merging process should be done.
    Returns
    Type Description
    ILengthedObject A new object that is result of merging objects within the current group.
    In this article
    Back to top 2024 / Generated by DocFX