openMSX
MidiOutLogger.hh
Go to the documentation of this file.
1 #ifndef MIDIOUTLOGGER_HH
2 #define MIDIOUTLOGGER_HH
3 
4 #include "MidiOutDevice.hh"
5 #include "FilenameSetting.hh"
6 #include <fstream>
7 
8 namespace openmsx {
9 
10 class CommandController;
11 
12 class MidiOutLogger final : public MidiOutDevice
13 {
14 public:
15  explicit MidiOutLogger(CommandController& commandController);
16 
17  // Pluggable
18  void plugHelper(Connector& connector, EmuTime::param time) override;
19  void unplugHelper(EmuTime::param time) override;
20  const std::string& getName() const override;
21  std::string_view getDescription() const override;
22 
23  // SerialDataInterface (part)
24  void recvByte(byte value, EmuTime::param time) override;
25 
26  template<typename Archive>
27  void serialize(Archive& ar, unsigned version);
28 
29 private:
30  FilenameSetting logFilenameSetting;
31  std::ofstream file;
32 };
33 
34 } // namespace openmsx
35 
36 #endif
openmsx::CommandController
Definition: CommandController.hh:17
openmsx::FilenameSetting
Definition: FilenameSetting.hh:8
openmsx::MidiOutDevice
Pluggable that connects an MSX MIDI out port to a host MIDI device.
Definition: MidiOutDevice.hh:15
openmsx::MidiOutLogger::unplugHelper
void unplugHelper(EmuTime::param time) override
Definition: MidiOutLogger.cc:26
openmsx::MidiOutLogger::getName
const std::string & getName() const override
Name used to identify this pluggable.
Definition: MidiOutLogger.cc:31
openmsx::MidiOutLogger::MidiOutLogger
MidiOutLogger(CommandController &commandController)
Definition: MidiOutLogger.cc:8
openmsx::MidiOutLogger::serialize
void serialize(Archive &ar, unsigned version)
Definition: MidiOutLogger.cc:53
openmsx::MidiOutLogger::plugHelper
void plugHelper(Connector &connector, EmuTime::param time) override
Definition: MidiOutLogger.cc:16
FilenameSetting.hh
openmsx::MidiOutLogger::getDescription
std::string_view getDescription() const override
Description for this pluggable.
Definition: MidiOutLogger.cc:37
openmsx::MidiOutLogger::recvByte
void recvByte(byte value, EmuTime::param time) override
Definition: MidiOutLogger.cc:44
openmsx::Connector
Represents something you can plug devices into.
Definition: Connector.hh:20
openmsx::MidiOutLogger
Definition: MidiOutLogger.hh:12
MidiOutDevice.hh
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5