aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiplay.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-04-30 01:12:38 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-04-30 01:12:38 +0800
commitbd165c0254b9095bb9e5ea54def56b6404033ebe (patch)
treee6e965ff343c0cd4feea0180dd63522e05085567 /core/qmpmidiplay.cpp
parent8766f3b12e13d40b65eca23a850f687b0043d022 (diff)
downloadQMidiPlayer-bd165c0254b9095bb9e5ea54def56b6404033ebe.tar.xz
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).
Diffstat (limited to 'core/qmpmidiplay.cpp')
-rw-r--r--core/qmpmidiplay.cpp7
1 files changed, 6 insertions, 1 deletions
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;}