openMSX
MidiOutConnector.cc
Go to the documentation of this file.
1#include "MidiOutConnector.hh"
2#include "MidiOutDevice.hh"
4#include "checked_cast.hh"
5#include "serialize.hh"
6#include <memory>
7
8namespace openmsx {
9
11 std::string name_)
12 : Connector(pluggingController_, std::move(name_),
13 std::make_unique<DummyMidiOutDevice>())
14{
15}
16
17std::string_view MidiOutConnector::getDescription() const
18{
19 return "MIDI-out connector";
20}
21
22std::string_view MidiOutConnector::getClass() const
23{
24 return "midi out";
25}
26
28{
29 return *checked_cast<MidiOutDevice*>(&getPlugged());
30}
31
33{
35}
36
38{
40}
41
43{
44 getPluggedMidiOutDev().setParityBit(enable, parity);
45}
46
47void MidiOutConnector::recvByte(byte value, EmuTime::param time)
48{
49 getPluggedMidiOutDev().recvByte(value, time);
50}
51
52template<typename Archive>
53void MidiOutConnector::serialize(Archive& ar, unsigned /*version*/)
54{
55 ar.template serializeBase<Connector>(*this);
56}
58
59} // namespace openmsx
Represents something you can plug devices into.
Definition: Connector.hh:21
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
Definition: Connector.hh:59
void serialize(Archive &ar, unsigned version)
void setStopBits(StopBits bits) override
void setDataBits(DataBits bits) override
std::string_view getClass() const final
A Connector belong to a certain class.
MidiOutDevice & getPluggedMidiOutDev() const
std::string_view getDescription() const final
Get a description for this connector.
void recvByte(byte value, EmuTime::param time) override
void setParityBit(bool enable, ParityBit parity) override
MidiOutConnector(PluggingController &pluggingController, std::string name)
Pluggable that connects an MSX MIDI out port to a host MIDI device.
void setStopBits(StopBits bits) override
void setParityBit(bool enable, ParityBit parity) override
void setDataBits(DataBits bits) override
void recvByte(byte value, EmuTime::param time) override
Central administration of Connectors and Pluggables.
This file implemented 3 utility functions:
Definition: Autofire.cc:9
STL namespace.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:1009