OXYGENHUB
◆ main openmsx / src / serial / MidiOutLogger.hh
802 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef MIDIOUTLOGGER_HH
2
#define MIDIOUTLOGGER_HH
3
4
#include "MidiOutDevice.hh"
5
6
#include "FilenameSetting.hh"
7
8
#include <fstream>
9
10
namespace openmsx {
11
12
class CommandController;
13
14
class MidiOutLogger final : public MidiOutDevice
15
{
16
public:
17
	explicit MidiOutLogger(CommandController& commandController);
18
19
	// Pluggable
20
	void plugHelper(Connector& connector, EmuTime time) override;
21
	void unplugHelper(EmuTime time) override;
22
	[[nodiscard]] zstring_view getName() const override;
23
	[[nodiscard]] zstring_view getDescription() const override;
24
25
	// SerialDataInterface (part)
26
	void recvByte(uint8_t value, EmuTime time) override;
27
28
	template<typename Archive>
29
	void serialize(Archive& ar, unsigned version);
30
31
private:
32
	FilenameSetting logFilenameSetting;
33
	std::ofstream file;
34
};
35
36
} // namespace openmsx
37
38
#endif