aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/qmpmidioutfluid.cpp39
-rw-r--r--core/qmpmidioutfluid.hpp4
-rw-r--r--core/qmpmidiplay.hpp1
3 files changed, 44 insertions, 0 deletions
diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp
index 87c1207..649cb1c 100644
--- a/core/qmpmidioutfluid.cpp
+++ b/core/qmpmidioutfluid.cpp
@@ -12,6 +12,45 @@ qmpMidiOutFluid::~qmpMidiOutFluid()
delete_fluid_settings(settings);
settings=nullptr;
}
+
+void qmpMidiOutFluid::registerOptions(qmpPluginAPI *coreapi)
+{
+ default_driver=-1;
+ fluid_settings_t *fsettings=new_fluid_settings();
+ auto insert_driver=[](void* d,const char*,const char* driver)->void{
+ qmpMidiOutFluid *me=static_cast<qmpMidiOutFluid*>(d);
+ me->drivers.push_back(std::string(driver));
+#ifdef WIN32
+ if(std::string(driver)=="waveout")
+#else
+ if(std::string(driver)=="pulseaudio")
+ me->default_driver=static_cast<int>(me->drivers.size()-1);
+#endif
+ };
+ fluid_settings_foreach_option(fsettings,"audio.driver",this,insert_driver);
+ delete_fluid_settings(fsettings);
+ coreapi->registerOptionEnumInt("Audio","Audio Driver","FluidSynth/AudioDriver",drivers,default_driver);
+ coreapi->registerOptionInt("Audio","Audio Buffer Size","FluidSynth/BufSize",64,8192,
+#ifdef WIN32
+ 512
+#else
+ 64
+#endif
+ );
+ coreapi->registerOptionInt("Audio","Audio Buffer Count","FluidSynth/BufCnt",2,64,
+#ifdef WIN32
+ 8
+#else
+ 16
+#endif
+ );
+ coreapi->registerOptionEnumInt("Audio","Sample Format","FluidSynth/SampleFormat",{"16bits","float"},0);
+ coreapi->registerOptionInt("Audio","Sample Rate","FluidSynth/SampleRate",8000,96000,48000);
+ coreapi->registerOptionInt("Audio","Max Polyphony","FluidSynth/Polyphony",1,65535,256);
+ coreapi->registerOptionInt("Audio","CPU Cores","FluidSynth/Threads",1,256,1);
+ coreapi->registerOptionBool("Audio","Auto Bank Select Mode","FluidSynth/AutoBS",true);
+ coreapi->registerOptionEnumInt("Audio","Bank Select Mode","FluidSynth/BankSelect",{"GM","GS","XG","MMA"},1);
+}
void qmpMidiOutFluid::deviceInit()
{
synth=new_fluid_synth(settings);
diff --git a/core/qmpmidioutfluid.hpp b/core/qmpmidioutfluid.hpp
index 9c84264..63963ee 100644
--- a/core/qmpmidioutfluid.hpp
+++ b/core/qmpmidioutfluid.hpp
@@ -25,10 +25,14 @@ class qmpMidiOutFluid:public qmpMidiOutDevice,public IFluidSettings
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);
diff --git a/core/qmpmidiplay.hpp b/core/qmpmidiplay.hpp
index 2fd81a0..f896338 100644
--- a/core/qmpmidiplay.hpp
+++ b/core/qmpmidiplay.hpp
@@ -125,6 +125,7 @@ class CMidiPlayer
uint32_t isFinished();
void setResumed();
void setWaitVoice(bool wv);
+ void registerFluidOptions(qmpPluginAPI *coreapi);
double getFtime();
void getCurrentTimeSignature(int *n,int *d);