writeFile method

dynamic writeFile(
  1. File fileHandle
)

Write the MIDI File. param fileHandle: A file handle that has been opened for binary writing.

Implementation

/// param fileHandle: A file handle that has been opened for binary
/// writing.

writeFile(File fileHandle) {
  this._header.writeFile(fileHandle);

  // Close the _tracks and have them create the MIDI event data structures.
  this.close();

  // Write the MIDI Events to file.

  List.generate(this.numTracks, (i) {
    this._tracks[i].writeTrack(fileHandle);
  });
}