ft2_midi.h (1063B)
1 #pragma once 2 3 #ifdef HAS_MIDI 4 5 #include <stdint.h> 6 #include <stdbool.h> 7 #include <SDL2/SDL.h> 8 9 #define MIDI_INPUT_SELECTOR_BOX_WIDTH 247 10 #define MAX_MIDI_DEVICES 99 11 12 typedef struct midi_t 13 { 14 char *inputDeviceName, *inputDeviceNames[MAX_MIDI_DEVICES]; 15 volatile bool initThreadDone, callbackBusy, enable; 16 bool rescanDevicesFlag; 17 uint32_t inputDevice, numInputDevices; 18 int16_t currMIDIVibDepth, currMIDIPitch; 19 #ifdef __APPLE__ 20 SDL_Thread *initMidiThread; 21 #endif 22 } midi_t; 23 24 extern midi_t midi; // ft2_midi.c 25 26 void closeMidiInDevice(void); 27 void freeMidiIn(void); 28 bool initMidiIn(void); 29 bool openMidiInDevice(uint32_t deviceID); 30 void recordMIDIEffect(uint8_t efx, uint8_t efxData); 31 bool saveMidiInputDeviceToConfig(void); 32 bool setMidiInputDeviceFromConfig(void); 33 void freeMidiInputDeviceList(void); 34 void rescanMidiInputDevices(void); 35 void drawMidiInputList(void); 36 void scrollMidiInputDevListUp(void); 37 void scrollMidiInputDevListDown(void); 38 void sbMidiInputSetPos(uint32_t pos); 39 bool testMidiInputDeviceListMouseDown(void); 40 int32_t initMidiFunc(void *ptr); 41 42 #endif