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  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
void recvByte(byte value, EmuTime::param time) override
Represents something you can plug devices into.
Definition: Connector.hh:20
void serialize(Archive &ar, unsigned version)
MidiOutLogger(CommandController &commandController)
Definition: MidiOutLogger.cc:8
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
Pluggable that connects an MSX MIDI out port to a host MIDI device.
void plugHelper(Connector &connector, EmuTime::param time) override
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
string_view getDescription() const override
Description for this pluggable.
const std::string & getName() const override
Name used to identify this pluggable.
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
void unplugHelper(EmuTime::param time) override