NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
MIDISystemExclusive Class Reference

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...
 
MIDISystemExclusiveoperator= (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...
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ MIDISystemExclusive() [1/3]

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() [2/3]

MIDISystemExclusive::MIDISystemExclusive ( const MIDISystemExclusive e)

The copy constructor.

◆ MIDISystemExclusive() [3/3]

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.

Parameters
bufthe address of our data buffer
lenthe length of the buffer

◆ ~MIDISystemExclusive()

virtual MIDISystemExclusive::~MIDISystemExclusive ( )
inlinevirtual

The destructor.

Member Function Documentation

◆ operator=()

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.

◆ operator==()

bool MIDISystemExclusive::operator== ( const MIDISystemExclusive se) const

The equal operator compares the data buffer and the checksum.

◆ Clear()

void MIDISystemExclusive::Clear ( )
inline

Resets the buffer to 0 length data and the checksum to 0.

◆ ClearChecksum()

void MIDISystemExclusive::ClearChecksum ( )
inline

Resets the checksum to 0.

◆ GetChecksum()

unsigned char MIDISystemExclusive::GetChecksum ( ) const
inline

Returns the checksum.

◆ GetLength()

int MIDISystemExclusive::GetLength ( ) const
inline

Returns the number of data bytes stored in the buffer.

◆ GetData()

unsigned char MIDISystemExclusive::GetData ( int  i) const
inline

Returns the i-th byte in the buffer.

◆ GetBuffer()

const unsigned char * MIDISystemExclusive::GetBuffer ( ) const
inline

Returns a pointer to the data buffer.

◆ IsGMReset()

bool MIDISystemExclusive::IsGMReset ( ) const

Returns true if the buffer contains a GM Reset sysex message.

◆ IsGSReset()

bool MIDISystemExclusive::IsGSReset ( ) const

Returns true if the buffer contains a GS Reset sysex message.

◆ IsXGReset()

bool MIDISystemExclusive::IsXGReset ( ) const

Returns true if the buffer contains a XG Reset sysex message.

◆ PutSysByte()

void MIDISystemExclusive::PutSysByte ( unsigned char  b)
inline

Appends a byte to the buffer, without adding it to checksum.

◆ PutByte()

void MIDISystemExclusive::PutByte ( unsigned char  b)
inline

Appends a byte to the buffer, adding it to checksum.

◆ PutEXC()

void MIDISystemExclusive::PutEXC ( )
inline

Appends a System exclusive Start byte (0xF0) to the buffer, without affecting the checksum.

◆ PutEOX()

void MIDISystemExclusive::PutEOX ( )
inline

Appends a System exclusive End byte (0xF7) to the buffer, without affecting the checksum.

◆ PutNibblizedByteLH()

void MIDISystemExclusive::PutNibblizedByteLH ( unsigned char  b)
inline

Appends two bytes, containing the low (1st) and the high nibble of b. Adds them to the checksum.

◆ PutNibblizedByteHL()

void MIDISystemExclusive::PutNibblizedByteHL ( unsigned char  b)
inline

Appends two bytes, containing the high (1st) and the low nibble of b. Adds them to the checksum.

◆ PutChecksum()

void MIDISystemExclusive::PutChecksum ( )
inline

Appends the checksum to the buffer.


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