Class TimedEventsManagingUtilities
Extension methods for managing MIDI events by their absolute time.
Inheritance
TimedEventsManagingUtilities
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class TimedEventsManagingUtilities
Methods
AddEvent(TimedObjectsCollection<TimedEvent>, MidiEvent, ITimeSpan, TempoMap)
Declaration
[Obsolete("OBS16: Use TimedEvent constructor and add an object manually. More info: https://melanchall.github.io/drywetmidi/obsolete/obsolete.html#obs16.")]
public static void AddEvent(this TimedObjectsCollection<TimedEvent> eventsCollection, MidiEvent midiEvent, ITimeSpan time, TempoMap tempoMap)
Parameters
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .midiEvent is null .time is null .tempoMap is null .
|
ArgumentException |
midiEvent is either system real-time or
system common one. |
AddEvent(TimedObjectsCollection<TimedEvent>, MidiEvent, Int64)
Declaration
[Obsolete("OBS16: Use TimedEvent constructor and add an object manually. More info: https://melanchall.github.io/drywetmidi/obsolete/obsolete.html#obs16.")]
public static void AddEvent(this TimedObjectsCollection<TimedEvent> eventsCollection, MidiEvent midiEvent, long time)
Parameters
Exceptions
GetTimedEvents(EventsCollection, TimedEventDetectionSettings)
Declaration
public static ICollection<TimedEvent> GetTimedEvents(this EventsCollection eventsCollection, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<TimedEvent> |
Collection of timed events contained in eventsCollection ordered by time. |
Exceptions
See Also
GetTimedEvents(MidiFile, TimedEventDetectionSettings)
Declaration
public static ICollection<TimedEvent> GetTimedEvents(this MidiFile file, TimedEventDetectionSettings settings = null)
Parameters
Returns
Exceptions
See Also
GetTimedEvents(TrackChunk, TimedEventDetectionSettings)
Declaration
public static ICollection<TimedEvent> GetTimedEvents(this TrackChunk trackChunk, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<TimedEvent> |
Collection of timed events contained in trackChunk ordered by time. |
Exceptions
See Also
GetTimedEvents(IEnumerable<TrackChunk>, TimedEventDetectionSettings)
Declaration
public static ICollection<TimedEvent> GetTimedEvents(this IEnumerable<TrackChunk> trackChunks, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<TimedEvent> |
Collection of timed events contained in trackChunks ordered by time. |
Exceptions
See Also
ManageTimedEvents(EventsCollection, TimedEventDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<TimedEvent> ManageTimedEvents(this EventsCollection eventsCollection, TimedEventDetectionSettings settings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ManageTimedEvents(TrackChunk, TimedEventDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<TimedEvent> ManageTimedEvents(this TrackChunk trackChunk, TimedEventDetectionSettings settings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ProcessTimedEvents(EventsCollection, Action<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this EventsCollection eventsCollection, Action<TimedEvent> action, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .action is null .
|
ProcessTimedEvents(EventsCollection, Action<TimedEvent>, Predicate<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this EventsCollection eventsCollection, Action<TimedEvent> action, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .action is null .match is null .
|
ProcessTimedEvents(MidiFile, Action<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this MidiFile file, Action<TimedEvent> action, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
ProcessTimedEvents(MidiFile, Action<TimedEvent>, Predicate<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this MidiFile file, Action<TimedEvent> action, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
file is null .action is null .match is null .
|
ProcessTimedEvents(TrackChunk, Action<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this TrackChunk trackChunk, Action<TimedEvent> action, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunk is null .action is null .
|
ProcessTimedEvents(TrackChunk, Action<TimedEvent>, Predicate<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this TrackChunk trackChunk, Action<TimedEvent> action, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunk is null .action is null .match is null .
|
ProcessTimedEvents(IEnumerable<TrackChunk>, Action<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this IEnumerable<TrackChunk> trackChunks, Action<TimedEvent> action, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunks is null .action is null .
|
ProcessTimedEvents(IEnumerable<TrackChunk>, Action<TimedEvent>, Predicate<TimedEvent>, TimedEventDetectionSettings)
Declaration
public static int ProcessTimedEvents(this IEnumerable<TrackChunk> trackChunks, Action<TimedEvent> action, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunks is null .action is null .match is null .
|
RemoveTimedEvents(EventsCollection)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this EventsCollection eventsCollection)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
RemoveTimedEvents(EventsCollection, Predicate<TimedEvent>, TimedEventDetectionSettings)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this EventsCollection eventsCollection, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .match is null .
|
RemoveTimedEvents(MidiFile)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this MidiFile file)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
RemoveTimedEvents(MidiFile, Predicate<TimedEvent>, TimedEventDetectionSettings)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this MidiFile file, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
RemoveTimedEvents(TrackChunk)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this TrackChunk trackChunk)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
RemoveTimedEvents(TrackChunk, Predicate<TimedEvent>, TimedEventDetectionSettings)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this TrackChunk trackChunk, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunk is null .match is null .
|
RemoveTimedEvents(IEnumerable<TrackChunk>)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this IEnumerable<TrackChunk> trackChunks)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
RemoveTimedEvents(IEnumerable<TrackChunk>, Predicate<TimedEvent>, TimedEventDetectionSettings)
Removes all the
TimedEvent that match the conditions defined by the specified predicate.
Declaration
public static int RemoveTimedEvents(this IEnumerable<TrackChunk> trackChunks, Predicate<TimedEvent> match, TimedEventDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed timed events. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunks is null .match is null .
|
SetTime(TimedEvent, ITimeSpan, TempoMap)
Sets time of the specified timed event.
Declaration
[Obsolete("OBS14: Use SetTime method from TimedObjectUtilities. More info: https://melanchall.github.io/drywetmidi/obsolete/obsolete.html#obs14.")]
public static TimedEvent SetTime(this TimedEvent timedEvent, ITimeSpan time, TempoMap tempoMap)
Parameters
Type |
Name |
Description |
TimedEvent |
timedEvent |
Timed event to set time to. |
ITimeSpan |
time |
Time to set to timedEvent . |
TempoMap |
tempoMap |
Tempo map that will be used for time conversion. |
Returns
Type |
Description |
TimedEvent |
An input timedEvent with new time. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
timedEvent is null .time is null .tempoMap is null .
|