aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiplay.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-01-02 22:09:28 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-01-02 22:09:28 +0800
commitb7842ae90b28618affdad6977c9c814aa573a3fe (patch)
treed43616b5b01a7c0b20044ff4564251043f313e9e /core/qmpmidiplay.hpp
parentb79c4b7e3cab3711e87ba9e28fa8423a84ea7efa (diff)
downloadQMidiPlayer-b7842ae90b28618affdad6977c9c814aa573a3fe.tar.xz
Can show measure indicators now.
Added new options to specify custom fonts. Added a new handler API. Minor rework on handler calling.
Diffstat (limited to 'core/qmpmidiplay.hpp')
-rw-r--r--core/qmpmidiplay.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/qmpmidiplay.hpp b/core/qmpmidiplay.hpp
index f7b81af..5b6c5a7 100644
--- a/core/qmpmidiplay.hpp
+++ b/core/qmpmidiplay.hpp
@@ -21,6 +21,7 @@ struct SEvent
if(s){str=new char[strlen(s)+2];strcpy(str,s);}else str=NULL;
}
};
+class CMidiPlayer;
class CMidiFile
{
private:
@@ -44,7 +45,7 @@ class CMidiFile
int chunkReader(int hdrXp);
void dumpEvents();
public:
- CMidiFile(const char* fn,IMidiCallBack** ercb,void** ercbdata);
+ CMidiFile(const char* fn,CMidiPlayer* par);
~CMidiFile();
const SEvent* getEvent(uint32_t id);
uint32_t getEventCount();
@@ -59,9 +60,10 @@ class CMidiFile
};
class CMidiPlayer
{
+ friend class CMidiFile;
private:
CMidiFile *midiFile;
- uint32_t stamps[101];
+ uint32_t stamps[101],maxtk;
uint32_t ccstamps[101][16][135],ccc[16][135];
//0..127:cc 128:pc 129:cp 130:pb 131:tempo 132:ts 133:ks 134:pbr
int32_t rpnid[16],rpnval[16];
@@ -83,8 +85,10 @@ class CMidiPlayer
uint8_t chstate[16],chstatus[16][130];//0..127: cc 128: pc
IMidiCallBack* eventHandlerCB[16];
IMidiCallBack* eventReaderCB[16];
+ IMidiCallBack* fileReadFinishCB[16];
void* eventHandlerCBuserdata[16];
void* eventReaderCBuserdata[16];
+ void* fileReadFinishCBuserdata[16];
void setBit(uint16_t &n,uint16_t bn,uint16_t b);
void processEvent(const SEvent *e);
@@ -129,6 +133,7 @@ class CMidiPlayer
uint32_t getTick();
uint32_t getRawTempo();
uint32_t getDivision();
+ uint32_t getMaxTick();
double getPitchBend(int ch);
const char* getTitle();
const char* getCopyright();
@@ -164,6 +169,8 @@ class CMidiPlayer
void unsetEventHandlerCB(int id);
int setEventReaderCB(IMidiCallBack *cb,void *userdata);
void unsetEventReaderCB(int id);
+ int setFileReadFinishedCB(IMidiCallBack *cb,void *userdata);
+ void unsetFileReadFinishedCB(int id);
void discardLastEvent();
void commitEventChange(SEventCallBackData d);