openMSX
MidiInConnector.cc
Go to the documentation of this file.
1#include "MidiInConnector.hh"
2#include "MidiInDevice.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<DummyMidiInDevice>())
14 , description(std::move(name_))
15{
16}
17
18std::string_view MidiInConnector::getDescription() const
19{
20 return description;
21}
22
23std::string_view MidiInConnector::getClass() const
24{
25 return "midi in";
26}
27
29{
30 return *checked_cast<MidiInDevice*>(&getPlugged());
31}
32
33template<typename Archive>
34void MidiInConnector::serialize(Archive& ar, unsigned /*version*/)
35{
36 ar.template serializeBase<Connector>(*this);
37}
39
40} // 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
std::string_view getClass() const final
A Connector belong to a certain class.
MidiInDevice & getPluggedMidiInDev() const
std::string_view getDescription() const final
Get a description for this connector.
MidiInConnector(PluggingController &pluggingController, std::string name)
void serialize(Archive &ar, unsigned version)
Central administration of Connectors and Pluggables.
This file implemented 3 utility functions:
Definition Autofire.cc:11
STL namespace.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)