|
AudioDataLib
A C++ library of classes supporting a variety of audio-data tasks.
|
#include <MidiData.h>
Public Member Functions | |
| Event () | |
| virtual | ~Event () |
| virtual bool | Decode (ByteStream &inputStream, Error &error)=0 |
| virtual bool | Encode (ByteStream &outputStream, Error &error) const =0 |
| virtual std::string | LogMessage () const =0 |
Public Attributes | |
| uint64_t | deltaTimeTicks |
Instances of the Event class are MIDI messages. There are three different types of such messages, and so there are three derivatives of this class; namely, MetaEvent, ChannelEvent and SystemExclusiveEvent. A common base ensures here that each derivative impliments an encoder and a decoder for data typically seen going to, or coming from, a MIDI port.
Encoding/decoding of events seems like it's something that should only be part of the MidiFileFormat class, but in other contexts we need to be able to encode an event (e.g., before we send it down to a MIDI device on a MIDI port for synthesis); and similarly, we also need to be able to decode a MIDI message (e.g., that we receive from a MIDI port for storage.)
| MidiData::Event::Event | ( | ) |
|
virtual |
|
pure virtual |
Try to read and interpret bytes from the given stream as a MIDI message of the derived class type.
| [in,out] | inputStream | The byte stream from which to read bytes. |
| [out] | error | An error object containing reasons for failure if false is returned. |
Implemented in AudioDataLib::MidiData::SystemExclusiveEvent, AudioDataLib::MidiData::MetaEvent, and AudioDataLib::MidiData::ChannelEvent.
|
pure virtual |
Try to write this MIDI message (of the derived class type) as a sequence of bytes to the given stream. This is how the message should be stored in a MIDI file or how it should appear when handed to, or received from, a MIDI device.
| [in,out] | outputStream | The byte stream to which bytes are to be written. |
| [out] | error | An error object containing reasons for failure if false is returned. |
Implemented in AudioDataLib::MidiData::SystemExclusiveEvent, AudioDataLib::MidiData::MetaEvent, and AudioDataLib::MidiData::ChannelEvent.
|
pure virtual |
Return a one-line, human-readable message for logging purposes.
Implemented in AudioDataLib::MidiData::SystemExclusiveEvent, AudioDataLib::MidiData::MetaEvent, and AudioDataLib::MidiData::ChannelEvent.
| uint64_t AudioDataLib::MidiData::Event::deltaTimeTicks |