Interface ILengthedObject
Represents an object that has length.
Namespace: Melanchall.DryWetMidi.Interaction
Assembly: Melanchall.DryWetMidi.dll
Syntax
public interface ILengthedObject : ITimedObject
Properties
EndTime
Gets the end time of an object.
Declaration
long EndTime { get; }
Property Value
Type | Description |
---|---|
Int64 |
Length
Gets or sets the length of an object.
Declaration
long Length { get; set; }
Property Value
Type | Description |
---|---|
Int64 |
Methods
Split(Int64)
Splits the current object by the specified time.
Declaration
SplitLengthedObject Split(long time)
Parameters
Type | Name | Description |
---|---|---|
Int64 | time | Time to split the object at. |
Returns
Type | Description |
---|---|
SplitLengthedObject | An object containing left and right parts of the split object. Both parts have the same type as the original object. |
Remarks
If time
is less than or equal to time of the object, the left part will
be null
. If time
is greater than or equal to end time of the object,
the right part will be null
.
Let's see a simple example. Suppose we have an object with time of 10
and length of 50
.
The table below shows what left and right parts will be in case of different values of
time
:
Time to split at | Left part | Right part |
---|---|---|
5 | null | Copy of the object |
10 | null | Copy of the object |
30 | Copy of the object with time of 10 and length of 20 | Copy of the object with time of 30 and length of 30 |
60 | Copy of the object | null |
70 | Copy of the object | null |
To learn about other ways to split an object please read Objects splitting article.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | time is negative. |