aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidioutrtmidi.hpp
blob: 48ee0cf2630ef8698c19369c6c5b20b11c7c6495 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef QMPMIDIMAPPERS_H
#define QMPMIDIMAPPERS_H
#include <vector>
#define QMP_MAIN
#include "../include/qmpcorepublic.hpp"
#include RT_MIDI_H
class qmpMidiOutRtMidi:public qmpMidiOutDevice
{
private:
	unsigned portid;
	RtMidiOut* outport;
public:
	qmpMidiOutRtMidi(unsigned _portid);
	~qmpMidiOutRtMidi();
	void deviceInit();
	void deviceDeinit();
	void basicMessage(uint8_t type,uint8_t p1,uint8_t p2);
	void extendedMessage(uint8_t length,const char *data);
	void rpnMessage(uint8_t ch,uint16_t type,uint16_t val);
	void nrpnMessage(uint8_t ch,uint16_t type,uint16_t val);
	void panic(uint8_t ch);
	void reset(uint8_t ch);
	void onMapped(uint8_t ch,int refcnt);
	void onUnmapped(uint8_t ch,int refcnt);
};
class qmpRtMidiManager
{
	private:
		static RtMidiOut* dummy;
		std::vector<std::pair<qmpMidiOutRtMidi*,std::string>> devices;
	public:
		void createDevices();
		void deleteDevices();
		std::vector<std::pair<qmpMidiOutRtMidi*,std::string>> getDevices();
};
#endif // QMPMIDIMAPPERS_H