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
openmsx::DummyMidiInDevice
Definition: DummyMidiInDevice.hh:9
openmsx::MidiInConnector
Definition: MidiInConnector.hh:13
serialize.hh
openmsx::MidiInConnector::getClass
std::string_view getClass() const final
A Connector belong to a certain class.
Definition: MidiInConnector.cc:22
MidiInDevice.hh
openmsx::MidiInDevice
Definition: MidiInDevice.hh:9
MidiInConnector.hh
openmsx::MidiInConnector::MidiInConnector
MidiInConnector(PluggingController &pluggingController, std::string name)
Definition: MidiInConnector.cc:10
INSTANTIATE_SERIALIZE_METHODS
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:982
openmsx::MidiInConnector::getPluggedMidiInDev
MidiInDevice & getPluggedMidiInDev() const
Definition: MidiInConnector.cc:27
checked_cast.hh
openmsx::MidiInConnector::getDescription
std::string_view getDescription() const final
Get a description for this connector.
Definition: MidiInConnector.cc:17
openmsx::MidiInConnector::serialize
void serialize(Archive &ar, unsigned version)
Definition: MidiInConnector.cc:33
openmsx::Connector
Represents something you can plug devices into.
Definition: Connector.hh:21
DummyMidiInDevice.hh
openmsx::PluggingController
Central administration of Connectors and Pluggables.
Definition: PluggingController.hh:22
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Connector::getPlugged
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
Definition: Connector.hh:59