openMSX
MidiOutDevice.hh
Go to the documentation of this file.
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 
16 {
17 public:
21  static constexpr size_t MAX_MESSAGE_SIZE = 256;
22 
23  // Pluggable (part)
24  string_ref getClass() const final override;
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, ParityBit parity) override;
31 
32 protected:
33  explicit MidiOutDevice();
34 
37  void clearBuffer();
38 
43  virtual void recvMessage(
44  const std::vector<uint8_t>& message, EmuTime::param time);
45 
46 private:
47  std::vector<uint8_t> buffer;
48  bool isSysEx;
49 };
50 
51 } // namespace openmsx
52 
53 #endif
void setParityBit(bool enable, ParityBit parity) override
static constexpr size_t MAX_MESSAGE_SIZE
The limit for the amount of data we&#39;ll put into one MIDI message.
string_ref getClass() const finaloverride
A pluggable belongs to a certain class.
void setStopBits(StopBits bits) override
STL namespace.
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
Pluggable that connects an MSX MIDI out port to a host MIDI device.
virtual void recvMessage(const std::vector< uint8_t > &message, EmuTime::param time)
Called when a full MIDI message is ready to be sent.
void setDataBits(DataBits bits) override
void recvByte(byte value, EmuTime::param time) override
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:25
void clearBuffer()
Discard any buffered partial MIDI message.