|
NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
|
Stores a buffer of MIDI data bytes in a std::vector, plus a byte for the checksum. More...
#include <sysex.h>
Public Member Functions | |
| MIDISystemExclusive (unsigned int len=0) | |
| Creates a new object initially empty. More... | |
| MIDISystemExclusive (const MIDISystemExclusive &e) | |
| The copy constructor. More... | |
| MIDISystemExclusive (const unsigned char *buf, unsigned int len) | |
| Creates a new object from the given buffer of bytes. More... | |
| virtual | ~MIDISystemExclusive () |
| The destructor. More... | |
| MIDISystemExclusive & | operator= (const MIDISystemExclusive &se) |
| The assignment operator. More... | |
| bool | operator== (const MIDISystemExclusive &se) const |
| The equal operator compares the data buffer and the checksum. More... | |
| void | Clear () |
| Resets the buffer to 0 length data and the checksum to 0. More... | |
| void | ClearChecksum () |
| Resets the checksum to 0. More... | |
| unsigned char | GetChecksum () const |
| Returns the checksum. More... | |
| int | GetLength () const |
| Returns the number of data bytes stored in the buffer. More... | |
| unsigned char | GetData (int i) const |
| Returns the i-th byte in the buffer. More... | |
| const unsigned char * | GetBuffer () const |
| Returns a pointer to the data buffer. More... | |
| bool | IsGMReset () const |
| Returns true if the buffer contains a GM Reset sysex message. More... | |
| bool | IsGSReset () const |
| Returns true if the buffer contains a GS Reset sysex message. More... | |
| bool | IsXGReset () const |
| Returns true if the buffer contains a XG Reset sysex message. More... | |
| void | PutSysByte (unsigned char b) |
| Appends a byte to the buffer, without adding it to checksum. More... | |
| void | PutByte (unsigned char b) |
| Appends a byte to the buffer, adding it to checksum. More... | |
| void | PutEXC () |
| Appends a System exclusive Start byte (0xF0) to the buffer, without affecting the checksum. More... | |
| void | PutEOX () |
| Appends a System exclusive End byte (0xF7) to the buffer, without affecting the checksum. More... | |
| void | PutNibblizedByteLH (unsigned char b) |
| Appends two bytes, containing the low (1st) and the high nibble of b. Adds them to the checksum. More... | |
| void | PutNibblizedByteHL (unsigned char b) |
| Appends two bytes, containing the high (1st) and the low nibble of b. Adds them to the checksum. More... | |
| void | PutChecksum () |
| Appends the checksum to the buffer. More... | |
Stores a buffer of MIDI data bytes in a std::vector, plus a byte for the checksum.
It is used by the MIDIMessage class for keeping an arbitrary amount of data (tipically the data attached to a MIDI sysex message, but also the text meta messages and some other type utilizes it).
| MIDISystemExclusive::MIDISystemExclusive | ( | unsigned int | len = 0 | ) |
Creates a new object initially empty.
If you know the length of the data it will contain you can specify it here.
| MIDISystemExclusive::MIDISystemExclusive | ( | const MIDISystemExclusive & | e | ) |
The copy constructor.
| MIDISystemExclusive::MIDISystemExclusive | ( | const unsigned char * | buf, |
| unsigned int | len | ||
| ) |
Creates a new object from the given buffer of bytes.
It allocates the appropriate memory amount and copies the buffer data, so every instance has its own buffer.
| buf | the address of our data buffer |
| len | the length of the buffer |
|
inlinevirtual |
The destructor.
| MIDISystemExclusive & MIDISystemExclusive::operator= | ( | const MIDISystemExclusive & | se | ) |
The assignment operator.
It allocates the appropriate memory amount and copies the buffer data, so every instance has its own buffer.
| bool MIDISystemExclusive::operator== | ( | const MIDISystemExclusive & | se | ) | const |
The equal operator compares the data buffer and the checksum.
|
inline |
Resets the buffer to 0 length data and the checksum to 0.
|
inline |
Resets the checksum to 0.
|
inline |
Returns the checksum.
|
inline |
Returns the number of data bytes stored in the buffer.
|
inline |
Returns the i-th byte in the buffer.
|
inline |
Returns a pointer to the data buffer.
| bool MIDISystemExclusive::IsGMReset | ( | ) | const |
Returns true if the buffer contains a GM Reset sysex message.
| bool MIDISystemExclusive::IsGSReset | ( | ) | const |
Returns true if the buffer contains a GS Reset sysex message.
| bool MIDISystemExclusive::IsXGReset | ( | ) | const |
Returns true if the buffer contains a XG Reset sysex message.
|
inline |
Appends a byte to the buffer, without adding it to checksum.
|
inline |
Appends a byte to the buffer, adding it to checksum.
|
inline |
Appends a System exclusive Start byte (0xF0) to the buffer, without affecting the checksum.
|
inline |
Appends a System exclusive End byte (0xF7) to the buffer, without affecting the checksum.
|
inline |
Appends two bytes, containing the low (1st) and the high nibble of b. Adds them to the checksum.
|
inline |
Appends two bytes, containing the high (1st) and the low nibble of b. Adds them to the checksum.
|
inline |
Appends the checksum to the buffer.