From 24e9b335f0414428512eb9d61661b88d906448a5 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 31 Jan 2020 23:23:13 +0800 Subject: Simple visualization now reflects changes made in preset selection and channel editor dialog. Documentation update. --- simple-visualization/simplevisualization.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'simple-visualization') diff --git a/simple-visualization/simplevisualization.cpp b/simple-visualization/simplevisualization.cpp index 71dac7a..c8191b6 100644 --- a/simple-visualization/simplevisualization.cpp +++ b/simple-visualization/simplevisualization.cpp @@ -13,8 +13,11 @@ void qmpSimpleVisualization::init() api->registerOptionUint("","","Keyboard/bcolor"+std::to_string(i),0,0xffffff,0xff66ccff); } p=new qmpKeyboardWindow(api,(QWidget*)api->getMainWindow()); - uihs=api->registerUIHook("main.stop",[this](const void*,void*){this->p->resetAll();},nullptr); - uihsk=api->registerUIHook("main.seek",[this](const void*,void*){this->p->resetAll();},nullptr); + auto refreshfn=[this](const void*,void*){this->p->resetAll();}; + uihs=api->registerUIHook("main.stop",refreshfn,nullptr); + uihsk=api->registerUIHook("main.seek",refreshfn,nullptr); + uihsk=api->registerUIHook("preset.set",refreshfn,nullptr); + uihsk=api->registerUIHook("channel.ccchange",refreshfn,nullptr); } void qmpSimpleVisualization::deinit() { -- cgit v1.2.3