Csound and CsoundAC API  5.17
Public Member Functions | Protected Member Functions | Private Attributes | Friends
CsoundMidiOutputBuffer Class Reference

#include <cs_glue.hpp>

+ Inheritance diagram for CsoundMidiOutputBuffer:

Public Member Functions

 CsoundMidiOutputBuffer (unsigned char *buf, int bufSize)
int GetChannel ()
 Returns the channel number (1 to 16) for the first message in the buffer.
int GetData1 ()
 Returns the first data byte (0 to 127) for the first message in the buffer.
int GetData2 ()
 Returns the second data byte (0 to 127) for the first message in the buffer.
int GetStatus ()
 Returns the status byte for the first message in the buffer, not including the channel number in the case of channel messages.
int PopMessage ()
 Pops and returns the first message from the buffer, in the following format: STATUS + DATA1 * 256 + DATA2 * 65536 where STATUS also includes the channel number (0 to 15), if any.
 ~CsoundMidiOutputBuffer ()

Protected Member Functions

int SendMidiData (const unsigned char *buf, int nBytes)
 Copies at most 'nBytes' bytes of MIDI data to the buffer from 'buf'.

Private Attributes

unsigned char * buf
int bufBytes
int bufReadPos
int bufSize
int bufWritePos
void * mutex_

Friends

class CsoundCallbackWrapper

Constructor & Destructor Documentation

CsoundMidiOutputBuffer::CsoundMidiOutputBuffer ( unsigned char *  buf,
int  bufSize 
)
CsoundMidiOutputBuffer::~CsoundMidiOutputBuffer ( )

Member Function Documentation

int CsoundMidiOutputBuffer::GetChannel ( )

Returns the channel number (1 to 16) for the first message in the buffer.

The return value is zero if there are no messages, or the first message is not a channel message.

int CsoundMidiOutputBuffer::GetData1 ( )

Returns the first data byte (0 to 127) for the first message in the buffer.

The return value is zero if there are no messages, or the first message does not have any data bytes.

int CsoundMidiOutputBuffer::GetData2 ( )

Returns the second data byte (0 to 127) for the first message in the buffer.

The return value is zero if there are no messages, or the first message has less than two data bytes.

int CsoundMidiOutputBuffer::GetStatus ( )

Returns the status byte for the first message in the buffer, not including the channel number in the case of channel messages.

The return value is zero if there are no messages.

int CsoundMidiOutputBuffer::PopMessage ( )

Pops and returns the first message from the buffer, in the following format: STATUS + DATA1 * 256 + DATA2 * 65536 where STATUS also includes the channel number (0 to 15), if any.

The return value is zero if there are no messages.

int CsoundMidiOutputBuffer::SendMidiData ( const unsigned char *  buf,
int  nBytes 
)
protected

Copies at most 'nBytes' bytes of MIDI data to the buffer from 'buf'.

Returns the number of bytes copied.

Friends And Related Function Documentation

friend class CsoundCallbackWrapper
friend

Field Documentation

unsigned char* CsoundMidiOutputBuffer::buf
private
int CsoundMidiOutputBuffer::bufBytes
private
int CsoundMidiOutputBuffer::bufReadPos
private
int CsoundMidiOutputBuffer::bufSize
private
int CsoundMidiOutputBuffer::bufWritePos
private
void* CsoundMidiOutputBuffer::mutex_
private