16template <
class Backend>
22 template <
class...
Args>
39 const char *
getName()
const override {
return "usb"; }
128#include "USBMIDI_Interface.ipp"
130#if defined(TEENSYDUINO) && !defined(TEENSY_MIDIUSB_ENABLED)
132 "Teensy: USB MIDI not enabled. Enable it from the Tools > USB Type menu.")
133#define CS_USB_MIDI_DISABLED
137#if (!defined(CS_USB_MIDI_NOT_SUPPORTED) && !defined(CS_USB_MIDI_DISABLED)) || \
170#elif !defined(CS_USB_MIDI_DISABLED)
MIDIReadEvent
Values returned by the MIDI reading functions.
MIDICodeIndexNumber
MIDI USB Code Index Numbers.
#define BEGIN_CS_NAMESPACE
A type-safe class for MIDI USB Cable numbers.
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
ChannelMessage getChannelMessage() const
Return the received channel voice message.
RealTimeMessage getRealTimeMessage() const
Return the received real-time message.
void sendChannelMessageImpl(ChannelMessage) override
Low-level function for sending a MIDI channel voice message.
void alwaysSendImmediately()
Send the USB packets immediately after sending a MIDI message.
void handleStall() override
Call back that should finish any MIDI messages that are in progress, and un-stall the pipe or MIDI so...
void update() override
Poll the backend (if necessary) and invoke the callbacks for any received MIDI messages,...
void neverSendImmediately()
Don't send the USB packets immediately after sending a MIDI message.
USBMIDI_Sender sender
Sends USB MIDI messages.
void sendNowImpl() override
Low-level function for sending any buffered outgoing MIDI messages.
SysCommonMessage getSysCommonMessage() const
Return the received system common message.
void sendRealTimeImpl(RealTimeMessage) override
Low-level function for sending a MIDI real-time message.
USBMIDI_Parser parser
Parses USB packets into MIDI messages.
const char * getName() const override
Get the staller's name for debugging purposes.
Backend backend
The (platform-specific) backend used for MIDI over USB communication.
void begin() override
Initialize.
void sendSysExImpl(SysExMessage) override
Low-level function for sending a system exclusive MIDI message.
bool alwaysSendImmediately_
void sendSysCommonImpl(SysCommonMessage) override
Low-level function for sending a MIDI system common message.
bool alwaysSendsImmediately() const
Check if this USB interface always sends its USB packets immediately after sending a MIDI message.
GenericUSBMIDI_Interface(Args &&...args)
Construct a new GenericUSBMIDI_Interface.
MIDIReadEvent read()
Try reading and parsing a single incoming MIDI message.
SysExMessage getSysExMessage() const
Return the received system exclusive message.
An abstract class for MIDI interfaces.
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
USBMIDI_Interface()=default
Parser for MIDI over USB packets.
A class for sending MIDI USB messages.
A class for MIDI interfaces sending and receiving MIDI messages over the Serial port of the USB conne...
An array wrapper for easy copying, comparing, and iterating.
Functor to send USB MIDI packets.
void operator()(Cable cn, MIDICodeIndexNumber cin, uint8_t d0, uint8_t d1, uint8_t d2)
GenericUSBMIDI_Interface * iface
virtual void handleStall()=0
Call back that should finish any MIDI messages that are in progress, and un-stall the pipe or MIDI so...
AH::Array< uint8_t, 4 > MIDIUSBPacket_t