zynaddsubfx

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

commit 91071fa392611bddc78cf8fa338856490cc26411
parent ff673e524e677703cca5606e9c665068d2ffbfee
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Sat, 10 Oct 2015 11:37:04 -0400

Tweak UI Title Rewrite

Diffstat:
Msrc/Misc/MiddleWare.cpp | 2++
Msrc/UI/Fl_Osc_Pane.cpp | 18++++++++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -1243,6 +1243,8 @@ void MiddleWareImpl::handleMsg(const char *msg) undo.seekHistory(-1); } else if(!strcmp(msg, "/redo")) { undo.seekHistory(+1); + } else if(!strcmp(msg, "/ui/title")) { + ;//drop the message into the abyss } else uToB->raw_write(msg); } diff --git a/src/UI/Fl_Osc_Pane.cpp b/src/UI/Fl_Osc_Pane.cpp @@ -11,13 +11,27 @@ Fl_Osc_Pane::Fl_Osc_Pane(void) Fl_Osc_Window::Fl_Osc_Window(int w, int h, const char *L) :Fl_Double_Window(w,h,L), title_ext(NULL) {} - + void Fl_Osc_Window::init(Fl_Osc_Interface *osc_, std::string loc_) { title_ext = new Osc_DataModel(osc_); title_ext->doUpdate("/ui/title"); title_ext->callback = [this](string next) { - title_new = title_orig + next; + //printf("old: %s\n", title_orig.c_str()); + const char *orig = title_orig.c_str(); + // 12345678901 + const char *sub = strstr(orig, "zynaddsubfx"); + if(!sub) + sub = strstr(orig, "ZynAddSubFX"); + title_new = ""; + while(*orig) { + if(orig == sub) { + title_new += next; + orig += 11; + } else + title_new += *orig++; + } + //title_new = title_orig + next; this->label(title_new.c_str()); }; title_orig = label();