From 41d78f3a67e2356008911b07f8cc0d0cdafd7fda Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 18 Apr 2016 23:34:22 +0800 Subject: Use std::vector for the event list. Add panic action. Minor changes on the panic function. --- core/qmpmidiplay.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'core/qmpmidiplay.cpp') diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 780b8f7..43ae17e 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -287,16 +287,21 @@ CMidiPlayer::~CMidiPlayer() } void CMidiPlayer::playerPanic(bool reset) { - if(reset)for(int i=0;i<16;++i) + for(int i=0;i<16;++i) { - fluid_synth_pitch_bend(synth,i,8192); - fluid_synth_cc(synth,i,7,100); - fluid_synth_cc(synth,i,10,64); - fluid_synth_cc(synth,i,11,127); - if(deviceusage[i])for(int j=0;j<16;++j)mapper->reset(i,j); + if(reset) + { + fluid_synth_pitch_bend(synth,i,8192); + fluid_synth_cc(synth,i,7,100); + fluid_synth_cc(synth,i,10,64); + fluid_synth_cc(synth,i,11,127); + } + fluid_synth_cc(synth,i,64,0); + //all sounds off causes the minus polyphone bug... + fluid_synth_all_notes_off(synth,i); + if(deviceusage[i])for(int j=0;j<16;++j) + reset?mapper->reset(i,j):mapper->panic(i,j); } - //all sounds off causes the minus polyphone bug... - for(int i=0;i<16;++i)fluid_synth_all_notes_off(synth,i); } bool CMidiPlayer::playerLoadFile(const char* fn) { -- cgit v1.2.3