本文整理汇总了C++中MidiMessage::getSysExData方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiMessage::getSysExData方法的具体用法?C++ MidiMessage::getSysExData怎么用?C++ MidiMessage::getSysExData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiMessage
的用法示例。
在下文中一共展示了MidiMessage::getSysExData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToHexString
void PGMidiDevice::PGMidiInputCallback::handleIncomingMidiMessage(MidiInput *source, const MidiMessage &msg)
{
Logger::getCurrentLogger()->writeToLog("midiin: recv message:");
string dbg = ToHexString(msg.getRawData(), msg.getRawDataSize());
Logger::getCurrentLogger()->writeToLog(dbg);
// currently, G1 should only send SysEx to app
if (!msg.isSysEx())
return;
const uint8 *buf = msg.getSysExData();
int size = msg.getSysExDataSize();
if (!PGSysExParser::IsPGSysEx(buf, size))
return;
switch (PGSysExParser::GetOpMsb(buf, size))
{
case REPLY_GRP:
OwnerMidiDevice->MidiMessageBox.NotifyReply(msg);
break;
case ACK_GRP:
case NAK_GRP:
OwnerMidiDevice->MidiMessageBox.NotifyAck(msg);
break;
default:
break;
}
}
示例2: mb
void Gsp1101::handleIncomingMidiMessage(MidiInput *source, MidiMessage const& message)
{
MemoryBlock mb (message.getRawData(), message.getRawDataSize());
Logger::outputDebugString("\nMidiInput = " + asHex(mb));
juce::uint8 const* msgBuff = message.getSysExData();
if (!msgBuff)
{
lastMidiInput_M.setSize(0);
return;
}
lastMidiInput_M = MemoryBlock(message.getSysExData(), message.getSysExDataSize());
// A sysx ACK is:
// F0 00 00 10 XX XX XX 7E 00 (procedure) (checksum) F7
if (msgBuff[6] == 0x7e)
{}
// A sysx NACK is:
// F0 00 00 10 XX XX XX 7F 00 (procedure) (err code) (checksum) F7
else if (msgBuff[6] == 0x7f)
{
deviceReady_M = false;
// NACK error codes:
#define SYSX_INVALID_CHECKSUM 7
#define MERR_OVERRUN 10
#define MIDI_PROC_FAILED 12
switch (msgBuff[9])
{
case SYSX_INVALID_CHECKSUM:
case MERR_OVERRUN:
case MIDI_PROC_FAILED:
default:
break;
}
//Logger::outputDebugString("MidiInput error = " + String(msgBuff[9]));
}
else
{}
}