zynaddsubfx

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

commit fa7c78b703486e842e418a7d1a723155bb09239e
parent e8b4b139242d0bdf6871a8b6906d936397fc28f3
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Sat, 21 Feb 2015 13:11:14 -0500

UI: Proper Update When Bank Changes Ins

Diffstat:
Msrc/UI/BankUI.fl | 1+
Msrc/UI/BankView.cpp | 9++++++++-
Msrc/UI/BankView.h | 3+++
3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/UI/BankUI.fl b/src/UI/BankUI.fl @@ -118,6 +118,7 @@ simplesetmode(config.cfg.UserInterfaceMode==2);} {} Function {init(Fl_Valuator *cbwig_)} {open } { code {cbwig=cbwig_; + bankview->cbwig(cbwig); rescan_for_banks();} {} } Function {process()} {open return_type void diff --git a/src/UI/BankView.cpp b/src/UI/BankView.cpp @@ -198,7 +198,7 @@ void BankViewControls::mode(int m) BankView::BankView(int x,int y, int w, int h, const char *label) :Fl_Group(x,y,w,h,label), bvc(NULL), slots{0}, osc(0), - loc(""), nselected(-1), npart(0) + loc(""), nselected(-1), npart(0), cbwig_(0) {} @@ -274,6 +274,8 @@ void BankView::react(int event, int nslot) printf("Loading a part #%d with file '%s'\n", nslot, slot.filename()); osc->write("/load-part", "is", *npart, slot.filename()); osc->writeValue("/part"+to_s(*npart)+"/name", slot.name()); + if(cbwig_) + cbwig_->do_callback(); } //save(write) to slot @@ -325,6 +327,11 @@ void BankView::OSC_raw(const char *msg) if(0 <= nslot && nslot < 160) slots[nslot]->update(name, fname); } + +void BankView::cbwig(Fl_Widget *w) +{ + cbwig_ = w; +} void BankView::refresh(void) { diff --git a/src/UI/BankView.h b/src/UI/BankView.h @@ -78,6 +78,7 @@ class BankView: public Fl_Group, public Fl_Osc_Widget void react(int event, int slot); virtual void OSC_raw(const char *msg) override; + void cbwig(Fl_Widget *w); void refresh(void); private: @@ -90,6 +91,8 @@ class BankView: public Fl_Group, public Fl_Osc_Widget //XXX TODO locked banks... int nselected; int *npart; + + Fl_Widget *cbwig_; }; #endif