OXYGENHUB
◆ main openmsx / src / serial / MidiSessionALSA.hh
1018 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef MIDISESSIONALSA_HH
2
#define MIDISESSIONALSA_HH
3
4
#include <alsa/asoundlib.h>
5
#include <memory>
6
7
8
namespace openmsx {
9
10
class CliComm;
11
class EventDistributor;
12
class Scheduler;
13
class PluggingController;
14
15
16
/** Lists ALSA MIDI ports we can connect to.
17
  */
18
class MidiSessionALSA final
19
{
20
public:
21
	static void registerAll(PluggingController& controller, CliComm& cliComm,
22
	                        EventDistributor& eventDistributor, Scheduler& scheduler);
23
24
	MidiSessionALSA(const MidiSessionALSA&) = delete;
25
	MidiSessionALSA(MidiSessionALSA&&) = delete;
26
	MidiSessionALSA& operator=(const MidiSessionALSA&) = delete;
27
	MidiSessionALSA& operator=(MidiSessionALSA&&) = delete;
28
	~MidiSessionALSA();
29
30
private:
31
	static std::unique_ptr<MidiSessionALSA> instance;
32
33
	explicit MidiSessionALSA(snd_seq_t& seq);
34
	void scanClients(PluggingController& controller,
35
	                 EventDistributor& eventDistributor,
36
	                 Scheduler& scheduler);
37
38
	snd_seq_t& seq;
39
};
40
41
} // namespace openmsx
42
43
#endif // MIDISESSIONALSA_HH