Class MidiTokensReaderUtilities
Provides useful utility methods for MidiTokensReader. See
Lazy reading/writing article to learn more.
Inherited Members
Namespace: Melanchall.DryWetMidi.Core
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class MidiTokensReaderUtilities
Methods
EnumerateEvents(MidiTokensReader)
Returns all consecutive MIDI events read with the specified MidiTokensReader
as a lazy collection.
Declaration
public static EnumerateEventsResult EnumerateEvents(this MidiTokensReader reader)
Parameters
Type | Name | Description |
---|---|---|
MidiTokensReader | reader | MidiTokensReader to read MIDI events with. |
Returns
Type | Description |
---|---|
EnumerateEventsResult | An instance of the EnumerateEventsResult containing a lazy collection of consecutive
MIDI events read with the reader . |
Remarks
A collection contained in the returned object will iterate over MIDI tokens with the reader
until a file's end or start of a next chunk occurred.
For example, the reader is now at the first MIDI events of a track chunk that contains 10 events. The method will return an object that contains a lazy collection that will iterate over those 10 events only, because a next MIDI token in the file is not a MIDI event.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | reader is null . |
EnumerateTokens(MidiTokensReader)
Returns all MIDI tokens read with the specified MidiTokensReader
as a lazy collection.
Declaration
public static IEnumerable<MidiToken> EnumerateTokens(this MidiTokensReader reader)
Parameters
Type | Name | Description |
---|---|---|
MidiTokensReader | reader | MidiTokensReader to read MIDI tokens with. |
Returns
Type | Description |
---|---|
IEnumerable<MidiToken> | Lazy collection of MIDI tokens read with the reader . |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | reader is null . |