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

Method GetStatus

interfaces/cs_glue.cpp:1155–1173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153 */
1154
1155int CsoundMidiOutputBuffer::GetStatus()
1156{
1157 unsigned char st = (unsigned char) 0;
1158
1159 if (bufBytes) {
1160 csoundLockMutex(mutex_);
1161 if (bufBytes > 0) {
1162 int nBytes;
1163 st = buf[bufReadPos] & (unsigned char) 0xFF;
1164 nBytes = (int) midiMessageByteCnt[(st & (unsigned char) 0xF8) >> 3];
1165 if (nBytes <= 0 || bufBytes < nBytes)
1166 st = (unsigned char) 0; // invalid MIDI data
1167 if (nBytes > 1)
1168 st &= (unsigned char) 0xF0; // channel msg: remove channel number
1169 }
1170 csoundUnlockMutex(mutex_);
1171 }
1172 return (int) st;
1173}
1174
1175/**
1176 * Returns the channel number (1 to 16) for the first message in the

Callers 1

CsoundPTgetStatusFunction · 0.80

Calls 2

csoundLockMutexFunction · 0.85
csoundUnlockMutexFunction · 0.85

Tested by

no test coverage detected