Class TrackChunkUtilities
Provides extension methods for TrackChunk.
Inherited Members
Namespace: Melanchall.DryWetMidi.Core
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class TrackChunkUtilities
Methods
Explode(TrackChunk)
Splits a track chunk into multiple ones that correspond to MultiTrack.
Declaration
public static IEnumerable<TrackChunk> Explode(this TrackChunk trackChunk)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackChunk | trackChunk | Track chunk to split into multiple ones. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TrackChunk> | Multiple track chunks that represent trackChunk. |
Remarks
Note that events will be cloned so events in the result track chunks will not be equal
by reference to events in the
trackChunk.Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | trackChunk is null. |
GetChannels(TrackChunk)
Gets all channel numbers presented in the specified TrackChunk.
Declaration
public static IEnumerable<FourBitNumber> GetChannels(this TrackChunk trackChunk)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackChunk | trackChunk | TrackChunk to get channels of. |
Returns
| Type | Description |
|---|---|
| IEnumerable<FourBitNumber> | Collection of channel numbers presented in the trackChunk. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | trackChunk is null. |
GetChannels(IEnumerable<TrackChunk>)
Gets all channel numbers presented in the specified collection of TrackChunk.
Declaration
public static IEnumerable<FourBitNumber> GetChannels(this IEnumerable<TrackChunk> trackChunks)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TrackChunk> | trackChunks | Collection of TrackChunk to get channels of. |
Returns
| Type | Description |
|---|---|
| IEnumerable<FourBitNumber> | Collection of channel numbers presented in the trackChunks. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | trackChunks is null. |
GetTrackChunks(MidiFile)
Gets all track chunks of a MIDI file.
Declaration
public static IEnumerable<TrackChunk> GetTrackChunks(this MidiFile midiFile)
Parameters
| Type | Name | Description |
|---|---|---|
| MidiFile | midiFile | MIDI file to get track chunks of. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TrackChunk> | Collection of track chunks contained in the midiFile. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | midiFile is null. |
Merge(IEnumerable<TrackChunk>)
Merges multiple track chunks into one that corresponds to SingleTrack.
Declaration
public static TrackChunk Merge(this IEnumerable<TrackChunk> trackChunks)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TrackChunk> | trackChunks | Track chunks to merge into one. |
Returns
| Type | Description |
|---|---|
| TrackChunk | Track chunk that contains all events from the trackChunks. |
Remarks
Note that events will be cloned so events in the result track chunk will not be equal
by reference to events in the
trackChunks.Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | trackChunks is null. |
| ArgumentException | trackChunks is an empty collection. |