20#include "definitions_cxx.hpp"
21#include "io/midi/cable_types/usb_common.h"
22#include "io/midi/cable_types/usb_device_cable.h"
23#include "io/midi/root_complex/din.h"
24#include "io/midi/root_complex/usb_hosted.h"
25#include "util/container/vector/named_thing_vector.h"
32#include "definitions.h"
39#define MIDI_SEND_BUFFER_LEN_INNER 32
42#define MIDI_SEND_BUFFER_LEN_INNER_HOST 2
45#define MIDI_SEND_BUFFER_LEN_RING 1024
46#define MIDI_SEND_RING_MASK (MIDI_SEND_BUFFER_LEN_RING - 1)
66 MIDICableUSB* cable[4];
67 ConnectedUSBMIDIDevice();
68 void bufferMessage(uint32_t fullMessage);
72 bool consumeSendData();
73 bool hasBufferedSendData();
74 int sendBufferSpace();
80 uint8_t currentlyWaitingToReceive;
82 uint8_t canHaveMIDISent;
83 uint16_t numBytesReceived;
84 uint8_t receiveData[64];
87 uint8_t dataSendingNow[MIDI_SEND_BUFFER_LEN_INNER * 4];
90 uint8_t numBytesSendingNow;
96 uint32_t sendDataRingBuf[MIDI_SEND_BUFFER_LEN_RING];
97 uint32_t ringBufWriteIdx;
98 uint32_t ringBufReadIdx;
100 uint8_t maxPortConnected;
104namespace MIDIDeviceManager {
108void readDeviceReferenceFromFlash(GlobalMIDICommand whichCommand, uint8_t
const* memory);
109void writeDeviceReferenceToFlash(GlobalMIDICommand whichCommand, uint8_t* memory);
110void readMidiFollowDeviceReferenceFromFlash(MIDIFollowChannelType whichType, uint8_t
const* memory);
111void writeMidiFollowDeviceReferenceToFlash(MIDIFollowChannelType whichType, uint8_t* memory);
112void recountSmallestMPEZones();
113void writeDevicesToFile();
115void readDevicesFromFile();
122extern gsl::owner<MIDIRootComplex*> root_usb;
126extern bool differentiatingInputsByDevice;
128extern uint8_t lowestLastMemberChannelOfLowerZoneOnConnectedOutput;
129extern uint8_t highestLastMemberChannelOfUpperZoneOnConnectedOutput;
130extern bool anyChangesToSave;
135extern struct ConnectedUSBMIDIDevice connectedUSBMIDIDevices[][MAX_NUM_USB_MIDI_DEVICES];
Definition storage_manager.h:185
Definition usb_common.h:22
A MIDI cable connection. Stores all state specific to a given cable and its contained ports and chann...
Definition midi_device.h:94
Definition usb_hosted.h:25
Definition midi_root_complex.h:36
Definition storage_manager.h:119
Definition midi_device_manager.h:77