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

TODO: Document this, give it a better name. More...

#include <mididrv.h>

Inheritance diagram for MidiDriver_BASE:
Collaboration diagram for MidiDriver_BASE:

List of all members.

Public Member Functions

 MidiDriver_BASE ()
virtual ~MidiDriver_BASE ()
virtual void send (uint32 b)=0
 Output a packed midi command to the midi stream.
virtual void send (int8 source, uint32 b)
 Send a MIDI command from a specific source.
void send (byte status, byte firstOp, byte secondOp)
 Output a midi command to the midi stream.
void send (int8 source, byte status, byte firstOp, byte secondOp)
 Send a MIDI command from a specific source.
virtual void sysEx (const byte *msg, uint16 length)
 Transmit a SysEx to the MIDI device.
virtual uint16 sysExNoDelay (const byte *msg, uint16 length)
 Transmit a SysEx to the MIDI device and return the necessary delay until the next SysEx event in milliseconds.
virtual void metaEvent (byte type, byte *data, uint16 length)
virtual void metaEvent (int8 source, byte type, byte *data, uint16 length)
 Send a meta event from a specific source.
virtual void stopAllNotes (bool stopSustainedNotes=false)
 Stops all currently active notes.
virtual bool isReady ()
 A driver implementation might need time to prepare playback of a track.

Protected Member Functions

void midiDumpInit ()
 Initialize midi dumping mechanism, called only if enabled.
int midiDumpVarLength (const uint32 &delta)
 Handles MIDI file variable length dumping.
void midiDumpDelta ()
 Handles MIDI file time delta dumping.
void midiDumpDo (uint32 b)
 Performs dumping of MIDI commands, called only if enabled.
void midiDumpSysEx (const byte *msg, uint16 length)
 Performs dumping of MIDI SysEx commands, called only if enabled.
void midiDumpFinish ()
 Writes the captured MIDI events to disk, called only if enabled.

Protected Attributes

bool _midiDumpEnable
 Enables midi dumping to a 'dump.mid' file and to debug messages on screen It's set by '--dump-midi' command line parameter.
uint32 _prevMillis
 Used for MIDI dumping delta calculation.
Common::Array< byte_midiDumpCache
 Stores all MIDI events, will be written to disk after an engine quits.

Detailed Description

TODO: Document this, give it a better name.

Definition at line 92 of file mididrv.h.


Constructor & Destructor Documentation

MidiDriver_BASE::MidiDriver_BASE (  ) 

Definition at line 568 of file mididrv.cpp.

MidiDriver_BASE::~MidiDriver_BASE (  )  [virtual]

Definition at line 572 of file mididrv.cpp.


Member Function Documentation

virtual bool MidiDriver_BASE::isReady (  )  [inline, virtual]

A driver implementation might need time to prepare playback of a track.

Use this function to check if the driver is ready to receive MIDI events.

Definition at line 188 of file mididrv.h.

virtual void MidiDriver_BASE::metaEvent ( byte  type,
byte data,
uint16  length 
) [inline, virtual]

Definition at line 156 of file mididrv.h.

virtual void MidiDriver_BASE::metaEvent ( int8  source,
byte  type,
byte data,
uint16  length 
) [inline, virtual]

Send a meta event from a specific source.

If the MIDI driver does not support multiple sources, the source parameter is ignored.

Definition at line 163 of file mididrv.h.

void MidiDriver_BASE::midiDumpDelta (  )  [protected]

Handles MIDI file time delta dumping.

Definition at line 551 of file mididrv.cpp.

void MidiDriver_BASE::midiDumpDo ( uint32  b  )  [protected]

Performs dumping of MIDI commands, called only if enabled.

Definition at line 555 of file mididrv.cpp.

void MidiDriver_BASE::midiDumpFinish (  )  [protected]

Writes the captured MIDI events to disk, called only if enabled.

Definition at line 564 of file mididrv.cpp.

void MidiDriver_BASE::midiDumpInit (  )  [protected]

Initialize midi dumping mechanism, called only if enabled.

Definition at line 542 of file mididrv.cpp.

void MidiDriver_BASE::midiDumpSysEx ( const byte msg,
uint16  length 
) [protected]

Performs dumping of MIDI SysEx commands, called only if enabled.

Definition at line 559 of file mididrv.cpp.

int MidiDriver_BASE::midiDumpVarLength ( const uint32 delta  )  [protected]

Handles MIDI file variable length dumping.

Definition at line 546 of file mididrv.cpp.

virtual void MidiDriver_BASE::send ( int8  source,
uint32  b 
) [inline, virtual]

Send a MIDI command from a specific source.

If the MIDI driver does not support multiple sources, the source parameter is ignored.

Definition at line 111 of file mididrv.h.

void MidiDriver_BASE::send ( byte  status,
byte  firstOp,
byte  secondOp 
)

Output a midi command to the midi stream.

Convenience wrapper around the usual 'packed' send method.

Do NOT use this for sysEx transmission; instead, use the sysEx() method below.

Definition at line 576 of file mididrv.cpp.

void MidiDriver_BASE::send ( int8  source,
byte  status,
byte  firstOp,
byte  secondOp 
)

Send a MIDI command from a specific source.

If the MIDI driver does not support multiple sources, the source parameter is ignored.

Definition at line 580 of file mididrv.cpp.

virtual void MidiDriver_BASE::send ( uint32  b  )  [pure virtual]

Output a packed midi command to the midi stream.

The 'lowest' byte (i.e. b & 0xFF) is the status code, then come (if used) the first and second opcode.

void MidiDriver_BASE::stopAllNotes ( bool  stopSustainedNotes = false  )  [virtual]

Stops all currently active notes.

Specify stopSustainedNotes if the MIDI data makes use of the sustain controller to also stop sustained notes.

Usually, the MIDI parser tracks active notes and terminates them when playback is stopped. This method should be used as a backup to silence the MIDI output in case the MIDI parser makes a mistake when tracking acive notes. It can also be used when quitting or pausing a game.

By default, this method sends an All Notes Off message and, if stopSustainedNotes is true, a Sustain off message on all MIDI channels. Driver implementations can override this if they want to implement this functionality in a different way.

Definition at line 584 of file mididrv.cpp.

virtual void MidiDriver_BASE::sysEx ( const byte msg,
uint16  length 
) [inline, virtual]

Transmit a SysEx to the MIDI device.

The given msg MUST NOT contain the usual SysEx frame, i.e. do NOT include the leading 0xF0 and the trailing 0xF7.

Furthermore, the maximal supported length of a SysEx is 264 bytes. Passing longer buffers can lead to undefined behavior (most likely, a crash).

Definition at line 139 of file mididrv.h.

virtual uint16 MidiDriver_BASE::sysExNoDelay ( const byte msg,
uint16  length 
) [inline, virtual]

Transmit a SysEx to the MIDI device and return the necessary delay until the next SysEx event in milliseconds.

This can be used to implement an alternate delay method than the OSystem::delayMillis function used by most sysEx implementations. Note that not every driver needs a delay, or supports this method. In this case, 0 is returned and the driver itself will do a delay if necessary.

For information on the SysEx data requirements, see the sysEx method.

Definition at line 153 of file mididrv.h.


Member Data Documentation

Stores all MIDI events, will be written to disk after an engine quits.

Definition at line 202 of file mididrv.h.

Enables midi dumping to a 'dump.mid' file and to debug messages on screen It's set by '--dump-midi' command line parameter.

Definition at line 196 of file mididrv.h.

Used for MIDI dumping delta calculation.

Definition at line 199 of file mididrv.h.


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


Generated on Sat Sep 26 2020 05:02:37 for ResidualVM by doxygen 1.7.1
curved edge   curved edge