openMSX
MidiInConnector.cc
Go to the documentation of this file.
1 #include "MidiInConnector.hh"
2 #include "MidiInDevice.hh"
3 #include "DummyMidiInDevice.hh"
4 #include "checked_cast.hh"
5 #include "serialize.hh"
6 #include <memory>
7 
8 namespace openmsx {
9 
11  std::string name_)
12  : Connector(pluggingController_, std::move(name_),
13  std::make_unique<DummyMidiInDevice>())
14 {
15 }
16 
17 std::string_view MidiInConnector::getDescription() const
18 {
19  return "MIDI-in connector";
20 }
21 
22 std::string_view MidiInConnector::getClass() const
23 {
24  return "midi in";
25 }
26 
28 {
29  return *checked_cast<MidiInDevice*>(&getPlugged());
30 }
31 
32 template<typename Archive>
33 void MidiInConnector::serialize(Archive& ar, unsigned /*version*/)
34 {
35  ar.template serializeBase<Connector>(*this);
36 }
38 
39 } // namespace openmsx
Represents something you can plug devices into.
Definition: Connector.hh:20
std::string_view getClass() const final override
A Connector belong to a certain class.
STL namespace.
Central administration of Connectors and Pluggables.
MidiInDevice & getPluggedMidiInDev() const
MidiInConnector(PluggingController &pluggingController, std::string name)
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
std::string_view getDescription() const final override
Get a description for this connector.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:981
void serialize(Archive &ar, unsigned version)
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
Definition: Connector.hh:59