MCPcopy Create free account
hub / github.com/VCVRack/Rack / sendMessage

Method sendMessage

src/midi.cpp:443–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443void Output::sendMessage(const Message& message) {
444 if (!outputDevice)
445 return;
446
447 // Set channel if message is not a system MIDI message
448 Message msg = message;
449 if (msg.getStatus() != 0xf && channel >= 0) {
450 msg.setChannel(channel);
451 }
452 // DEBUG("sendMessage %02x %02x %02x", msg.cmd, msg.data1, msg.data2);
453 try {
454 outputDevice->sendMessage(msg);
455 }
456 catch (Exception& e) {
457 // Don't log error because it could flood the log.
458 // WARN("MIDI port could not be sent MIDI message: %s", e.what());
459 // TODO Perhaps `setDevice(-1)` if sending message fails?
460 }
461}
462
463
464////////////////////

Callers

nothing calls this directly

Calls 2

getStatusMethod · 0.80
setChannelMethod · 0.45

Tested by

no test coverage detected