zynaddsubfx

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

commit aa1222da5df2d5cbdc9ead3fad06cb2401840682
parent 2bf7a228d5475c26b20fd041df099489343e0796
Author: fundamental <[email protected]>
Date:   Sun,  1 Nov 2015 20:06:21 -0500

Middleware: Restore Save To Bank Slot

Diffstat:
Msrc/Misc/MiddleWare.cpp | 32+++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -809,23 +809,6 @@ rtosc::Ports bankPorts = { } else d.reply("/bank/bank_select", "i", impl.bankpos); rEnd}, - {"save_to_slot:ii", 0, 0, - rBegin; - const int part_id = rtosc_argument(msg, 0).i; - const int slot = rtosc_argument(msg, 1).i; - //impl.saveBankSlot(part_id, slot, master); - - //int err = 0; - //doReadOnlyOp([master,nslot,npart,&err](){ - // err = master->bank.savetoslot(nslot, master->part[npart]);}); - //if(err) { - // char buffer[1024]; - // rtosc_message(buffer, 1024, "/alert", "s", - // "Failed To Save To Bank Slot, please check file permissions"); - // GUI::raiseUi(ui, buffer); - //} - assert(false); - rEnd}, {"rename_slot:is", 0, 0, rBegin; const int slot = rtosc_argument(msg, 0).i; @@ -892,6 +875,21 @@ static rtosc::Ports middwareSnoopPorts = { d.obj = &impl.master->bank; bankPorts.dispatch(chomp(msg),d); rEnd}, + {"bank/save_to_slot:ii", 0, 0, + rBegin; + const int part_id = rtosc_argument(msg, 0).i; + const int slot = rtosc_argument(msg, 1).i; + + int err = 0; + impl.doReadOnlyOp([&impl,slot,part_id,&err](){ + err = impl.master->bank.savetoslot(slot, impl.master->part[part_id]);}); + if(err) { + char buffer[1024]; + rtosc_message(buffer, 1024, "/alert", "s", + "Failed To Save To Bank Slot, please check file permissions"); + GUI::raiseUi(impl.ui, buffer); + } + rEnd}, {"config/", 0, &Config::ports, rBegin; d.obj = impl.config;