zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 0b8677f6109f50ba645df62c2ebaf8913fdfdaf9
parent 4616b4ff038d4085e7bed9e5a857c6a065c134aa
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Sun,  4 Aug 2013 14:31:23 -0400

MiddleWare: Add Check For Unused UI events

Its easy enough to get the backend to spew out all sorts of unneeded messages so
there should be some alert if they are going to /dev/null.
This is certainly a much weaker case than when an event directed to the backend
misses everything as there are some cases where it is expected that a widget
will not be reached (though they are uncommon).

Diffstat:
Msrc/Misc/MiddleWare.cpp | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -605,8 +605,11 @@ class UI_Interface:public Fl_Osc_Interface if(handle) ++handle; + int found_count = 0; + for(auto pair:map) { if(pair.first == msg) { + found_count++; const char *arg_str = rtosc_argument_string(msg); //Always provide the raw message @@ -632,6 +635,14 @@ class UI_Interface:public Fl_Osc_Interface } } } + + if(found_count == 0 + && strcmp(msg, "/vu-meter") + && strcmp(msg, "undo_change")) { + fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 1, 7 + 30, 0 + 40); + fprintf(stderr, "Unknown widget '%s'\n", msg); + fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40); + } }; void dumpLookupTable(void)