aboutsummaryrefslogtreecommitdiff
path: root/visualization
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
parent37ba9dd1ce449bc2c2f422dd04225bc68bd89c59 (diff)
downloadQMidiPlayer-64c91c7da66ba71e2bb32077680f234aba4ac65d.tar.xz
Code refactoring and fix to memory leaks.
Diffstat (limited to 'visualization')
-rw-r--r--visualization/qmpvisualization.cpp4
-rw-r--r--visualization/qmpvisualization.hpp2
2 files changed, 4 insertions, 2 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;
}
diff --git a/visualization/qmpvisualization.hpp b/visualization/qmpvisualization.hpp
index 6518376..b52fa3d 100644
--- a/visualization/qmpvisualization.hpp
+++ b/visualization/qmpvisualization.hpp
@@ -67,7 +67,7 @@ class qmpVisualization:public qmpPluginIntf
smParticleSystem* pss[16][128];
smPSEmissionPositionGenerator* psepg;
float pos[3],rot[3],lastx,lasty;
- uint32_t ctc,ctk,fintk,elb;
+ uint32_t ctc,ctk,elb;
double etps;
bool shouldclose,playing;
int herif,hehif,hfrf;