Class MidiEvent
Represents a MIDI file event stored in a track chunk.
Assembly: Melanchall.DryWetMidi.dll
Syntax
public abstract class MidiEvent
Constructors
MidiEvent(MidiEventType)
Initializes a new instance of the
MidiEvent with the specified event type.
Declaration
protected MidiEvent(MidiEventType eventType)
Parameters
Fields
UnknownContentSize
Constant for content's size of events that don't have size information stored.
Declaration
public const int UnknownContentSize = -1
Field Value
Properties
DeltaTime
Gets or sets delta-time of the event.
Declaration
public long DeltaTime { get; set; }
Property Value
Exceptions
EventType
Gets the type of the event.
Declaration
public MidiEventType EventType { get; }
Property Value
Methods
Clone()
Clones event by creating a copy of it.
Declaration
Returns
Type |
Description |
MidiEvent |
Copy of the event. |
CloneEvent()
Clones event by creating a copy of it.
Declaration
protected abstract MidiEvent CloneEvent()
Returns
Type |
Description |
MidiEvent |
Copy of the event. |
Equals(MidiEvent, MidiEvent)
Determines whether two specified
MidiEvent objects have the same content.
Declaration
public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2)
Parameters
Type |
Name |
Description |
MidiEvent |
midiEvent1 |
The first event to compare, or null . |
MidiEvent |
midiEvent2 |
The second event to compare, or null . |
Returns
Type |
Description |
bool |
true if the midiEvent1 is equal to the midiEvent2 ;
otherwise, false . |
Equals(MidiEvent, MidiEvent, MidiEventEqualityCheckSettings)
Determines whether two specified
MidiEvent objects have the same content.
Declaration
public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2, MidiEventEqualityCheckSettings settings)
Parameters
Returns
Type |
Description |
bool |
true if the midiEvent1 is equal to the midiEvent2 ;
otherwise, false . |
Equals(MidiEvent, MidiEvent, MidiEventEqualityCheckSettings, out string)
Determines whether two specified
MidiEvent objects have the same content using
the specified comparison settings.
Declaration
public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2, MidiEventEqualityCheckSettings settings, out string message)
Parameters
Type |
Name |
Description |
MidiEvent |
midiEvent1 |
The first event to compare, or null . |
MidiEvent |
midiEvent2 |
The second event to compare, or null . |
MidiEventEqualityCheckSettings |
settings |
Settings according to which events should be compared. |
string |
message |
Message containing information about what exactly is different in
midiEvent1 and midiEvent2 . |
Returns
Type |
Description |
bool |
true if the midiEvent1 is equal to the midiEvent2 ;
otherwise, false . |
Equals(MidiEvent, MidiEvent, out string)
Determines whether two specified
MidiEvent objects have the same content.
Declaration
public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2, out string message)
Parameters
Type |
Name |
Description |
MidiEvent |
midiEvent1 |
The first event to compare, or null . |
MidiEvent |
midiEvent2 |
The second event to compare, or null . |
string |
message |
Message containing information about what exactly is different in
midiEvent1 and midiEvent2 . |
Returns
Type |
Description |
bool |
true if the midiEvent1 is equal to the midiEvent2 ;
otherwise, false . |