aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiplay.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-18 23:34:22 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-18 23:34:22 +0800
commit41d78f3a67e2356008911b07f8cc0d0cdafd7fda (patch)
treef9ab616fb25b718b4299b15b90e54c86cb131161 /core/qmpmidiplay.cpp
parentb21f97f416cea5d9d86e3b28bd797b42491fc5a9 (diff)
downloadQMidiPlayer-41d78f3a67e2356008911b07f8cc0d0cdafd7fda.tar.xz
Use std::vector for the event list. Add panic action.
Minor changes on the panic function.
Diffstat (limited to 'core/qmpmidiplay.cpp')
-rw-r--r--core/qmpmidiplay.cpp21
1 files changed, 13 insertions, 8 deletions
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)
{