Search Results for

    Show / Hide Table of Contents

    Class TimedEvent

    Represents wrapper for the MidiEvent that provides absolute time of an event.
    Inheritance
    object
    TimedEvent
    Implements
    ITimedObject
    INotifyTimeChanged
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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
    object.ToString()

    Events

    TimeChanged

    Occurs when the time of an object has been changed.
    Declaration
    public event EventHandler<TimeChangedEventArgs> TimeChanged
    Event Type
    Type Description
    EventHandler<TimeChangedEventArgs>

    Implements

    ITimedObject
    INotifyTimeChanged

    Extension Methods

    TimedObjectUtilities.TimeAs(ITimedObject, TimeSpanType, TempoMap)
    TimedObjectUtilities.TimeAs<TTime>(ITimedObject, TempoMap)
    TimedObjectUtilities.SetTime<TObject>(TObject, ITimeSpan, TempoMap)
    In this article
    Back to top 2024 / Generated by DocFX