ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

The QuickTime Music version of MidiParser. More...

#include <midiparser_qt.h>

Inheritance diagram for MidiParser_QT:
Collaboration diagram for MidiParser_QT:

List of all members.


class  MIDISampleDesc
struct  MIDITrackInfo
struct  PartStatus

Public Member Functions

 MidiParser_QT ()
 ~MidiParser_QT ()
bool loadMusic (byte *data, uint32 size)
void unloadMusic ()
bool loadFromTune (Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)
 Load the MIDI from a 'Tune' resource.
bool loadFromContainerStream (Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)
 Load the MIDI from a QuickTime stream.
bool loadFromContainerFile (const Common::String &fileName)
 Load the MIDI from a QuickTime file.

Protected Member Functions

void parseNextEvent (EventInfo &info)
void resetTracking ()
SampleDescreadSampleDesc (Track *track, uint32 format, uint32 descSize)

Private Types

typedef Common::HashMap< uint,
typedef Common::HashMap< uint,

Private Member Functions

uint32 readNextEvent ()
void handleGeneralEvent (uint32 control)
void handleControllerEvent (uint32 control, uint32 part, byte intPart, byte fracPart)
void handleNoteEvent (uint32 part, byte pitch, byte velocity, uint32 length)
void definePart (uint32 part, uint32 instrument)
void setupPart (uint32 part)
byte getChannel (uint32 part)
bool isChannelAllocated (byte channel) const
byte findFreeChannel (uint32 part)
void deallocateFreeChannel ()
void deallocateChannel (byte channel)
bool allChannelsAllocated () const
bytereadWholeTrack (Common::QuickTimeParser::Track *track, uint32 &trackSize)
void initFromContainerTracks ()
void initCommon ()
uint32 readUint32 ()

Private Attributes

Common::Array< MIDITrackInfo_trackInfo
Common::Queue< EventInfo_queuedEvents
PartMap _partMap
ChannelMap _channelMap

Detailed Description

The QuickTime Music version of MidiParser.

QuickTime Music is actually a superset of MIDI. It has its own custom instruments and supports more than 15 non-percussion channels. It also has custom control changes and a more advanced pitch bend (which we convert to GM pitch bend as best as possible). We then use the fallback GM instrument that each QuickTime instrument definition has to provide.

Furthermore, Apple's documentation on this is terrible. You know documentation is bad when it contradicts itself three times on the same subject (like about setting the GM instrument field to percussion).

This is as close to a proper QuickTime Music parser as we can currently implement using our MidiParser interface.

Definition at line 48 of file midiparser_qt.h.

Member Typedef Documentation

Definition at line 126 of file midiparser_qt.h.

Definition at line 123 of file midiparser_qt.h.

Constructor & Destructor Documentation

MidiParser_QT::MidiParser_QT (  )  [inline]

Definition at line 50 of file midiparser_qt.h.

MidiParser_QT::~MidiParser_QT (  )  [inline]

Definition at line 51 of file midiparser_qt.h.

Member Function Documentation

bool MidiParser_QT::allChannelsAllocated (  )  const [private]

Definition at line 344 of file midiparser_qt.cpp.

void MidiParser_QT::deallocateChannel ( byte  channel  )  [private]

Definition at line 327 of file midiparser_qt.cpp.

void MidiParser_QT::deallocateFreeChannel (  )  [private]

Definition at line 314 of file midiparser_qt.cpp.

void MidiParser_QT::definePart ( uint32  part,
uint32  instrument 
) [private]

Definition at line 273 of file midiparser_qt.cpp.

byte MidiParser_QT::findFreeChannel ( uint32  part  )  [private]

Definition at line 296 of file midiparser_qt.cpp.

byte MidiParser_QT::getChannel ( uint32  part  )  [private]

Definition at line 285 of file midiparser_qt.cpp.

void MidiParser_QT::handleControllerEvent ( uint32  control,
uint32  part,
byte  intPart,
byte  fracPart 
) [private]

Definition at line 195 of file midiparser_qt.cpp.

void MidiParser_QT::handleGeneralEvent ( uint32  control  )  [private]

Definition at line 245 of file midiparser_qt.cpp.

void MidiParser_QT::handleNoteEvent ( uint32  part,
byte  pitch,
byte  velocity,
uint32  length 
) [private]

Definition at line 184 of file midiparser_qt.cpp.

void MidiParser_QT::initCommon (  )  [private]

Definition at line 439 of file midiparser_qt.cpp.

void MidiParser_QT::initFromContainerTracks (  )  [private]

Definition at line 419 of file midiparser_qt.cpp.

bool MidiParser_QT::isChannelAllocated ( byte  channel  )  const [private]

Definition at line 336 of file midiparser_qt.cpp.

bool MidiParser_QT::loadFromContainerFile ( const Common::String fileName  ) 

Load the MIDI from a QuickTime file.

Definition at line 98 of file midiparser_qt.cpp.

bool MidiParser_QT::loadFromContainerStream ( Common::SeekableReadStream stream,
DisposeAfterUse::Flag  disposeAfterUse = DisposeAfterUse::YES 

Load the MIDI from a QuickTime stream.

Definition at line 88 of file midiparser_qt.cpp.

bool MidiParser_QT::loadFromTune ( Common::SeekableReadStream stream,
DisposeAfterUse::Flag  disposeAfterUse = DisposeAfterUse::YES 

Load the MIDI from a 'Tune' resource.

Definition at line 59 of file midiparser_qt.cpp.

bool MidiParser_QT::loadMusic ( byte data,
uint32  size 

Definition at line 27 of file midiparser_qt.cpp.

void MidiParser_QT::parseNextEvent ( EventInfo info  )  [protected]

Definition at line 108 of file midiparser_qt.cpp.

uint32 MidiParser_QT::readNextEvent (  )  [private]

Definition at line 118 of file midiparser_qt.cpp.

Common::QuickTimeParser::SampleDesc * MidiParser_QT::readSampleDesc ( Track track,
uint32  format,
uint32  descSize 
) [protected, virtual]

Implements Common::QuickTimeParser.

Definition at line 398 of file midiparser_qt.cpp.

uint32 MidiParser_QT::readUint32 (  )  [private]

Definition at line 488 of file midiparser_qt.cpp.

byte * MidiParser_QT::readWholeTrack ( Common::QuickTimeParser::Track track,
uint32 trackSize 
) [private]

Definition at line 455 of file midiparser_qt.cpp.

void MidiParser_QT::resetTracking (  )  [protected]

Definition at line 391 of file midiparser_qt.cpp.

void MidiParser_QT::setupPart ( uint32  part  )  [private]

Definition at line 359 of file midiparser_qt.cpp.

void MidiParser_QT::unloadMusic (  ) 

Definition at line 48 of file midiparser_qt.cpp.

Member Data Documentation

Definition at line 127 of file midiparser_qt.h.

Definition at line 124 of file midiparser_qt.h.

The documentation for this class was generated from the following files:

Generated on Sat Jun 22 2019 05:02:36 for ResidualVM by doxygen 1.7.1
curved edge   curved edge