Class File

Description

Represents a MIDI file

  • since: 1.0

Located in /Emit/File.php (line 26)


	
			
Variable Summary
int $format
array $tracks
Method Summary
File __construct ( $timeDivision, [ $format = null])
File addTrack (Track $track)
FileHeader createFileHeader (int $format, int $numTracks, int $timeDivision)
SplFileObject createFileObject (string $file)
string getData ()
int save (SplFileObject|string $file)
Variables
int $format (line 43)
  • access: private
int $timeDivision (line 38)
  • access: private
array $tracks (line 33)

Collection of tracks

  • access: private
Methods
Constructor __construct (line 50)

Constructor

  • since: 1.0
  • access: public
File __construct ( $timeDivision, [ $format = null])
  • $timeDivision
  • $format
addTrack (line 158)

Adds a track to the file

  • return: A reference to $this
  • since: 1.0
  • access: public
File addTrack (Track $track)
createFileHeader (line 135)

Creates a file header chunk

FileHeader createFileHeader (int $format, int $numTracks, int $timeDivision)
  • int $format: The MIDI file format
  • int $numTracks: The number of tracks in the file
  • int $timeDivision: The number of MIDI clock ticks per quarter note
createFileObject (line 121)

Creates a file object in "wb" mode suitable for save()

SplFileObject createFileObject (string $file)
  • string $file: A file path
getData (line 67)

Gets the binary data for the MIDI file

string getData ()
getTimer (line 146)

Gets a timer for the file's time division

  • since: 1.0
  • access: public
Timer getTimer ()
save (line 103)

Saves the MIDI file to the specified file

int save (SplFileObject|string $file)
  • SplFileObject|string $file: A file path, or a file object opened in "wb" mode

Documentation generated on Sun, 25 Oct 2009 22:38:16 -0700 by phpDocumentor 1.4.3