| 1 |
#ifndef MIDIOUTDEVICE_HH |
| 2 |
#define MIDIOUTDEVICE_HH |
| 3 |
|
| 4 |
#include "Pluggable.hh" |
| 5 |
#include "SerialDataInterface.hh" |
| 6 |
#include <vector> |
| 7 |
|
| 8 |
|
| 9 |
namespace openmsx { |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
class MidiOutDevice : public Pluggable, public SerialDataInterface |
| 16 |
{ |
| 17 |
public: |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
static constexpr size_t MAX_MESSAGE_SIZE = 256; |
| 22 |
|
| 23 |
|
| 24 |
[[nodiscard]] zstring_view getClass() const final; |
| 25 |
|
| 26 |
|
| 27 |
void recvByte(uint8_t value, EmuTime time) override; |
| 28 |
void setDataBits(DataBits bits) override; |
| 29 |
void setStopBits(StopBits bits) override; |
| 30 |
void setParityBit(bool enable, Parity parity) override; |
| 31 |
|
| 32 |
protected: |
| 33 |
explicit MidiOutDevice() = default; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
void clearBuffer(); |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
virtual void recvMessage( |
| 44 |
const std::vector<uint8_t>& message, EmuTime time); |
| 45 |
|
| 46 |
private: |
| 47 |
std::vector<uint8_t> buffer; |
| 48 |
bool isSysEx = false; |
| 49 |
}; |
| 50 |
|
| 51 |
} |
| 52 |
|
| 53 |
#endif |