MCPcopy Create free account
hub / github.com/csound/csound / GetMidiData

Method GetMidiData

interfaces/cs_glue.cpp:1003–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1001 */
1002
1003int CsoundMidiInputBuffer::GetMidiData(unsigned char *buf, int nBytes)
1004{
1005 int i;
1006
1007 if (!bufBytes)
1008 return 0;
1009 csoundLockMutex(mutex_);
1010 for (i = 0; i < nBytes && bufBytes > 0; i++) {
1011 buf[i] = this->buf[bufReadPos];
1012 bufReadPos = (bufReadPos < (bufSize - 1) ? bufReadPos + 1 : 0);
1013 bufBytes--;
1014 }
1015 csoundUnlockMutex(mutex_);
1016 return i;
1017}
1018
1019// ----------------------------------------------------------------------------
1020

Callers 1

midiInReadCallbackMethod · 0.80

Calls 2

csoundLockMutexFunction · 0.85
csoundUnlockMutexFunction · 0.85

Tested by

no test coverage detected