ScummVM API documentation
MidiParser_HMP Class Reference

#include <midiparser_hmp.h>

Inheritance diagram for MidiParser_HMP:
MidiParser_SMF MidiParser

Public Member Functions

 MidiParser_HMP (int8 source=-1)
 
bool loadMusic (const byte *data, uint32 size) override
 
int32 determineDataSize (Common::SeekableReadStream *stream) override
 
- Public Member Functions inherited from MidiParser_SMF
 MidiParser_SMF (int8 source=-1)
 
bool loadMusic (const byte *data, uint32 size) override
 
int32 determineDataSize (Common::SeekableReadStream *stream) override
 
- Public Member Functions inherited from MidiParser
 MidiParser (int8 source=-1)
 
virtual void unloadMusic ()
 
virtual void property (int prop, int value)
 
virtual void setMidiDriver (MidiDriver_BASE *driver)
 
void setTimerRate (uint32 rate)
 
virtual void setTempo (uint32 tempo)
 
virtual void onTimer ()
 
bool isPlaying () const
 
bool startPlaying ()
 
void stopPlaying ()
 
void pausePlaying ()
 
void resumePlaying ()
 
bool setTrack (int track)
 
byte getActiveTrack ()
 
bool jumpToTick (uint32 tick, bool fireEvents=false, bool stopNotes=true, bool dontSendNoteOn=false)
 
virtual bool hasJumpIndex (uint8 index)
 
virtual bool jumpToIndex (uint8 index, bool stopNotes=true)
 
void setLoopSection (uint32 startPoint, uint32 endPoint=0)
 
void setLoopSectionMicroseconds (uint32 startPoint, uint32 endPoint=0)
 
void clearLoopSection ()
 
uint32 getPPQN ()
 
virtual uint32 getTick ()
 

Protected Types

enum  HmpVersion { VERSION_1, VERSION_013195 }
 

Protected Member Functions

uint32 readDelta (const byte *&data) override
 
HmpVersion determineVersion (const byte *pos)
 
- Protected Member Functions inherited from MidiParser_SMF
void parseNextEvent (EventInfo &info) override
 
- Protected Member Functions inherited from MidiParser
virtual void resetTracking ()
 
virtual void allNotesOff ()
 
virtual void determineNextEvent ()
 
virtual void rebaseTracking ()
 
virtual bool processEvent (const EventInfo &info, bool fireEvents=true)
 
void activeNote (byte channel, byte note, bool active)
 
void hangingNote (byte channel, byte note, uint32 ticksLeft, bool recycle=true)
 
void hangAllActiveNotes ()
 
virtual void onTrackStart (uint8 track)
 
virtual void sendToDriver (uint32 b)
 
void sendToDriver (byte status, byte firstOp, byte secondOp)
 
virtual void sendMetaEventToDriver (byte type, const byte *data, uint16 length)
 
uint32 read4high (const byte *&data)
 
uint16 read2low (const byte *&data)
 

Protected Attributes

HmpVersion _version
 
uint32 _branchOffset
 
uint32 _songLength
 
uint32 _channelPriorities [16]
 
uint32 _deviceTrackMappings [32][5]
 
uint8 _restoreControllers [128]
 
uint32 _callbackPointer
 
uint32 _callbackSegment
 
- Protected Attributes inherited from MidiParser
uint16 _activeNotes [128]
 Each uint16 is a bit mask for channels that have that note on.
 
NoteTimer _hangingNotes [32]
 Used for "Smart Jump" and MIDI formats that do not include explicit Note Off events. More...
 
byte _hangingNotesCount
 Count of hanging notes, used to optimize expiration.
 
MidiDriver_BASE_driver
 The device to which all events will be transmitted.
 
uint32 _timerRate
 The time in microseconds between onTimer() calls. Obtained from the MidiDriver.
 
uint32 _ppqn
 Pulses Per Quarter Note. (We refer to "pulses" as "ticks".)
 
uint32 _tempo
 Microseconds per quarter note.
 
uint32 _psecPerTick
 Microseconds per tick (_tempo / _ppqn).
 
uint32 _sysExDelay
 Number of microseconds until the next SysEx event can be sent.
 
bool _autoLoop
 For lightweight clients that don't provide their own flow control.
 
uint32 _loopStartPoint
 Start point (in ticks) of the looping section of the track.
 
uint32 _loopEndPoint
 End point (in ticks) of the looping section of the track.
 
uint32 _loopStartPointMs
 Start point (in microseconds) of the looping section of the track.
 
uint32 _loopEndPointMs
 End point (in microseconds) of the looping section of the track.
 
bool _smartJump
 Support smart expiration of hanging notes when jumping.
 
bool _centerPitchWheelOnUnload
 Center the pitch wheels when unloading a song.
 
bool _sendSustainOffOnNotesOff
 Send a sustain off on a notes off event, stopping hanging notes.
 
bool _disableAllNotesOffMidiEvents
 Don't send All Notes Off MIDI messages.
 
bool _disableAutoStartPlayback
 Do not automatically start playback after parsing MIDI data or setting the track.
 
const byte * _tracks [MAXIMUM_TRACKS][MAXIMUM_SUBTRACKS]
 Multi-track MIDI formats are supported, up to 120 tracks with 20 subtracks each.
 
byte _numTracks
 Count of total tracks for multi-track MIDI formats. 1 for single-track formats.
 
byte _numSubtracks [MAXIMUM_TRACKS]
 The number of subtracks for each track.
 
byte _activeTrack
 Keeps track of the currently active track, in multi-track formats.
 
Tracker _position
 The current time/position in the active track.
 
EventInfo_nextEvent
 
EventInfo _nextSubtrackEvents [MAXIMUM_SUBTRACKS]
 
bool _abortParse
 If a jump or other operation interrupts parsing, flag to abort.
 
bool _jumpingToTick
 True if currently inside jumpToTick.
 
bool _doParse
 True if the parser should be parsing; false if it should not be active.
 
bool _pause
 True if the parser has paused parsing.
 
int8 _source
 

Static Protected Attributes

static const char HMP_HEADER []
 
static const char HMP_HEADER_VERSION_1 []
 
static const char HMP_HEADER_VERSION_013195 []
 
- Static Protected Attributes inherited from MidiParser
static const uint8 MAXIMUM_TRACKS = 120
 
static const uint8 MAXIMUM_SUBTRACKS = 35
 

Additional Inherited Members

- Public Types inherited from MidiParser
enum  {
  mpAutoLoop = 2, mpSmartJump = 3, mpCenterPitchWheelOnUnload = 4, mpSendSustainOffOnNotesOff = 5,
  mpDisableAllNotesOffMidiEvents = 6, mpDisableAutoStartPlayback = 7
}
 
typedef void(* XMidiCallbackProc) (byte eventData, void *refCon)
 
- Static Public Member Functions inherited from MidiParser
static void defaultXMidiCallback (byte eventData, void *refCon)
 
static MidiParsercreateParser_SMF (int8 source=-1)
 
static MidiParsercreateParser_XMIDI (XMidiCallbackProc proc=defaultXMidiCallback, void *refCon=0, int source=-1)
 
static MidiParsercreateParser_QT (int8 source=-1)
 
static MidiParsercreateParser_HMP (int8 source=-1)
 
static void timerCallback (void *data)
 
- Static Protected Member Functions inherited from MidiParser
static uint32 readVLQ (const byte *&data)
 

Detailed Description

MIDI parser for the HMI SOS format HMP.

Implementation is incomplete. Currently only the track chunks are read and played back. Not implented yet: device track mapping, branching, callbacks, etc.

Member Function Documentation

◆ determineDataSize()

int32 MidiParser_HMP::determineDataSize ( Common::SeekableReadStream stream)
overridevirtual

Returns the size in bytes of the MIDI data in the specified stream, or -1 if the size could not be determined. The MIDI data must be in the format handled by the MidiParser subclass that this method is called on. Not every MidiParser subclass has an implementation of this method.

Reimplemented from MidiParser.


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