diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-05-25 22:40:15 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-05-25 22:40:15 +0800 |
commit | 3f72121ac41741d53e4916f1275cbd4f93259c4d (patch) | |
tree | 15bba079c86de0e241812cd657ad190eb0c2c41a /core/qmpmidioutfluid.cpp | |
parent | eba45fdf11a98113b439db0510b55f14845db8fb (diff) | |
download | QMidiPlayer-3f72121ac41741d53e4916f1275cbd4f93259c4d.tar.xz |
Massive code refactor en cours!
Less complain from compilers:
- use nullptr instead of NULL
- use types for event fields
- explicit type casting added
Stop saving parameters of meta events in p1/p2 fields of SEvent.
callback_t now uses std::function, deprecating ICallback.
Not recommended for daily usage, or even testing: the code refactor
is still a work in progress.
Diffstat (limited to 'core/qmpmidioutfluid.cpp')
-rw-r--r-- | core/qmpmidioutfluid.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp index ab0ab9d..bb8f290 100644 --- a/core/qmpmidioutfluid.cpp +++ b/core/qmpmidioutfluid.cpp @@ -5,27 +5,27 @@ qmpMidiOutFluid::qmpMidiOutFluid() { settings=new_fluid_settings(); - synth=NULL;adriver=NULL; + synth=nullptr;adriver=nullptr; } qmpMidiOutFluid::~qmpMidiOutFluid() { delete_fluid_settings(settings); - settings=NULL; + settings=nullptr; } void qmpMidiOutFluid::deviceInit() { synth=new_fluid_synth(settings); if(!synth){fputs("Error creating fluidsynth instance!",stderr);return;} - fluid_set_log_function(FLUID_DBG,NULL,NULL); - fluid_set_log_function(FLUID_INFO,NULL,NULL); - fluid_set_log_function(FLUID_WARN,NULL,NULL); - fluid_set_log_function(FLUID_ERR,fluid_default_log_function,NULL); - fluid_set_log_function(FLUID_PANIC,fluid_default_log_function,NULL); + fluid_set_log_function(FLUID_DBG,nullptr,nullptr); + fluid_set_log_function(FLUID_INFO,nullptr,nullptr); + fluid_set_log_function(FLUID_WARN,nullptr,nullptr); + fluid_set_log_function(FLUID_ERR,fluid_default_log_function,nullptr); + fluid_set_log_function(FLUID_PANIC,fluid_default_log_function,nullptr); adriver=new_fluid_audio_driver(settings,synth); if(!adriver) { fputs("Error creating fluidsynth audio driver!",stderr); - delete_fluid_synth(synth);synth=NULL; + delete_fluid_synth(synth);synth=nullptr; return; } fluid_synth_set_chorus(synth,3,2.0,0.3,8.0, @@ -37,7 +37,7 @@ void qmpMidiOutFluid::deviceDeinit(bool freshsettings) if(!synth||!adriver)return; delete_fluid_audio_driver(adriver); delete_fluid_synth(synth); - synth=NULL;adriver=NULL; + synth=nullptr;adriver=nullptr; if(freshsettings) { delete_fluid_settings(settings); @@ -70,7 +70,7 @@ void qmpMidiOutFluid::basicMessage(uint8_t type,uint8_t p1,uint8_t p2) void qmpMidiOutFluid::extendedMessage(uint8_t length,const char *data) { int rlen=0; - fluid_synth_sysex(synth,data,length,NULL,&rlen,NULL,0); + fluid_synth_sysex(synth,data,length,nullptr,&rlen,nullptr,0); } void qmpMidiOutFluid::rpnMessage(uint8_t ch,uint16_t type,uint16_t val) { @@ -234,7 +234,7 @@ void qmpFileRendererFluid::renderDeinit() delete_fluid_player(player); delete_fluid_synth(synth); delete_fluid_settings(settings); - player=NULL;synth=NULL;settings=NULL; + player=nullptr;synth=nullptr;settings=nullptr; } void qmpFileRendererFluid::renderWorker() { |