Class ObjectsMerger
Provides merging logic for group of objects. More info in the
Merger article.
Inheritance
ObjectsMerger
Assembly: Melanchall.DryWetMidi.dll
public class ObjectsMerger
Constructors
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
Collection of objects that should be merged.
Declaration
protected readonly List<ILengthedObject> _objects
Field Value
The type of objects in the current group.
Declaration
protected readonly Type _objectsType
Field Value
Properties
Gets the end time of the last object in the current group.
Declaration
public long EndTime { get; }
Property Value
Methods
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 |
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
Returns
Type |
Description |
bool |
true if the obj should be added to the current group;
otherwise, false . |
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. |