aboutsummaryrefslogtreecommitdiff
path: root/visualization/qmpvisualization.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-06-16 23:51:26 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-06-16 23:51:26 +0800
commit64c91c7da66ba71e2bb32077680f234aba4ac65d (patch)
treedc44e44c4f2b1530952f57538d7164f712b61b02 /visualization/qmpvisualization.cpp
parent37ba9dd1ce449bc2c2f422dd04225bc68bd89c59 (diff)
downloadQMidiPlayer-64c91c7da66ba71e2bb32077680f234aba4ac65d.tar.xz
Code refactoring and fix to memory leaks.
Diffstat (limited to 'visualization/qmpvisualization.cpp')
-rw-r--r--visualization/qmpvisualization.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp
index ffc01ad..43414b6 100644
--- a/visualization/qmpvisualization.cpp
+++ b/visualization/qmpvisualization.cpp
@@ -50,7 +50,10 @@ void CReaderCallBack::callBack(void *callerdata,void *)
par->pushNoteOff(cbd->time,cbd->type&0x0F,cbd->p1);
break;
case 0x90:
+ if(cbd->p2)
par->pushNoteOn(cbd->time,cbd->type&0x0F,cbd->p1,cbd->p2);
+ else
+ par->pushNoteOff(cbd->time,cbd->type&0x0F,cbd->p1);
break;
case 0xF0:
if(cbd->type==0xFF&&cbd->p1==0x58)
@@ -854,5 +857,4 @@ void qmpVisualization::pushNoteOff(uint32_t tc,uint32_t ch,uint32_t key)
ne->tce=tc;ne->ch=ch;ne->key=key;
ne->vel=pendingv[ch][key].top();pendingv[ch][key].pop();
pool.push_back(ne);
- if(tc>fintk)fintk=tc;
}