diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-06-01 23:02:21 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-06-01 23:02:21 +0800 |
commit | d97a417012d7e510b08c2e7d9a71997605c48e88 (patch) | |
tree | f13402745af921be0d791c5a10f9ad8fda78ef72 /core/qmpmidiread.cpp | |
parent | c6f549a963ece1ed757793540d42d50111c19a80 (diff) | |
download | QMidiPlayer-d97a417012d7e510b08c2e7d9a71997605c48e88.tar.xz |
Initial event modifier and event filter stub.
Diffstat (limited to 'core/qmpmidiread.cpp')
-rw-r--r-- | core/qmpmidiread.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp index 9b1d932..33a1bd4 100644 --- a/core/qmpmidiread.cpp +++ b/core/qmpmidiread.cpp @@ -50,7 +50,7 @@ int CMidiFile::eventReader()//returns 0 if End of Track encountered { uint32_t delta=readVL();curt+=delta; char type=fgetc(f);++byteread;uint32_t p1,p2; - static char lasttype; + static char lasttype;eventdiscarded=0; if(!(type&0x80)){fseek(f,-1,SEEK_CUR);--byteread;type=lasttype;} switch(type&0xF0) { @@ -257,3 +257,16 @@ uint32_t CMidiFile::getStandard(){return std;} bool CMidiFile::isValid(){return valid;} const char* CMidiFile::getTitle(){return title;} const char* CMidiFile::getCopyright(){return copyright;} + +void CMidiFile::discardLastEvent() +{ + if(eventdiscarded)return;eventdiscarded=1; + delete eventList[eventList.size()-1];eventList.pop_back(); +} +void CMidiFile::commitEventChange(SEventCallBackData d) +{ + eventList[eventList.size()-1]->time=d.time; + eventList[eventList.size()-1]->type=d.type; + eventList[eventList.size()-1]->p1=d.p1; + eventList[eventList.size()-1]->p2=d.p2; +} |