diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-06-16 20:12:14 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-06-16 20:12:14 +0800 |
commit | 795043d6851a355d70aa2341e2edfd526c24d041 (patch) | |
tree | 203991e9a062934254bc9c6ca2053bdf4c096773 /core/qmpmidioutrtmidi.hpp | |
parent | 7b03fd544837fbe0bc5a5373b60dfd5de50892e1 (diff) | |
download | QMidiPlayer-795043d6851a355d70aa2341e2edfd526c24d041.tar.xz |
Inital implementation of the device properties API.
Added new interfaces to qmpMidiOutDevice.
Implemented the new interfaces for qmpMidiOutFluid.
Initial infra for device initialization file parsing.
Move to the new interfaces for getting list of presets.
Use DevIL instead of CxImage.
External output devices are broken now but that is for
another commit.
Diffstat (limited to 'core/qmpmidioutrtmidi.hpp')
-rw-r--r-- | core/qmpmidioutrtmidi.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/qmpmidioutrtmidi.hpp b/core/qmpmidioutrtmidi.hpp index 48ee0cf..23adec6 100644 --- a/core/qmpmidioutrtmidi.hpp +++ b/core/qmpmidioutrtmidi.hpp @@ -1,9 +1,23 @@ #ifndef QMPMIDIMAPPERS_H #define QMPMIDIMAPPERS_H +#include <unordered_map> #include <vector> #define QMP_MAIN #include "../include/qmpcorepublic.hpp" #include RT_MIDI_H +struct qmpDeviceInitializer +{ + CMidiTrack initseq; + struct BankStore + { + std::unordered_map<uint8_t,std::string> presets; + std::string bankname; + }; + std::unordered_map<uint16_t,BankStore> banks; + uint8_t initv[130]; + + static qmpDeviceInitializer* parse(const char* path); +}; class qmpMidiOutRtMidi:public qmpMidiOutDevice { private: @@ -22,6 +36,11 @@ public: void reset(uint8_t ch); void onMapped(uint8_t ch,int refcnt); void onUnmapped(uint8_t ch,int refcnt); + std::vector<std::pair<uint16_t,std::string>> getBankList(); + std::vector<std::pair<uint8_t,std::string>> getPresets(int bank); + std::string getPresetName(uint16_t bank,uint8_t preset); + bool getChannelPreset(int ch,uint16_t *bank,uint8_t *preset,std::string &presetname); + uint8_t getInitialCCValue(uint8_t cc); }; class qmpRtMidiManager { |