diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-04-26 23:16:46 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-04-26 23:16:46 +0800 |
commit | dfcc193d4070c99bf217ac74a492160968dba766 (patch) | |
tree | 444132b8cf98ef3d8bc7b346f6e5bf515e662f1b /visualization/qmpvisualization.hpp | |
parent | 4ffde0ad55d041229793ca4457123bcbcbf8e0c0 (diff) | |
download | QMidiPlayer-dfcc193d4070c99bf217ac74a492160968dba766.tar.xz |
The visualization plugin is usable now...
Diffstat (limited to 'visualization/qmpvisualization.hpp')
-rw-r--r-- | visualization/qmpvisualization.hpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/visualization/qmpvisualization.hpp b/visualization/qmpvisualization.hpp index df9255c..438b98a 100644 --- a/visualization/qmpvisualization.hpp +++ b/visualization/qmpvisualization.hpp @@ -10,14 +10,22 @@ #include "../include/qmpcorepublic.hpp" class qmpVisualization; -class CTestCallBack:public IMidiCallBack +class CReaderCallBack:public IMidiCallBack { private: qmpVisualization *par; public: - CTestCallBack(qmpVisualization *_par){par=_par;} + CReaderCallBack(qmpVisualization *_par){par=_par;} void callBack(void *callerdata,void *userdata); }; +class CHandlerCallBack:public IMidiCallBack +{ + private: + qmpVisualization *par; + public: + CHandlerCallBack(qmpVisualization *_par){par=_par;} + void callBack(void*,void*); +}; struct MidiVisualEvent { uint32_t tcs,tce; @@ -26,22 +34,26 @@ struct MidiVisualEvent }; class qmpVisualization:public qmpPluginIntf { + friend class CHandlerCallBack; private: qmpPluginAPI* api; - CTestCallBack* cb; + CReaderCallBack* cb; + CHandlerCallBack* hcb; qmpVisualizationIntf* vi; std::thread* rendererTh; std::vector<MidiVisualEvent*>pool; - smHandler* h; + smHandler *h,*closeh; std::stack<uint32_t> pendingt[16][128],pendingv[16][128]; SMELT *sm; SMTRG tdscn; SMTEX chequer; smTTFont font; float pos[3],rot[3],lastx,lasty; - uint32_t ctc,dvs,ctk,fintk; + uint32_t ctc,ctk,fintk,elb; double etps; + bool shouldclose,playing; void drawCube(smvec3d a,smvec3d b,DWORD col,SMTEX tex); + void showThread(); public: qmpVisualization(qmpPluginAPI* _api); ~qmpVisualization(); @@ -71,6 +83,12 @@ class CMidiVisualHandler:public smHandler bool handlerFunc(){return p->update();} }; +class RefuseCloseHandler:public smHandler +{ + public: + bool handlerFunc(){return true;} +}; + class CDemoVisualization:public qmpVisualizationIntf { private: |