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_, name_,
13 std::make_unique<DummyMidiOutDevice>())
14 , description(std::move(name_))
15{
16}
17
18std::string_view MidiOutConnector::getDescription() const
19{
20 return description;
21}
22
23std::string_view MidiOutConnector::getClass() const
24{
25 return "midi out";
26}
27
29{
30 return *checked_cast<MidiOutDevice*>(&getPlugged());
31}
32
37
42
43void MidiOutConnector::setParityBit(bool enable, Parity parity)
44{
45 getPluggedMidiOutDev().setParityBit(enable, parity);
46}
47
48void MidiOutConnector::recvByte(byte value, EmuTime::param time)
49{
50 getPluggedMidiOutDev().recvByte(value, time);
51}
52
53template<typename Archive>
54void MidiOutConnector::serialize(Archive& ar, unsigned /*version*/)
55{
56 ar.template serializeBase<Connector>(*this);
57}
59
60} // 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:61
void serialize(Archive &ar, unsigned version)
void setStopBits(StopBits bits) override
void setDataBits(DataBits bits) override
void setParityBit(bool enable, Parity parity) override
std::string_view getClass() const override
A Connector belong to a certain class.
std::string_view getDescription() const override
Get a description for this connector.
MidiOutDevice & getPluggedMidiOutDev() const
void recvByte(byte value, EmuTime::param time) override
MidiOutConnector(PluggingController &pluggingController, std::string name)
Pluggable that connects an MSX MIDI out port to a host MIDI device.
void setParityBit(bool enable, Parity parity) override
void setStopBits(StopBits bits) 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:11
STL namespace.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)