aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidioutfluid.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-05-12 00:58:40 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-05-12 00:58:40 +0800
commita7407edaf81c685d4a389785a405a53a5de4b148 (patch)
treee6e4f2d85f2172c94ac83a6e8f01e1e90a78ede9 /core/qmpmidioutfluid.hpp
parent437b7b16c322a8e53ac55a5f831098494d9a7073 (diff)
downloadQMidiPlayer-a7407edaf81c685d4a389785a405a53a5de4b148.tar.xz
Format EVERYTHING.
Hopefully this will make the source code less horrendous and actually readable. The command used was: ``` astyle --suffix=none --style=allman --attach-extern-c --attach-closing-while --indent-switches --indent-after-parens --pad-oper --pad-header --unpad-paren --align-pointer=name --recursive './*.cpp,*.hpp' ```
Diffstat (limited to 'core/qmpmidioutfluid.hpp')
-rw-r--r--core/qmpmidioutfluid.hpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/core/qmpmidioutfluid.hpp b/core/qmpmidioutfluid.hpp
index 63963ee..acefb68 100644
--- a/core/qmpmidioutfluid.hpp
+++ b/core/qmpmidioutfluid.hpp
@@ -8,85 +8,85 @@
#include <fluidsynth.h>
class IFluidSettings
{
- public:
- virtual void setOptStr(const char* opt,const char* val)=0;
- virtual void setOptInt(const char* opt,int val)=0;
- virtual void setOptNum(const char* opt,double val)=0;
- virtual void loadSFont(const char* path)=0;
- virtual void setGain(double gain)=0;
- virtual void setReverbPara(int e,double r,double d,double w,double l)=0;
- virtual void setChorusPara(int e,int fb,double l,double r,double d,int type)=0;
+public:
+ virtual void setOptStr(const char *opt, const char *val) = 0;
+ virtual void setOptInt(const char *opt, int val) = 0;
+ virtual void setOptNum(const char *opt, double val) = 0;
+ virtual void loadSFont(const char *path) = 0;
+ virtual void setGain(double gain) = 0;
+ virtual void setReverbPara(int e, double r, double d, double w, double l) = 0;
+ virtual void setChorusPara(int e, int fb, double l, double r, double d, int type) = 0;
};
-class qmpMidiOutFluid:public qmpMidiOutDevice,public IFluidSettings
+class qmpMidiOutFluid: public qmpMidiOutDevice, public IFluidSettings
{
- private:
- 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;
- qmpPluginAPI* coreapi;
- std::vector<std::string> drivers;
- int default_driver=-1;
- void update_preset_list();
- public:
- qmpMidiOutFluid();
- ~qmpMidiOutFluid();
- void registerOptions(qmpPluginAPI *coreapi);
- void deviceInit();
- void deviceDeinit();
- void deviceDeinit(bool freshsettings);
- void basicMessage(uint8_t type,uint8_t p1,uint8_t p2);
- void extendedMessage(uint32_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);
- std::vector<std::pair<uint16_t,std::string>> getBankList();
- std::vector<std::pair<uint8_t,std::string>> getPresets(uint16_t 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,uint8_t ch);
- //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();
+private:
+ 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;
+ qmpPluginAPI *coreapi;
+ std::vector<std::string> drivers;
+ int default_driver = -1;
+ void update_preset_list();
+public:
+ qmpMidiOutFluid();
+ ~qmpMidiOutFluid();
+ void registerOptions(qmpPluginAPI *coreapi);
+ void deviceInit();
+ void deviceDeinit();
+ void deviceDeinit(bool freshsettings);
+ void basicMessage(uint8_t type, uint8_t p1, uint8_t p2);
+ void extendedMessage(uint32_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);
+ std::vector<std::pair<uint16_t, std::string>> getBankList();
+ std::vector<std::pair<uint8_t, std::string>> getPresets(uint16_t 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, uint8_t ch);
+ //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();
- int getPolyphone();
- int getMaxPolyphone();
- void setGain(double gain);
- void getChannelInfo(int ch,int *b,int *p,char *s);
- void getReverbPara(double *r,double *d,double *w,double *l);
- void setReverbPara(int e,double r,double d,double w,double l);
- void getChorusPara(int *fb,double *l,double *r,double *d,int *type);
- void setChorusPara(int e,int fb,double l,double r,double d,int type);
+ int getPolyphone();
+ int getMaxPolyphone();
+ void setGain(double gain);
+ void getChannelInfo(int ch, int *b, int *p, char *s);
+ void getReverbPara(double *r, double *d, double *w, double *l);
+ void setReverbPara(int e, double r, double d, double w, double l);
+ void getChorusPara(int *fb, double *l, double *r, double *d, int *type);
+ void setChorusPara(int e, int fb, double l, double r, double d, int type);
};
-class qmpFileRendererFluid:public IFluidSettings
+class qmpFileRendererFluid: public IFluidSettings
{
- private:
- fluid_settings_t* settings;
- fluid_synth_t* synth;
- fluid_player_t* player;
- bool finished;
- std::string fn;
- public:
- qmpFileRendererFluid(const char* _fn,const char* _ofn);
- ~qmpFileRendererFluid();
- void renderInit();
- void renderDeinit();
- void renderWorker();
- 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);
- bool isFinished();
- void setGain(double gain);
- void setReverbPara(int e,double r,double d,double w,double l);
- void setChorusPara(int e,int fb,double l,double r,double d,int type);
+private:
+ fluid_settings_t *settings;
+ fluid_synth_t *synth;
+ fluid_player_t *player;
+ bool finished;
+ std::string fn;
+public:
+ qmpFileRendererFluid(const char *_fn, const char *_ofn);
+ ~qmpFileRendererFluid();
+ void renderInit();
+ void renderDeinit();
+ void renderWorker();
+ 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);
+ bool isFinished();
+ void setGain(double gain);
+ void setReverbPara(int e, double r, double d, double w, double l);
+ void setChorusPara(int e, int fb, double l, double r, double d, int type);
};
#endif // QMPMIDIOUTFLUID_H