diff options
Diffstat (limited to 'simple-visualization')
-rw-r--r-- | simple-visualization/qmpkeyboardwindow.cpp | 6 | ||||
-rw-r--r-- | simple-visualization/qmpkeyboardwindow.hpp | 2 | ||||
-rw-r--r-- | simple-visualization/simplevisualization.cpp | 10 | ||||
-rw-r--r-- | simple-visualization/simplevisualization.hpp | 2 |
4 files changed, 6 insertions, 14 deletions
diff --git a/simple-visualization/qmpkeyboardwindow.cpp b/simple-visualization/qmpkeyboardwindow.cpp index a42a2e0..f2cc8b7 100644 --- a/simple-visualization/qmpkeyboardwindow.cpp +++ b/simple-visualization/qmpkeyboardwindow.cpp @@ -25,10 +25,10 @@ void qmpKeyboardWindow::onkeystatesupdate(int ch,int key,bool state) void qmpKeyboardWindow::resetAll() {for(int ch=0;ch<16;++ch)pw[ch]->reset();} -void EventCallback::callBack(void* callerdata,void* userdata) +void EventCallback::callBack(const void *callerdata,void* userdata) { - qmpKeyboardWindow *w=(qmpKeyboardWindow*)userdata; - SEventCallBackData *cbd=(SEventCallBackData*)callerdata; + const qmpKeyboardWindow *w=(const qmpKeyboardWindow*)userdata; + const SEvent *cbd=(const SEvent*)callerdata; if((cbd->type&0xF0)==0x80) emit keystateupdated(cbd->type&0xF,cbd->p1,false); if((cbd->type&0xF0)==0x90) diff --git a/simple-visualization/qmpkeyboardwindow.hpp b/simple-visualization/qmpkeyboardwindow.hpp index a99e62e..2b618fa 100644 --- a/simple-visualization/qmpkeyboardwindow.hpp +++ b/simple-visualization/qmpkeyboardwindow.hpp @@ -10,7 +10,7 @@ class EventCallback:public QObject,public ICallBack { Q_OBJECT public: - void callBack(void* callerdata,void* userdata); + void callBack(const void *callerdata,void *userdata); signals: void keystateupdated(int ch,int key,bool state); }; diff --git a/simple-visualization/simplevisualization.cpp b/simple-visualization/simplevisualization.cpp index 0a1de02..e4c0c83 100644 --- a/simple-visualization/simplevisualization.cpp +++ b/simple-visualization/simplevisualization.cpp @@ -7,8 +7,8 @@ void qmpSimpleVisualization::close(){p->close();} void qmpSimpleVisualization::init() { api->registerFunctionality(this,"Keyboard","Keyboard",api->isDarkTheme()?":/img/visualization_i.svg":":/img/visualization.svg",0,true); - p=new qmpKeyboardWindow(api,NULL); - uihs=api->registerUIHook("main.stop",qmpSimpleVisualization::cbstop,(void*)this); + p=new qmpKeyboardWindow(api,(QWidget*)api->getMainWindow()); + uihs=api->registerUIHook("main.stop",[this](const void*,void*){this->p->resetAll();},nullptr); } void qmpSimpleVisualization::deinit() { @@ -21,9 +21,3 @@ const char* qmpSimpleVisualization::pluginGetName() {return "QMidiPlayer Simple Visualization Plugin";} const char* qmpSimpleVisualization::pluginGetVersion() {return "0.8.6";} - -void qmpSimpleVisualization::cbstop(void*,void* usrd) -{ - qmpSimpleVisualization *v=(qmpSimpleVisualization*)usrd; - v->p->resetAll(); -} diff --git a/simple-visualization/simplevisualization.hpp b/simple-visualization/simplevisualization.hpp index b3edeee..d79eef0 100644 --- a/simple-visualization/simplevisualization.hpp +++ b/simple-visualization/simplevisualization.hpp @@ -18,8 +18,6 @@ class qmpSimpleVisualization:public qmpPluginIntf,public qmpFuncBaseIntf void deinit(); const char* pluginGetName(); const char* pluginGetVersion(); - - static void cbstop(void* cbd,void* usrd); }; extern "C"{ |