aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidioutfluid.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-06-16 20:12:14 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-06-16 20:12:14 +0800
commit795043d6851a355d70aa2341e2edfd526c24d041 (patch)
tree203991e9a062934254bc9c6ca2053bdf4c096773 /core/qmpmidioutfluid.hpp
parent7b03fd544837fbe0bc5a5373b60dfd5de50892e1 (diff)
downloadQMidiPlayer-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/qmpmidioutfluid.hpp')
-rw-r--r--core/qmpmidioutfluid.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/qmpmidioutfluid.hpp b/core/qmpmidioutfluid.hpp
index 963f9df..72197e7 100644
--- a/core/qmpmidioutfluid.hpp
+++ b/core/qmpmidioutfluid.hpp
@@ -3,6 +3,7 @@
#include <string>
#include <utility>
#include <vector>
+#include <unordered_map>
#include "../include/qmpcorepublic.hpp"
#include <fluidsynth.h>
class IFluidSettings
@@ -22,6 +23,9 @@ class qmpMidiOutFluid:public qmpMidiOutDevice,public IFluidSettings
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
+ std::vector<std::pair<uint16_t,std::string>> bnk;
+ std::unordered_map<uint16_t,std::vector<std::string>> pst;
+ void update_preset_list();
public:
qmpMidiOutFluid();
~qmpMidiOutFluid();
@@ -36,13 +40,17 @@ class qmpMidiOutFluid:public qmpMidiOutDevice,public IFluidSettings
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);
//FluidSynth specific stuff
void setOptStr(const char* opt,const char* val);
void setOptInt(const char* opt,int val);
void setOptNum(const char* opt,double val);
void loadSFont(const char* path);
int getSFCount();
- std::vector<std::pair<std::pair<int,int>,std::string>> listPresets();
int getPolyphone();
int getMaxPolyphone();