2026-11-14 10:23:02 +06:00
|
|
|
#ifndef MIDIINPUT
|
|
|
|
|
#define MIDIINPUT
|
|
|
|
|
|
|
|
|
|
#include <rtmidi/RtMidi.h>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <stdexcept>
|
2026-11-14 13:01:54 +06:00
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
#include "../include/synth.hpp"
|
2026-11-14 10:23:02 +06:00
|
|
|
|
|
|
|
|
class MidiInput{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2026-11-14 13:01:54 +06:00
|
|
|
MidiInput(Synth& synth) : synth_(synth){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-14 10:23:02 +06:00
|
|
|
void list_ports();
|
|
|
|
|
void open_port(unsigned int port);
|
|
|
|
|
void read_message();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
RtMidiIn midiIn;
|
2026-11-14 13:01:54 +06:00
|
|
|
Synth& synth_;
|
2026-11-14 10:23:02 +06:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|