openMSX
MidiOutDevice.hh
Go to the documentation of this file.
1#ifndef MIDIOUTDEVICE_HH
2#define MIDIOUTDEVICE_HH
3
4#include "Pluggable.hh"
6#include <vector>
7
8
9namespace openmsx {
10
16{
17public:
21 static constexpr size_t MAX_MESSAGE_SIZE = 256;
22
23 // Pluggable (part)
24 [[nodiscard]] std::string_view getClass() const final;
25
26 // SerialDataInterface (part)
27 void recvByte(byte value, EmuTime::param time) override;
28 void setDataBits(DataBits bits) override;
29 void setStopBits(StopBits bits) override;
30 void setParityBit(bool enable, Parity parity) override;
31
32protected:
33 explicit MidiOutDevice() = default;
34
37 void clearBuffer();
38
43 virtual void recvMessage(
44 const std::vector<uint8_t>& message, EmuTime::param time);
45
46private:
47 std::vector<uint8_t> buffer;
48 bool isSysEx = false;
49};
50
51} // namespace openmsx
52
53#endif
Pluggable that connects an MSX MIDI out port to a host MIDI device.
void clearBuffer()
Discard any buffered partial MIDI message.
virtual void recvMessage(const std::vector< uint8_t > &message, EmuTime::param time)
Called when a full MIDI message is ready to be sent.
static constexpr size_t MAX_MESSAGE_SIZE
The limit for the amount of data we'll put into one MIDI message.
void setParityBit(bool enable, Parity parity) override
void setStopBits(StopBits bits) override
std::string_view getClass() const final
A pluggable belongs to a certain class.
void setDataBits(DataBits bits) override
void recvByte(byte value, EmuTime::param time) override
This file implemented 3 utility functions:
Definition Autofire.cc:11
STL namespace.