Class TrackParser

Description

Class for parsing MIDI tracks

The parse state is initialized to ParseState::TRACK_HEADER.

  • since: 1.0

Located in /Parsing/TrackParser.php (line 27)

Parser
   |
   --TrackParser
Variable Summary
Method Summary
TrackParser __construct ([EventParser $eventParser = null], [DeltaParser $deltaParser = null])
void afterSetFile ()
void checkTrackLength (int $length)
binary getRawTrackHeader ()
TrackHeader parseTrackHeader (binary $header)
Variables
DeltaParser $deltaParser (line 37)
  • access: private
EventParser $eventParser (line 32)
  • access: private
int $expectedTrackLength (line 44)

The expected length of the track in bytes

  • access: private
int $parsedTrackLength (line 51)

The number of bytes that have been parsed so far

  • access: private

Inherited Variables

Inherited from Parser

Parser::$file
Parser::$state
Methods
Constructor __construct (line 62)

Constructor

TrackParser __construct ([EventParser $eventParser = null], [DeltaParser $deltaParser = null])

Redefinition of:
Parser::__construct()
Constructor
afterSetFile (line 146)
  • since: 1.0
  • access: protected
  • uses: DeltaParser::setFile()
  • uses: EventParser::setFile()
void afterSetFile ()

Redefinition of:
Parser::afterSetFile()
Called after setFile()
checkTrackLength (line 210)

Verifies that the track length does not exceed its expected length

  • todo: The parsed track length increment shouldn't happen here
  • since: 1.0
  • throws: ParseException if the track length exceeds its expected length
  • access: protected
  • usedby: TrackParser::parse()
void checkTrackLength (int $length)
  • int $length: The number of bytes to add to the parsed track bytes
getExpectedTrackLength (line 78)

Gets the expected length of the track in bytes

  • since: 1.0
  • access: public
int getExpectedTrackLength ()
getParsedTrackLength (line 90)

Gets the total number of bytes that have already been parsed in the track

  • since: 1.0
  • access: public
int getParsedTrackLength ()
getRawTrackHeader (line 103)

Gets the raw binary track header

binary getRawTrackHeader ()
parse (line 165)
Chunk parse ()

Redefinition of:
Parser::parse()
Parses the buffer stream and returns the next chunk
parseTrackHeader (line 119)

Parses the given track header

TrackHeader parseTrackHeader (binary $header)
  • binary $header

Inherited Methods

Inherited From Parser

Parser::__construct()
Parser::afterLoad()
Parser::afterSetFile()
Parser::createFileObject()
Parser::getDelta()
Parser::getState()
Parser::load()
Parser::parse()
Parser::read()
Parser::setFile()
Parser::setState()

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