From bd165c0254b9095bb9e5ea54def56b6404033ebe Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Thu, 30 Apr 2020 01:12:38 +0800 Subject: Add visualization renderer. Add API for getting raw pitch bend values. Fix non-compliant RPN handling. The visualization renderer is still at the "proof-of-concept" stage. It's not very usable (yet). --- core/qmpmidiplay.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/qmpmidiplay.cpp') diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 01045c1..a354d6e 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -106,7 +106,7 @@ void CMidiPlayer::processEventStub(const SEvent *e) if(~rpnid[e->type&0x0F]&&~rpnval[e->type&0x0F]) { if(rpnid[e->type&0x0F]==0)ccc[e->type&0x0F][134]=rpnval[e->type&0x0F]; - rpnid[e->type&0x0F]=rpnval[e->type&0x0F]=-1; + rpnval[e->type&0x0F]=-1; } ccc[e->type&0x0F][e->p1]=e->p2; break; @@ -404,6 +404,11 @@ uint32_t CMidiPlayer::getRawTempo(){return ctempo;} uint32_t CMidiPlayer::getDivision(){return divs;} uint32_t CMidiPlayer::getMaxTick(){return maxtk;} double CMidiPlayer::getPitchBend(int ch){return((int)pbv[ch]-8192)/8192.*pbr[ch];} +double CMidiPlayer::getPitchBendRaw(int ch,uint32_t *pb,uint32_t *pbr) +{ + if(pb)*pb=this->pbv[ch]; + if(pbr)*pbr=this->pbr[ch]; +} uint32_t CMidiPlayer::getTCpaused(){return tcpaused;} void CMidiPlayer::setTCpaused(uint32_t ps){tcpaused=ps;} uint32_t CMidiPlayer::isFinished(){return finished;} -- cgit v1.2.3