diff options
author | Chris Xiong <chirs241097@gmail.com> | 2017-10-18 11:40:51 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2017-10-18 11:40:51 +0800 |
commit | d985112164bd2bfeca0c895abb523d45f0e065bb (patch) | |
tree | 3a44ae92001c2a8cac89eb46fe74248249d6e0ea /visualization/qmpvisualization.hpp | |
parent | 48dd5f9fb11f0a2e69291271d9140ebcec640117 (diff) | |
download | QMidiPlayer-d985112164bd2bfeca0c895abb523d45f0e065bb.tar.xz |
API changes and crash fixes.
Details in the changelog.
Diffstat (limited to 'visualization/qmpvisualization.hpp')
-rw-r--r-- | visualization/qmpvisualization.hpp | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/visualization/qmpvisualization.hpp b/visualization/qmpvisualization.hpp index f9e6062..9d62397 100644 --- a/visualization/qmpvisualization.hpp +++ b/visualization/qmpvisualization.hpp @@ -12,7 +12,7 @@ #include "../include/qmpcorepublic.hpp" class qmpVisualization; -class CReaderCallBack:public IMidiCallBack +class CReaderCallBack:public ICallBack { private: qmpVisualization *par; @@ -20,7 +20,7 @@ class CReaderCallBack:public IMidiCallBack CReaderCallBack(qmpVisualization *_par){par=_par;} void callBack(void *callerdata,void *userdata); }; -class CEventHandlerCallBack:public IMidiCallBack +class CEventHandlerCallBack:public ICallBack { private: qmpVisualization *par; @@ -28,7 +28,7 @@ class CEventHandlerCallBack:public IMidiCallBack CEventHandlerCallBack(qmpVisualization *_par){par=_par;} void callBack(void*,void*); }; -class CFRFinishedCallBack:public IMidiCallBack +class CFRFinishedCallBack:public ICallBack { private: qmpVisualization *par; @@ -42,7 +42,7 @@ struct MidiVisualEvent uint32_t key,vel; uint32_t ch; }; -class qmpVisualization:public qmpPluginIntf +class qmpVisualization:public qmpPluginIntf,public qmpFuncBaseIntf { friend class CEventHandlerCallBack; friend class CReaderCallBack; @@ -52,7 +52,6 @@ class qmpVisualization:public qmpPluginIntf qmpPluginAPI* api; CReaderCallBack* cb; CEventHandlerCallBack* hcb; - qmpVisualizationIntf* vi; CFRFinishedCallBack* frcb; std::thread* rendererTh; std::vector<MidiVisualEvent*>pool; @@ -83,18 +82,23 @@ class qmpVisualization:public qmpPluginIntf public: qmpVisualization(qmpPluginAPI* _api); ~qmpVisualization(); + void show(); + void close(); bool update(); void start(); void stop(); void pause(); - void show(); - void close(); void reset(); void init(); void deinit(); const char* pluginGetName(); const char* pluginGetVersion(); + + static void cbstart(void* cbd,void* usrd); + static void cbstop(void* cbd,void* usrd); + static void cbpause(void* cbd,void* usrd); + static void cbreset(void* cbd,void* usrd); }; class CMidiVisualHandler:public smHandler @@ -122,20 +126,6 @@ class CloseHandler:public smHandler } }; -class CDemoVisualization:public qmpVisualizationIntf -{ - private: - qmpVisualization* par; - public: - CDemoVisualization(qmpVisualization *p){par=p;} - void show(){par->show();} - void close(){par->close();} - void start(){par->start();} - void stop(){par->stop();} - void pause(){par->pause();} - void reset(){par->reset();} -}; - extern "C"{ EXPORTSYM qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) {return new qmpVisualization(api);} |