Class TimedEvent
Represents wrapper for the MidiEvent that provides absolute time of an event.
Inherited Members
Namespace: Melanchall.DryWetMidi.Interaction
Assembly: Melanchall.DryWetMidi.dll
Syntax
public class TimedEvent : ITimedObject, INotifyTimeChanged
Constructors
TimedEvent(MidiEvent)
Initializes a new instance of the TimedEvent with the
specified MIDI event.
Declaration
public TimedEvent(MidiEvent midiEvent)
Parameters
Type | Name | Description |
---|---|---|
MidiEvent | midiEvent | An event to wrap into TimedEvent. |
TimedEvent(MidiEvent, long)
Initializes a new instance of the TimedEvent with the
specified MIDI event and absolute time.
Declaration
public TimedEvent(MidiEvent midiEvent, long time)
Parameters
Type | Name | Description |
---|---|---|
MidiEvent | midiEvent | An event to wrap into TimedEvent. |
long | time | Absolute time of an event in units defined by the time division of a MIDI file. |
Properties
Event
Gets wrapped MIDI event.
Declaration
public MidiEvent Event { get; }
Property Value
Type | Description |
---|---|
MidiEvent |
Time
Gets or sets absolute time of the event in units defined by the time division of a MIDI file.
Declaration
public long Time { get; set; }
Property Value
Type | Description |
---|---|
long |
Remarks
Note that the returned value will be in ticks (not seconds, not milliseconds and so on).
Please read Time and length article to learn how you can
get the time in different representations.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | value is negative. |
Methods
Clone()
Clones object by creating a copy of it.
Declaration
public virtual ITimedObject Clone()
Returns
Type | Description |
---|---|
ITimedObject | Copy of the object. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
Events
TimeChanged
Occurs when the time of an object has been changed.
Declaration
public event EventHandler<TimeChangedEventArgs> TimeChanged
Event Type
Type | Description |
---|---|
EventHandler<TimeChangedEventArgs> |