zynaddsubfx

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

commit 9ad6bb7b3c1329dfe4cb5c45ccd7ee9a8c41ac83
parent 03417924f0f74a9a3aad6330fc5e80b1b6e74841
Author: Christopher A. Oliver <caowasteland@gmail.com>
Date:   Sun,  4 Oct 2015 23:20:22 -0400

Inhibit messing with the free mode window if not in free mode editing.

Diffstat:
Msrc/UI/EnvelopeFreeEdit.cpp | 6++++++
Msrc/UI/EnvelopeFreeEdit.h | 2++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/UI/EnvelopeFreeEdit.cpp b/src/UI/EnvelopeFreeEdit.cpp @@ -21,6 +21,7 @@ void EnvelopeFreeEdit::init(void) oscRegister("Penvdt"); oscRegister("Penvval"); oscRegister("Penvsustain"); + oscRegister("Pfreemode"); //register for non-bulk types for(int i=0; i<MAX_ENVELOPE_POINTS; ++i) { @@ -54,6 +55,8 @@ void EnvelopeFreeEdit::OSC_raw(const char *msg) Penvdt[id] = rtosc_argument(msg, 0).i; } else if(strstr(msg,"Penvsustain") && !strcmp(args, "i")) { Penvsustain = rtosc_argument(msg, 0).i; + } else if(strstr(msg,"Pfreemode")) { + Pfreemode = !strcmp(args, "T"); } redraw(); do_callback(); @@ -195,6 +198,9 @@ int EnvelopeFreeEdit::handle(int event) const int y_=Fl::event_y()-y(); static Fl_Widget *old_focus; + if (!Pfreemode) + return 0; + switch(event) { case FL_ENTER: old_focus=Fl::focus(); diff --git a/src/UI/EnvelopeFreeEdit.h b/src/UI/EnvelopeFreeEdit.h @@ -47,4 +47,6 @@ class EnvelopeFreeEdit : public Fl_Box, public Fl_Osc_Widget char Penvval[MAX_ENVELOPE_POINTS]; //The Sustain point char Penvsustain; + //Are we a free mode editor? + char Pfreemode; };