aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidioutrtmidi.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-06-21 13:03:30 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-06-21 13:03:30 +0800
commit0c3fe540e925829022d9d8aa567c2dc2bd3d33d5 (patch)
treeab9ecae4def5a329b5e796839ece97f4b9c0297f /core/qmpmidioutrtmidi.hpp
parent64c91c7da66ba71e2bb32077680f234aba4ac65d (diff)
downloadQMidiPlayer-0c3fe540e925829022d9d8aa567c2dc2bd3d33d5.tar.xz
Complete rewrite of the MIDI mapper.
Enforces single fluidsynth instance. Documentation update. Minor changes to make lite version work.
Diffstat (limited to 'core/qmpmidioutrtmidi.hpp')
-rw-r--r--core/qmpmidioutrtmidi.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/core/qmpmidioutrtmidi.hpp b/core/qmpmidioutrtmidi.hpp
new file mode 100644
index 0000000..48ee0cf
--- /dev/null
+++ b/core/qmpmidioutrtmidi.hpp
@@ -0,0 +1,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