diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-09-10 23:55:48 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-09-10 23:55:48 +0800 |
commit | aec5e972e8968255e8843eb22314b96a8f23b041 (patch) | |
tree | 55990275b78a10188f7ec08436e748cc01461a91 /core/qmpmidiplay.cpp | |
parent | 1e0c10a001c61d27b210ae87652be849cbd5bcfe (diff) | |
download | QMidiPlayer-aec5e972e8968255e8843eb22314b96a8f23b041.tar.xz |
We refactorin', eh? Hell yeah.
(Almost) Completely rewritten qmpChannelsWindow, one of the oldest
component, now with a dedicated data model.
Removed dumb design (CMidiPlayer::getChstates).
Now QMidiPlayer requires C++14 to build.
More refactoring like this coming up soon.
Diffstat (limited to 'core/qmpmidiplay.cpp')
-rw-r--r-- | core/qmpmidiplay.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 6ff465f..46a2dae 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -22,6 +22,8 @@ bool CMidiPlayer::processEvent(const SEvent *e) for(auto i=event_handlers.begin();i!=event_handlers.end();++i) i->second.first((void*)e,i->second.second); uint8_t ch=e->type&0x0F; + if((e->type&0xF0)<0xF0) + levtt[ch]=std::chrono::system_clock::now(); switch(e->type&0xF0) { case 0x80://Note off @@ -29,7 +31,6 @@ bool CMidiPlayer::processEvent(const SEvent *e) case 0x90://Note on if((mute>>ch)&1&&e->p2)return false;//muted if(solo&&!((solo>>ch)&1)&&e->p2)return false;//excluded by solo flags - if(e->p2)chstate[ch]=1; return true; case 0xB0://CC if(e->p1==100)rpnid[ch]=e->p2; @@ -505,7 +506,8 @@ void CMidiPlayer::setChannelOutput(int ch,int outid) dold.dev->onUnmapped(ch,--dold.refcnt); } } -uint8_t* CMidiPlayer::getChstates(){return chstate;} +const std::chrono::system_clock::time_point* CMidiPlayer::getLastEventTS() +{return levtt;} int CMidiPlayer::setEventHandlerCB(ICallBack *cb,void *userdata) { for(int i=0;i<16;++i) |