diff --git a/src/UI.cpp b/src/UI.cpp index add44be..429955d 100755 --- a/src/UI.cpp +++ b/src/UI.cpp @@ -19,6 +19,11 @@ void UI::render() { if (*lastKey == 100) { debug = !debug; + if (debug == true) { + for (unsigned i = 0; i < UIListeners.size(); i++) { + UIListeners[i]->componentSetup(); + } + } } if (debug) { diff --git a/src/UI.h b/src/UI.h index 95471e2..54894ce 100755 --- a/src/UI.h +++ b/src/UI.h @@ -8,6 +8,7 @@ #ifndef UI_H_ #define UI_H_ #include +#include "UIListener.hpp" class UI { bool debug = false, showSlider = false; @@ -15,8 +16,8 @@ class UI { int *lastKey; unsigned state = 0; std::vector frames = {cv::Mat()}; - std::vector debugAddonStarter; public: + std::vector UIListeners; UI(int *lastKey); void render(); void nextDebugFrame(); diff --git a/src/UIListener.hpp b/src/UIListener.hpp new file mode 100755 index 0000000..addc24a --- /dev/null +++ b/src/UIListener.hpp @@ -0,0 +1,12 @@ +#ifndef UILISTENER_HPP_ +#define UILISTENER_HPP_ + + +class UIListener { +public: + virtual void componentSetup() = 0; + virtual ~UIListener(); +}; + + +#endif /* UILISTENER_HPP_ */