zynaddsubfx

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

commit 7c9704d62af56fb0659a37e7894f89b624548bee
parent 18be147b7e5ce77f966b74e9b99f06c448538151
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Thu,  8 Aug 2013 13:45:20 -0400

Partial Oscification of PartUI/MasterUI

This is a bit of a half baked commit as significant work needs to be done on the
side of MiddleWare and Effects before either of these modules can be finished
off. As such there are a number of dangling widgets which may or may not get
updated to the right location on a rebase() operation.

Notably:

- MiddleWare support of deleting parts is needed to continue
- Microtonal/Controls needs to be validated
- Fl_Osc_Input needs to be properly implemented
- Some custom widget is needed for the bank UI spawner
- the basic UI needs to be tested *shudder*

Diffstat:
Msrc/Misc/MiddleWare.cpp | 3---
Msrc/Misc/Part.cpp | 27+++++++++++++++++++++++++++
Msrc/Params/Controller.cpp | 27+++++++++++++++++++++++++--
Msrc/Params/Controller.h | 1+
Msrc/UI/BankView.cpp | 4----
Msrc/UI/CMakeLists.txt | 1+
Asrc/UI/Fl_Osc_Input.H | 12++++++++++++
Asrc/UI/Fl_Osc_Input.cpp | 12++++++++++++
Msrc/UI/MasterUI.fl | 123++++++++++++++++++++++++++++++++++++++-----------------------------------------
Msrc/UI/PartUI.fl | 328+++++++++++++++++++++++++++++++++++++++----------------------------------------
10 files changed, 299 insertions(+), 239 deletions(-)

diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -188,8 +188,6 @@ void preparePadSynth(string path, PADnoteParameters *p) void refreshBankView(const Bank &bank, unsigned loc, Fl_Osc_Interface *osc) { - puts("bank response..."); - if(loc >= BANK_SIZE) return; @@ -201,7 +199,6 @@ void refreshBankView(const Bank &bank, unsigned loc, Fl_Osc_Interface *osc) osc->tryLink(response); - puts("response sent..."); } // diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp @@ -38,12 +38,29 @@ #include <cassert> #include <rtosc/ports.h> +#include <rtosc/port-sugar.h> using rtosc::Ports; using rtosc::RtData; +#define rObject Part static Ports partPorts = { RECURS(Part, Part::Kit, kit, kit, 16, "Kit"),//NUM_KIT_ITEMS + rRecur(ctl, "Controller"), + rToggle(Penabled, "Part enable"), + rParam(Pvolume, "Part Volume"), + rParam(Pminkey, "Min Used Key"), + rParam(Pmaxkey, "Max Used Key"), + rParam(Pkeyshift, "Part keyshift"), + rParam(Prcvchn, "Active MIDI channel"), + rParam(Ppanning, "Set Panning"), + rParam(Pvelsns, "Velocity sensing"), + rParam(Pveloffs, "Velocity offset"), + rToggle(Pnoteon, "If the channel accepts note on events"), + rToggle(Pdrummode, "Drum mode enable"), + rToggle(Ppolymode, "Polyphoney mode"), + rToggle(Plegatomode, "Legato enable"), + rParam(Pkeylimit, "Key limit per part"), //{"kit#16::T:F", "::Enables or disables kit item", 0, // [](const char *m, RtData &d) { // Part *p = (Part*)d.obj; @@ -64,10 +81,20 @@ static Ports partPorts = { // }} }; +#undef rObject +#define rObject Part::Kit static Ports kitPorts = { RECURP(Part::Kit, PADnoteParameters, padpars, padpars, "Padnote parameters"), RECURP(Part::Kit, ADnoteParameters, adpars, adpars, "Adnote parameters"), RECURP(Part::Kit, SUBnoteParameters, subpars, subpars, "Adnote parameters"), + rToggle(Penabled, "Kit item enable"), + rToggle(Pmuted, "Kit item mute"), + rParam(Pminkey, "Kit item min key"), + rParam(Pmaxkey, "Kit item max key"), + rToggle(Padenabled, "ADsynth enable"), + rToggle(Psubenabled, "SUBsynth enable"), + rToggle(Ppadenabled, "PADsynth enable"), + rParam(Psendtoparteffect, "Effect Levels"), //{"padpars:b", "::", 0 // []( }; diff --git a/src/Params/Controller.cpp b/src/Params/Controller.cpp @@ -21,8 +21,31 @@ */ #include "Controller.h" -#include <math.h> -#include <stdio.h> +#include <cmath> +#include <cstdio> + +#include <rtosc/ports.h> +#include <rtosc/port-sugar.h> +using namespace rtosc; + +#define rObject Controller +rtosc::Ports Controller::ports = { + rToggle(expression.receive, "Expression MIDI Receive"), + rToggle(bandwidth.exponential, "Bandwidth ???"), + rToggle(fmamp.receive, "FM amplitude MIDI Receive"), + rToggle(volume.receive, "Volume MIDI Receive"), + rToggle(sustain.receive, "Sustain MIDI Receive"), + rToggle(portamento.receive, "Portamento MIDI Receive"), + rToggle(portamento.portamento, "UNDOCUMENTED"), + rParam(portamento.time, "Portamento Length"), + rToggle(portamento.proportional, "If all portamentos are proportional to the distance they span"), + rParam(portamento.propRate, "Portamento proportional rate"), + rParam(portamento.propDepth, "Portamento proportional depth"), + rParam(portamento.pitchthresh, "Threshold for portamento"), + rToggle(portamento.pitchthreshtype, "Type of threshold"), + rParam(portamento.updowntimestretch, "UNDOCUMENTED"), +}; + Controller::Controller() { diff --git a/src/Params/Controller.h b/src/Params/Controller.h @@ -214,6 +214,7 @@ class Controller unsigned char receive; //this is saved to disk by Master } NRPN; + static rtosc::Ports ports; private: }; diff --git a/src/UI/BankView.cpp b/src/UI/BankView.cpp @@ -178,7 +178,6 @@ void BankView::init(Fl_Osc_Interface *osc_, BankViewControls *bvc_, int npart_) osc = osc_; bvc = bvc_; npart = npart_; - printf("BankView initialization...\n"); osc->createLink("/bankview", this); @@ -281,9 +280,6 @@ void BankView::OSC_raw(const char *msg) if(0 <= nslot && nslot < 160) slots[nslot]->update(name, fname); - - - puts("Got a BankView event..."); } void BankView::refresh(void) diff --git a/src/UI/CMakeLists.txt b/src/UI/CMakeLists.txt @@ -46,6 +46,7 @@ add_library(zynaddsubfx_gui STATIC Fl_Osc_Roller.cpp Fl_Osc_Output.cpp Fl_Osc_Counter.cpp + Fl_Osc_Input.cpp Fl_Resonance_Graph.cpp FormantFilterGraph.cpp EnvelopeFreeEdit.cpp diff --git a/src/UI/Fl_Osc_Input.H b/src/UI/Fl_Osc_Input.H @@ -0,0 +1,12 @@ +#include <FL/Fl_Input.H> +#include "Fl_Osc_Widget.H" + +class Fl_Osc_Input: public Fl_Input, public Fl_Osc_Widget +{ + public: + Fl_Osc_Input(int X, int Y, int W, int H, const char *label = NULL); + virtual ~Fl_Osc_Input(void); + + //Normal Initialization + void init(const char *path); +}; diff --git a/src/UI/Fl_Osc_Input.cpp b/src/UI/Fl_Osc_Input.cpp @@ -0,0 +1,12 @@ +#include "Fl_Osc_Input.H" + +Fl_Osc_Input::Fl_Osc_Input(int X, int Y, int W, int H, const char *label) + :Fl_Input(X,Y,W,H, label), Fl_Osc_Widget(this) +{ +} + +Fl_Osc_Input::~Fl_Osc_Input(void) +{} + +void Fl_Osc_Input::init(const char *path) +{} diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl @@ -121,17 +121,17 @@ return(WidgetPDial::handle(event));} {} } } -class Panellistitem {open : {public Fl_Group} +class Panellistitem {open : {public Fl_Osc_Group} } { Function {make_window()} {open private } { Fl_Window panellistitem {open - private xywh {632 721 100 260} type Double box NO_BOX + private xywh {635 721 100 260} type Double box NO_BOX class Fl_Group visible } { Fl_Group panellistitemgroup {open private xywh {0 20 70 240} box UP_FRAME - code0 {if (master->part[npart]->Penabled==0) o->deactivate();} + code0 {/*if (master->part[npart]->Penabled==0) o->deactivate();*/} code1 {set_module_parameters( o );} } { Fl_Group {} {open @@ -153,15 +153,14 @@ bankui->show();} xywh {5 27 60 30} box THIN_DOWN_BOX down_box FLAT_BOX labelfont 1 labelsize 10 align 208 } Fl_Slider partvolume { - callback {master->part[npart]->setPvolume((int) o->value());} xywh {10 65 30 110} type {Vert Knob} box NO_BOX minimum 127 maximum 0 step 1 value 127 - code0 {o->value(master->part[npart]->Pvolume);} + code0 {o->init("Pvolume", 'c');} + class Fl_Osc_Slider } Fl_Dial partpanning { - callback {master->part[npart]->setPpanning((int) o->value());} xywh {20 180 30 30} maximum 127 step 1 - code0 {o->value(master->part[npart]->Ppanning);} - class WidgetPDial + code0 {o->init("Ppanning");} + class Fl_Osc_Dial } Fl_Button {} { label edit @@ -172,18 +171,15 @@ bankui->show();} xywh {15 235 40 20} labelsize 10 } Fl_Choice partrcv { - callback {master->part[npart]->Prcvchn=(int) o->value();} tooltip {receive from Midi channel} xywh {10 213 50 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10 code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Ch%d",i+1);if (i!=9) o->add(nrstr); else o->add("Dr10");};} - code1 {o->value(master->part[npart]->Prcvchn);} + code1 {o->init("Prcvchn");} + class Fl_Osc_Choice } {} } Fl_Check_Button partenabled { label 01 - callback {pthread_mutex_lock(&master->mutex); - master->partonoff(npart,(int) o->value()); -pthread_mutex_unlock(&master->mutex); - + callback {o->oscWrite("partonoff", o->value() ? "T" : "F"); if ((int) o->value()==0) panellistitemgroup->deactivate(); else { panellistitemgroup->activate(); @@ -196,34 +192,26 @@ if ((int) o->value()==0) panellistitemgroup->deactivate(); o->redraw();} private xywh {5 0 45 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 24 code0 {char tmp[10];snprintf(tmp,10,"%d",npart+1);o->copy_label(tmp);} - code1 {o->value(master->part[npart]->Penabled);} + code1 {o->init("Penabled");} + class Fl_Osc_Check } } } - Function {Panellistitem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} { + Function {Panellistitem(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {} { code {npart=0; -master=NULL; bankui=NULL;} {} } - Function {init(Master *master_, int npart_,BankUI *bankui_)} {} { + Function {init(int npart_,BankUI *bankui_)} {} { code {npart=npart_; -master=master_; bankui=bankui_; +ext = "part"+to_s(npart)+"/"; make_window(); panellistitem->show(); end();} {} } Function {refresh()} {} { - code {partenabled->value(master->part[npart]->Penabled); -if (master->part[npart]->Penabled!=0) panellistitemgroup->activate(); - else panellistitemgroup->deactivate(); - -partvolume->value(master->part[npart]->Pvolume); -partpanning->value(master->part[npart]->Ppanning); -partrcv->value(master->part[npart]->Prcvchn); - -partname->label((char *)master->part[npart]->Pname); + code {partname->label("NAME TODO"); if ((int)bankui->cbwig->value()!=(npart+1)) panellistitemgroup->color(fl_rgb_color(160,160,160)); @@ -233,13 +221,10 @@ else panellistitemgroup->redraw();} {} } Function {~Panellistitem()} {} { - code {panellistitem->hide(); -//delete(panellistitem);} {} + code {} {} } decl {int npart;} {private local } - decl {Master *master;} {private local - } decl {BankUI *bankui;} {private local } } @@ -264,7 +249,7 @@ if (( *exitprogram=1; }; \#endif} open - xywh {327 342 390 525} type Double xclass zynaddsubfx visible + xywh {330 365 390 525} type Double xclass zynaddsubfx visible } { Fl_Group win_root {open xywh {0 0 390 525} @@ -511,6 +496,7 @@ if (result!=0) fl_alert("Error: Could not save the file.");} } } Fl_Box dummy { + xywh {25 25 25 25} code0 {win_root->osc = osc;} code1 {win_root->base = "/";} } @@ -522,20 +508,19 @@ if (result!=0) fl_alert("Error: Could not save the file.");} } Fl_Counter masterkeyshiftcounter { label {Master KeyShift} - callback {master->setPkeyshift((int) o->value()+64);} xywh {155 102 120 23} type Simple labelsize 9 minimum -64 maximum 64 step 1 code0 {o->lstep(12);} - code1 {o->value(master->Pkeyshift-64);} + code1 {o->init("Pkeyshift");} + class Fl_Osc_Counter } Fl_Button {} { label {Panic!} callback {virkeyboard->relaseallkeys(); -pthread_mutex_lock(&master->mutex); -master->shutup=1; -pthread_mutex_unlock(&master->mutex);} + o->oscWrite("Panic");} xywh {285 34 105 53} color 90 labelfont 1 + class Fl_Osc_Button } - Fl_Group partuigroup { + Fl_Group partuigroup {open xywh {5 315 390 205} } { Fl_Group partui {open @@ -623,14 +608,14 @@ syseffectui->refresh(master->sysefx[nsyseff]);} } Fl_Button {} { label C - callback {presetsui->copy(master->sysefx[nsyseff]);} + callback {/*presetsui->copy(master->sysefx[nsyseff]);*/} xywh {185 192 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 } Fl_Button {} { label P - callback {pthread_mutex_lock(&master->mutex); + callback {/*pthread_mutex_lock(&master->mutex); presetsui->paste(master->sysefx[nsyseff],syseffectui); -pthread_mutex_unlock(&master->mutex);} +pthread_mutex_unlock(&master->mutex);*/} xywh {215 192 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 } } @@ -736,14 +721,14 @@ master->insefx[ninseff]->cleanup();} open } {} Fl_Button {} { label C - callback {presetsui->copy(master->insefx[ninseff]);} + callback {/*presetsui->copy(master->insefx[ninseff]);*/} xywh {185 190 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 } Fl_Button {} { label P - callback {pthread_mutex_lock(&master->mutex); + callback {/*pthread_mutex_lock(&master->mutex); presetsui->paste(master->insefx[ninseff],inseffectui); -pthread_mutex_unlock(&master->mutex);} +pthread_mutex_unlock(&master->mutex);*/} xywh {215 190 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 } } @@ -806,13 +791,13 @@ mastermenu->redraw();} } Fl_Check_Button nrpnbutton { label NRPN - callback {master->ctl.NRPN.receive=(int) o->value();} tooltip {Receive NRPNs} xywh {15 120 60 25} down_box DOWN_BOX labelsize 12 - code0 {o->value(master->ctl.NRPN.receive);} + code0 {o->init("ctl.NRPN.receive");} + class Fl_Osc_Check } Fl_Counter npartcounter { callback {int nval=(int) o->value()-1; -partuigroup->remove(partui); +/*partuigroup->remove(partui); delete partui; partui=new PartUI(0,0,765,525); partuigroup->add(partui); @@ -821,11 +806,13 @@ snprintf(buffer, 1024, "/part%d/", nval); partui->init(master->part[nval], buffer, master, nval, bankui, "/part"+to_s(nval)+"/", osc); partui->redraw(); o->redraw(); +*/ npart=nval; +partui->rebase("/part"+to_s(npart)+"/"); updatepanel(); simplenpartcounter->value(nval+1); -simplenpartcounter->do_callback();} +simplenpartcounter->do_callback();} selected tooltip {The part number} xywh {10 317 50 18} type Simple labelfont 1 minimum 0 maximum 127 step 1 value 1 textfont 1 code0 {o->bounds(1,NUM_MIDI_PARTS);} code1 {bankui->init(o);} @@ -846,10 +833,9 @@ globalfinedetuneslider->do_callback();} } Fl_Dial globalfinedetuneslider { label {Fine Detune} - callback {master->microtonal.Pglobalfinedetune=(int) o->value();} tooltip {global fine detune} xywh {95 73 45 45} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1 value 64 - code0 {o->value(master->microtonal.Pglobalfinedetune);} - class WidgetPDial + code0 {o->init("microtonal.Pglobalfinedetune");} + class Fl_Osc_Dial } } Fl_Button {} { @@ -912,14 +898,20 @@ GNU General Public License for details.} } Fl_Window panelwindow { label {ZynAddSubFX Panel} open - xywh {615 207 630 635} type Double visible + xywh {618 230 630 635} type Double + class Fl_Osc_Window visible } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {panelwindow->osc = osc;} + code1 {panelwindow->base = "/";} + } Fl_Scroll {} {open xywh {0 5 570 310} type HORIZONTAL box THIN_UP_BOX } { Fl_Pack {} {open xywh {5 10 560 285} type HORIZONTAL - code0 {for (int i=0;i<NUM_MIDI_PARTS/2;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(master,i,bankui);}} + code0 {for (int i=0;i<NUM_MIDI_PARTS/2;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(i,bankui);}} } {} } Fl_Scroll {} {open @@ -927,7 +919,7 @@ GNU General Public License for details.} } { Fl_Pack {} {open xywh {5 325 560 285} type HORIZONTAL - code0 {for (int i=NUM_MIDI_PARTS/2;i<NUM_MIDI_PARTS;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(master,i,bankui);}} + code0 {for (int i=NUM_MIDI_PARTS/2;i<NUM_MIDI_PARTS;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(i,bankui);}} } {} } Fl_Button {} { @@ -952,8 +944,14 @@ if (fl_choice("Exit and leave the unsaved data?","No","Yes",NULL)) { *exitprogram=1; }; \#endif} - xywh {658 361 600 335} type Double visible + xywh {661 384 600 335} type Double + class Fl_Osc_Window visible } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {simplemasterwindow->osc = osc;} + code1 {simplemasterwindow->base = "/make/it/stop/";} + } Fl_Menu_Bar simplemastermenu { xywh {0 0 690 25} } { @@ -1402,10 +1400,9 @@ pthread_mutex_unlock(&master->mutex);} Fl_Button {} { label {Stop ALL sounds!} callback {virkeyboard->relaseallkeys(); -pthread_mutex_lock(&master->mutex); -master->shutup=1; -pthread_mutex_unlock(&master->mutex);} + o->oscWrite("Panic");} xywh {5 149 115 31} color 90 labelfont 1 labelsize 10 + class Fl_Osc_Button } Fl_Button {} { label Reset @@ -1415,10 +1412,9 @@ simpleglobalfinedetuneslider->do_callback();} } Fl_Dial simpleglobalfinedetuneslider { label {Fine Detune} - callback {master->microtonal.Pglobalfinedetune=(int) o->value();} tooltip {global fine detune} xywh {80 50 30 30} box ROUND_UP_BOX labelsize 11 align 130 maximum 127 step 1 value 64 - code0 {o->value(master->microtonal.Pglobalfinedetune);} - class WidgetPDial + code0 {o->init("microtonal.Pglobalfinedetune");} + class Fl_Osc_Dial } Fl_Counter simplenpartcounter { label Part @@ -1524,8 +1520,7 @@ make_window(); presetsui=new PresetsUI(); setfilelabel(NULL); swapefftype=0; -simplerefresh();} {selected - } +simplerefresh();} {} } Function {~MasterUI()} {} { code {masterwindow->hide(); diff --git a/src/UI/PartUI.fl b/src/UI/PartUI.fl @@ -20,7 +20,10 @@ decl {\#include <string.h>} {public local decl {\#include <string>} {public local } -decl {\#include "WidgetPDial.h"} {public local +decl {\#include "Fl_Osc_Dial.H"} {public local +} + +decl {\#include "Fl_Osc_Input.H"} {public local } decl {\#include "EffUI.h"} {public local @@ -91,22 +94,26 @@ end();} {} } } -class PartKitItem {open : {public Fl_Group} +class PartKitItem {open : {public Fl_Osc_Group} } { Function {make_window()} {open private } { Fl_Window partkititem { private xywh {482 475 670 100} type Double box NO_BOX - class Fl_Group visible + class Fl_Osc_Group visible } { Fl_Group partkititemgroup { private xywh {55 0 605 20} - code0 {if (part->kit[n].Penabled==0) o->deactivate();} + class Fl_Osc_Group } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {partkititemgroup->ext = "kit"+to_s(n)+"/";} + } Fl_Counter minkcounter { - callback {part->kit[n].Pminkey=(int)o->value();} xywh {225 0 55 15} type Simple minimum 0 maximum 128 step 1 - code0 {o->value(part->kit[n].Pminkey);} + code0 {o->init("Pminkey");} + class Fl_Osc_Counter } Fl_Button {} { label m @@ -134,25 +141,23 @@ maxkcounter->do_callback();} label edit callback {partui->showparameters(n,0);} xywh {420 0 40 15} box THIN_UP_BOX labelsize 11 - code0 {if (part->kit[n].Padenabled==0) o->deactivate();} code1 {if (n==0) o->hide();} } Fl_Button subeditbutton { label edit callback {partui->showparameters(n,1);} xywh {490 0 40 15} box THIN_UP_BOX labelsize 11 - code0 {if (part->kit[n].Psubenabled==0) o->deactivate();} code1 {if (n==0) o->hide();} } Fl_Check_Button mutedcheck { - callback {part->kit[n].Pmuted=(int)o->value();} private xywh {60 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4 - code0 {o->value(part->kit[n].Pmuted);} + code0 {o->init("Pmuted");} + class Fl_Osc_Check } Fl_Counter maxkcounter { - callback {part->kit[n].Pmaxkey=(int)o->value();} xywh {335 0 55 15} type Simple minimum 0 maximum 128 step 1 - code0 {o->value(part->kit[n].Pmaxkey);} + code0 {o->init("Pmaxkey");} + class Fl_Osc_Counter } Fl_Button labelbutton { label {Bass Drum} @@ -162,20 +167,20 @@ if (tmp!=NULL) snprintf((char *)part->kit[n].Pname,PART_MAX_NAME_LEN,"%s",tmp);} code0 {o->label((char *)part->kit[n].Pname);} } Fl_Check_Button adcheck { - callback {part->kit[n].Padenabled=(int)o->value(); -if (part->kit[n].Padenabled!=0) adeditbutton->activate(); + callback {if (o->value()!=0) adeditbutton->activate(); else adeditbutton->deactivate();} private xywh {400 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4 - code0 {o->value(part->kit[n].Padenabled);} + code0 {o->init("Padenabled");} code1 {if (n==0) o->hide();} + class Fl_Osc_Check } Fl_Check_Button subcheck { - callback {part->kit[n].Psubenabled=(int)o->value(); -if (part->kit[n].Psubenabled!=0) subeditbutton->activate(); + callback {if(o->value()!=0) subeditbutton->activate(); else subeditbutton->deactivate();} private xywh {470 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4 - code0 {o->value(part->kit[n].Psubenabled);} + code0 {o->init("Psubenabled");} code1 {if (n==0) o->hide();} + class Fl_Osc_Check } Fl_Choice sendtoeffect { callback {if (o->value()!=0) part->kit[n].Psendtoparteffect=(int)o->value()-1; @@ -188,16 +193,15 @@ if (part->kit[n].Psubenabled!=0) subeditbutton->activate(); label edit callback {partui->showparameters(n,2);} xywh {560 0 40 15} box THIN_UP_BOX labelsize 11 - code0 {if (part->kit[n].Ppadenabled==0) o->deactivate();} code1 {if (n==0) o->hide();} } Fl_Check_Button padcheck { - callback {part->kit[n].Ppadenabled=(int)o->value(); -if (part->kit[n].Ppadenabled!=0) padeditbutton->activate(); + callback {if (o->value()!=0) padeditbutton->activate(); else padeditbutton->deactivate();} private xywh {540 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4 - code0 {o->value(part->kit[n].Ppadenabled);} + code0 {o->init("Ppadenabled");} code1 {if (n==0) o->hide();} + class Fl_Osc_Check } } Fl_Check_Button enabledcheck { @@ -216,12 +220,13 @@ partui->showparameters(n,-1);//use to delete the ui, if it is not to item 0 } else o->value(1);} private xywh {30 0 20 15} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 4 code0 {snprintf(label,10,"%d",n+1);o->label(label);} - code1 {o->value(part->kit[n].Penabled);} + code1 {o->init("Penabled");} code2 {if (n==0) o->deactivate();} + class Fl_Osc_Check } } } - Function {PartKitItem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} { + Function {PartKitItem(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {} { code {n=0; part=NULL;} {} } @@ -230,15 +235,7 @@ part=NULL;} {} if (part->kit[n].Penabled==0) partkititemgroup->deactivate(); else partkititemgroup->activate(); -mutedcheck->value(part->kit[n].Pmuted); labelbutton->label((char *)part->kit[n].Pname); -minkcounter->value(part->kit[n].Pminkey); -maxkcounter->value(part->kit[n].Pmaxkey); -adcheck->value(part->kit[n].Padenabled); -adcheck->do_callback(); -subcheck->value(part->kit[n].Psubenabled); -subcheck->do_callback(); - sendtoeffect->value(part->kit[n].Psendtoparteffect+1); if (part->kit[n].Psendtoparteffect==127) sendtoeffect->value(0); @@ -267,8 +264,7 @@ make_window(); end();} {} } Function {~PartKitItem()} {} { - code {partkititem->hide(); -//delete(partkititem);} {} + code {} {} } decl {Part *part;} {private local } @@ -282,7 +278,7 @@ end();} {} } } -class PartUI {open : {public Fl_Group} +class PartUI {open : {public Fl_Osc_Group} } { Function {make_window()} {open private } { @@ -292,21 +288,19 @@ class PartUI {open : {public Fl_Group} } { Fl_Group partgroupui {open xywh {0 0 385 180} - code0 {if (part->Penabled==0) o->deactivate();} } { Fl_Dial {} { label Pan - callback {part->setPpanning((int) o->value());} xywh {50 40 25 25} box ROUND_UP_BOX labelsize 11 maximum 127 step 1 - code0 {o->value(part->Ppanning);} - class WidgetPDial + code0 {o->init("Ppanning");} + class Fl_Osc_Dial } Fl_Counter {} { label KeyShift - callback {part->Pkeyshift=(int) o->value()+64;} xywh {195 45 90 20} labelsize 11 align 1 minimum -64 maximum 64 step 1 code0 {o->lstep(12);} - code1 {o->value(part->Pkeyshift-64);} + code1 {o->init("Pkeyshift");} + class Fl_Osc_Counter } Fl_Scroll {} {open xywh {166 91 125 49} box UP_BOX labelfont 1 labelsize 10 align 21 @@ -336,47 +330,45 @@ if (event==FL_RIGHT_MOUSE){ } Fl_Check_Button {} { label NoteOn - callback {part->Pnoteon=(int) o->value();} tooltip {set if the part receives NoteOn messages} xywh {10 155 65 20} down_box DOWN_BOX labelfont 1 labelsize 11 - code0 {o->value(part->Pnoteon);} + code0 {o->init("Pnoteon");} + class Fl_Osc_Check } Fl_Counter minkcounter { label {Min.k} - callback {part->Pminkey=(int) o->value(); -if (part->Pminkey>part->Pmaxkey) o->textcolor(FL_RED); + callback {if (minkcounter->value() > maxkcounter->value()) o->textcolor(FL_RED); else o->textcolor(FL_BLACK);} tooltip {Minimum key (that the part receives NoteOn messages)} xywh {295 125 40 15} type Simple labelfont 1 labelsize 10 minimum 0 maximum 127 step 1 textsize 10 - code0 {o->value(part->Pminkey);} + code0 {o->init("Pminkey");} + class Fl_Osc_Counter } Fl_Counter maxkcounter { label {Max.k} - callback {part->Pmaxkey=(int) o->value(); + callback { -if (part->Pminkey>part->Pmaxkey) o->textcolor(FL_RED); +if (minkcounter->value() > maxkcounter->value()) o->textcolor(FL_RED); else o->textcolor(FL_BLACK);} tooltip {Maximum key (that the part receives NoteOn messages)} xywh {340 125 40 15} type Simple labelfont 1 labelsize 10 minimum 0 maximum 127 step 1 textsize 10 - code0 {o->value(part->Pmaxkey);} + code0 {o->init("Pmaxkey");} + class Fl_Osc_Counter } Fl_Dial {} { label Volume - callback {part->setPvolume((int) o->value());} tooltip {Part Volume} xywh {10 35 30 30} box ROUND_UP_BOX labelsize 11 maximum 127 step 1 - code0 {o->value(part->Pvolume);} - class WidgetPDial + code0 {o->init("Pvolume");} + class Fl_Osc_Dial } Fl_Dial {} { label {Vel.Ofs.} - callback {part->Pveloffs=(int) o->value();} tooltip {Velocity Offset} xywh {135 40 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->value(part->Pveloffs);} - class WidgetPDial + code0 {o->init("Pveloffs");} + class Fl_Osc_Dial } Fl_Dial {} { label {Vel.Sns.} - callback {part->Pvelsns=(int) o->value();} tooltip {Velocity Sensing Function} xywh {95 40 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->value(part->Pvelsns);} - class WidgetPDial + code0 {o->init("Pvelsns");} + class Fl_Osc_Dial } Fl_Button {} { label Controllers @@ -385,9 +377,9 @@ if (part->Pminkey>part->Pmaxkey) o->textcolor(FL_RED); } Fl_Check_Button {} { label Portamento - callback {part->ctl.portamento.portamento=(int) o->value();} tooltip {Enable/Disable the portamento} xywh {95 155 88 20} down_box DOWN_BOX labelfont 1 labelsize 11 - code0 {o->value(part->ctl.portamento.portamento);} + code0 {o->init("portamento.portamento");} + class Fl_Osc_Check } Fl_Button {} { label {Edit instrument} @@ -396,32 +388,36 @@ if (part->Pminkey>part->Pmaxkey) o->textcolor(FL_RED); } Fl_Button {} { label m - callback {if (part->lastnote>=0) minkcounter->value(part->lastnote); -minkcounter->do_callback(); -maxkcounter->do_callback();} + callback { + o->oscWrite("captureMin"); + o->oscWrite("Pminkey"); + o->oscWrite("Pmaxkey");} tooltip {set the minimum key to the last pressed key} xywh {315 155 15 12} box THIN_UP_BOX labelsize 10 + class Fl_Osc_Button } Fl_Button {} { label M - callback {if (part->lastnote>=0) maxkcounter->value(part->lastnote); -maxkcounter->do_callback(); -minkcounter->do_callback();} + callback { + o->oscWrite("captureMax"); + o->oscWrite("Pminkey"); + o->oscWrite("Pmaxkey");} tooltip {set the maximum key to the last pressed key} xywh {345 155 15 12} box THIN_UP_BOX labelsize 10 + class Fl_Osc_Button } Fl_Button {} { label R - callback {minkcounter->value(0); -minkcounter->do_callback(); -maxkcounter->value(127); -maxkcounter->do_callback();} + callback { + o->oscWrite("Pminkey", "c", 0); + o->oscWrite("Pmaxkey", "c", 127);} tooltip {reset the minimum key to 0 and maximum key to 127} xywh {330 155 15 12} box THIN_UP_BOX labelfont 1 labelsize 10 + class Fl_Osc_Button } Fl_Choice {} { label {MIDI Chn.Rcv.} - callback {part->Prcvchn=(int) o->value();} open tooltip {receive from Midi channel} xywh {310 45 70 20} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10 code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Chn%d",i+1);if (i!=9) o->add(nrstr); else o->add("Drms10");};} - code1 {o->value(part->Prcvchn);} + code1 {o->init("Prcvchn");} + class Fl_Osc_Choice } {} Fl_Choice keylimitlist { label KLmt @@ -466,66 +462,67 @@ if (part->Penabled==0) partgroupui->deactivate(); Fl_Window ctlwindow { label Controllers open private xywh {777 330 500 130} type Double box NO_BOX visible + class Fl_Osc_Window } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {ctlwindow->osc = osc;} + code1 {ctlwindow->base = "/part"+to_s(npart)+"/ctl/";} + } Fl_Check_Button {} { label Expr - callback {part->ctl.expression.receive=(int) o->value();} tooltip {Expression enable} xywh {155 55 45 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10 - code0 {o->value(part->ctl.expression.receive);} + code0 {o->init("expression.receive");} + class Fl_Osc_Check } Fl_Dial {} { label PanDpth - callback {part->ctl.panning.depth=(int) o->value();} tooltip {Panning Depth} xywh {10 55 30 30} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.panning.depth);} - class WidgetPDial + code0 {o->init("panning.depth");} + class Fl_Osc_Dial } Fl_Dial {} { label FltCut - callback {part->ctl.filtercutoff.depth=(int) o->value();} tooltip {Filter Cutoff depth} xywh {90 55 30 30} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.filtercutoff.depth);} - class WidgetPDial + code0 {o->init("filtercutoff.depth");} + class Fl_Osc_Dial } Fl_Dial {} { label FltQ - callback {part->ctl.filterq.depth=(int) o->value();} tooltip {Filter Q depth} xywh {50 55 30 30} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.filterq.depth);} - class WidgetPDial + code0 {o->init("filterq.depth");} + class Fl_Osc_Dial } Fl_Dial {} { label BwDpth - callback {part->ctl.bandwidth.depth=(int) o->value();} tooltip {BandWidth depth} xywh {125 10 30 30} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.bandwidth.depth);} - class WidgetPDial + code0 {o->init("bandwidth.depth");} + class Fl_Osc_Dial } Fl_Dial {} { label ModWh - callback {part->ctl.modwheel.depth=(int) o->value();} tooltip {Modulation Wheel depth} xywh {50 10 30 30} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.modwheel.depth);} - class WidgetPDial + code0 {o->init("modwheel.depth");} + class Fl_Osc_Dial } Fl_Counter {} { label {PWheelB.Rng (cents)} - callback {part->ctl.pitchwheel.bendrange=(int) o->value();} tooltip {Pitch Wheel Bend Range (cents)} xywh {165 15 110 20} labelsize 10 align 1 minimum -6400 maximum 6400 step 1 - code0 {o->value(part->ctl.pitchwheel.bendrange);} + code0 {o->init("pitchwheel.bendrange");} code1 {o->lstep(100);} + class Fl_Osc_Counter } Fl_Check_Button {} { label FMamp - callback {part->ctl.fmamp.receive=(int) o->value();} tooltip {FM amplitude enable} xywh {205 55 60 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10 - code0 {o->value(part->ctl.fmamp.receive);} + code0 {o->init("fmamp.receive");} + class Fl_Osc_Check } Fl_Check_Button {} { label Vol - callback {part->ctl.volume.receive=(int) o->value();} tooltip {Volume enable} xywh {155 80 45 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10 - code0 {o->value(part->ctl.volume.receive);} + code0 {o->init("volume.receive");} + class Fl_Osc_Check } Fl_Check_Button {} { label Sustain @@ -544,8 +541,9 @@ if (part->ctl.sustain.receive==0) { } Fl_Button {} { label {Reset all controllers} - callback {part->SetController(C_resetallcontrollers,0);} + callback {o->oscWrite("resetControllers");//part->SetController(C_resetallcontrollers,0);} xywh {5 107 210 20} box THIN_UP_BOX + class Fl_Osc_Button } Fl_Group {} { label Portamento @@ -553,28 +551,27 @@ if (part->ctl.sustain.receive==0) { } { Fl_Check_Button {} { label Rcv - callback {part->ctl.portamento.receive=(int) o->value();} tooltip {Receive Portamento Controllers} xywh {285 20 40 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10 - code0 {o->value(part->ctl.portamento.receive);} + code0 {o->init("portamento.receive");} + class Fl_Osc_Check } Fl_Dial {} { label time - callback {part->ctl.portamento.time=(int) o->value();} tooltip {Portamento time} xywh {285 60 25 25} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.portamento.time);} - class WidgetPDial + code0 {o->init("portamento.time");} + class Fl_Osc_Dial } Fl_Counter {} { label thresh - callback {part->ctl.portamento.pitchthresh=(int) o->value();} tooltip {Minimum or max. difference of the notes in order to do the portamento (x 100 cents)} xywh {340 20 50 20} type Simple labelsize 10 minimum 0 maximum 127 step 1 - code0 {o->value(part->ctl.portamento.pitchthresh);} + code0 {o->init("portamento.pitchthresh");} + class Fl_Osc_Dial } Fl_Check_Button {} { label {th.type} - callback {part->ctl.portamento.pitchthreshtype=(int) o->value();} tooltip {Threshold type (min/max)} xywh {365 70 15 15} down_box DOWN_BOX labelsize 10 align 2 - code0 {o->value(part->ctl.portamento.pitchthreshtype);} + code0 {o->init("portamento.pitchthreshtype");} + class Fl_Osc_Check } Fl_Box {} { label {x100 cnt.} @@ -582,26 +579,21 @@ if (part->ctl.sustain.receive==0) { } Fl_Dial {} { label {t.dn/up} - callback {int x=(int) o->value(); - -part->ctl.portamento.updowntimestretch=x;} tooltip {Portamento time stretch (up/down)} xywh {315 60 25 25} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.portamento.updowntimestretch);} - class WidgetPDial + code0 {o->init("portamento.updowntimestretch");} + class Fl_Osc_Dial } Fl_Dial propta { label {Prp.Rate} - callback {part->ctl.portamento.propRate=(int) o->value();} tooltip {Distance required to double change from nonpropotinal portamento time} xywh {405 20 25 25} labelsize 9 maximum 127 step 1 - code0 {o->value(part->ctl.portamento.propRate);} - class WidgetPDial + code0 {o->init("portamento.propRate");} + class Fl_Osc_Dial } Fl_Dial proptb { label {Prp.Dpth} - callback {part->ctl.portamento.propDepth=(int) o->value();} tooltip {The difference from nonproportinal portamento} xywh {405 60 25 25} labelsize 9 maximum 127 step 1 - code0 {o->value(part->ctl.portamento.propDepth);} - class WidgetPDial + code0 {o->init("portamento.propDepth");} + class Fl_Osc_Dial } Fl_Check_Button {} { label {Proprt.} @@ -620,36 +612,40 @@ else {propta->deactivate();proptb->deactivate();}} } { Fl_Dial {} { label BWdpth - callback {part->ctl.resonancebandwidth.depth=(int) o->value();} tooltip {BandWidth controller depth} xywh {455 60 25 25} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.resonancebandwidth.depth);} - class WidgetPDial + code0 {o->init("resonancebandwidth.depth");} + class Fl_Osc_Dial } Fl_Dial {} { label CFdpth - callback {part->ctl.resonancecenter.depth=(int) o->value();} tooltip {Center Frequency controller Depth} xywh {455 20 25 25} labelsize 10 maximum 127 step 1 - code0 {o->value(part->ctl.resonancecenter.depth);} - class WidgetPDial + code0 {o->init("resonancecenter.depth");} + class Fl_Osc_Dial } } Fl_Check_Button {} { label {Exp MWh} - callback {part->ctl.modwheel.exponential=(int) o->value();} tooltip {Exponential modulation wheel} xywh {10 15 40 25} down_box DOWN_BOX labelsize 10 align 148 - code0 {o->value(part->ctl.modwheel.exponential);} + code0 {o->init("modwheel.exponential");} + class Fl_Osc_Check } Fl_Check_Button {} { label {Exp BW} - callback {part->ctl.bandwidth.exponential=(int) o->value();} tooltip {Exponential BandWidth Controller} xywh {85 15 35 25} down_box DOWN_BOX labelsize 10 align 148 - code0 {o->value(part->ctl.bandwidth.exponential);} + code0 {o->init("bandwidth.exponential");} + class Fl_Osc_Check } } Fl_Window partfx { label {Part's Insert Effects} private xywh {563 729 390 145} type Double box NO_BOX visible + class Fl_Osc_Window } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {partfx->osc = osc;} + code1 {partfx->base = part_path;} + } Fl_Counter inseffnocounter { label {FX No.} callback {ninseff=(int) o->value()-1; @@ -716,8 +712,7 @@ inseffectui->refresh(part->partefx[ninseff]);} } { Fl_Group inseffectui { xywh {5 5 380 95} - code0 {o->init(part->partefx[ninseff], - osc, loc + "InsEffect/");} + code0 {o->init(part->partefx[ninseff], osc, loc + "InsEffect/");} class EffUI } {} } @@ -751,27 +746,31 @@ if (x==2) part->partefx[ninseff]->setdryonly(true); } Fl_Check_Button bypasseff { label bypass - callback {part->Pefxbypass[ninseff]=(((int)o->value())!=0);} tooltip {if the effect is not used (is bypassed)} xywh {90 110 60 15} down_box DOWN_BOX labelsize 11 - code0 {int x=part->Pefxbypass[ninseff];o->value(x);} + code0 {o->init("Pefxbypass"+to_s(ninseff));} + class Fl_Osc_Check } Fl_Button {} { label C - callback {presetsui->copy(part->partefx[ninseff]);} + callback {/*presetsui->copy(part->partefx[ninseff]);*/} xywh {90 127 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 } Fl_Button {} { label P - callback {pthread_mutex_lock(&master->mutex); -presetsui->paste(part->partefx[ninseff],inseffectui); -pthread_mutex_unlock(&master->mutex);} + callback {/*presetsui->paste(part->partefx[ninseff],inseffectui);*/} xywh {120 127 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 } } Fl_Window instrumentkitlist { label {Instrument Kit} open xywh {595 611 670 370} type Double box NO_BOX visible + class Fl_Osc_Window } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {instrumentkitlist->osc = osc;} + code1 {instrumentkitlist->base = "/part"+to_s(npart)+"/";} + } Fl_Button {} { label {Close Window} callback {instrumentkitlist->hide();} @@ -779,7 +778,6 @@ pthread_mutex_unlock(&master->mutex);} } Fl_Scroll kitlist {open xywh {0 15 670 330} type VERTICAL box UP_FRAME - code0 {if (part->Pkitmode==0) o->deactivate();} } { Fl_Pack {} { xywh {0 20 670 320} @@ -812,14 +810,10 @@ pthread_mutex_unlock(&master->mutex);} } Fl_Choice {} { label Mode - callback {part->Pkitmode=(int) o->value(); -if (part->Pkitmode==0) { - kitlist->deactivate(); - } else { - kitlist->activate(); -};} + callback {if (o->value()==0) { kitlist->deactivate(); } else { kitlist->activate(); };} xywh {35 350 70 15} down_box BORDER_BOX labelsize 11 textfont 1 textsize 11 - code0 {o->value(part->Pkitmode);} + code0 {o->init("Pkitmode");} + class Fl_Osc_Choice } { MenuItem {} { label OFF @@ -836,9 +830,9 @@ if (part->Pkitmode==0) { } Fl_Check_Button {} { label {Drum mode} - callback {part->Pdrummode=(int) o->value();} xywh {285 350 70 15} down_box DOWN_BOX labelsize 10 - code0 {o->value(part->Pdrummode);} + code0 {o->init("Pdrummode");} + class Fl_Osc_Check } Fl_Box {} { label {FX.r.} @@ -852,7 +846,13 @@ if (part->Pkitmode==0) { Fl_Window instrumenteditwindow { label {Instrument Edit} open xywh {256 621 395 360} type Double box NO_BOX visible + class Fl_Osc_Window } { + Fl_Box {} { + xywh {0 0 0 0} + code0 {instrumenteditwindow->osc = osc;} + code1 {instrumenteditwindow->base = "/part"+to_s(npart)+"/kit0/";} + } Fl_Group {} { xywh {0 220 395 110} box UP_FRAME } { @@ -864,16 +864,14 @@ if (part->Pkitmode==0) { label Edit callback {showparameters(0,2);} xywh {215 280 80 35} color 51 selection_color 51 labelfont 1 labelsize 13 align 128 - code0 {if (part->kit[0].Ppadenabled==0) o->deactivate();} } Fl_Check_Button padsynenabledcheck { label Enabled - callback {int x=(int) o->value(); -part->kit[0].Ppadenabled=x; -if (x==0) padeditbutton->deactivate(); + callback {if (o->value()==0) padeditbutton->deactivate(); else padeditbutton->activate();} tooltip {enable/disable PADsynth} xywh {215 255 80 20} box UP_BOX down_box DOWN_BOX color 51 selection_color 51 labelfont 1 labelsize 11 - code1 {o->value(part->kit[0].Ppadenabled);} + code1 {o->init("Ppadenabled");} + class Fl_Osc_Check } } Fl_Group {} { @@ -882,18 +880,16 @@ if (x==0) padeditbutton->deactivate(); } { Fl_Check_Button adsynenabledcheck { label Enabled - callback {int x=(int) o->value(); -part->kit[0].Padenabled=x; -if (x==0) adeditbutton->deactivate(); + callback { if (o->value()==0) adeditbutton->deactivate(); else adeditbutton->activate();} tooltip {enable/disable ADsynth} xywh {15 255 80 20} box UP_BOX down_box DOWN_BOX color 51 selection_color 51 labelfont 1 labelsize 11 - code1 {o->value(part->kit[0].Padenabled);} + code1 {o->init("Padenabled");} + class Fl_Osc_Check } Fl_Button adeditbutton { label Edit callback {showparameters(0,0);} xywh {15 281 80 34} color 51 selection_color 51 labelfont 1 labelsize 13 align 128 - code0 {if (part->kit[0].Padenabled==0) o->deactivate();} } } Fl_Group {} { @@ -902,18 +898,16 @@ if (x==0) adeditbutton->deactivate(); } { Fl_Check_Button subsynenabledcheck { label Enabled - callback {int x=(int) o->value(); -part->kit[0].Psubenabled=x; -if (x==0) subeditbutton->deactivate(); + callback {if (o->value()==0) subeditbutton->deactivate(); else subeditbutton->activate();} tooltip {enable/disable SUBsynth} xywh {115 255 80 20} box UP_BOX down_box DOWN_BOX color 51 selection_color 51 labelfont 1 labelsize 11 - code1 {o->value(part->kit[0].Psubenabled);} + code1 {o->init("Psubenabled");} + class Fl_Osc_Check } Fl_Button subeditbutton { label Edit callback {showparameters(0,1);} xywh {115 280 80 35} color 51 selection_color 51 labelfont 1 labelsize 13 align 128 - code0 {if (part->kit[0].Psubenabled==0) o->deactivate();} } } Fl_Button {} { @@ -932,23 +926,23 @@ if (x==0) subeditbutton->deactivate(); } { Fl_Input {} { label {Author and Copyright} - callback {snprintf((char *)part->info.Pauthor,MAX_INFO_TEXT_SIZE,"%s",o->value());} xywh {5 60 385 50} type Multiline color 26 labelsize 10 align 5 code0 {o->maximum_size(MAX_INFO_TEXT_SIZE);} - code1 {o->value((char *) &part->info.Pauthor);} + code1 {o->init("info.Pauthor");} + class Fl_Osc_Input } Fl_Input {} { label Comments - callback {snprintf((char *)part->info.Pcomments,MAX_INFO_TEXT_SIZE,"%s",o->value());} xywh {5 125 385 90} type Multiline color 26 labelsize 11 align 5 code0 {o->maximum_size(MAX_INFO_TEXT_SIZE);} - code1 {o->value((char *) &part->info.Pcomments);} + code1 {o->init("info.Pcomments");} + class Fl_Osc_Input } Fl_Choice {} { label {Type:} - callback {part->info.Ptype=o->value();} xywh {5 25 155 20} down_box BORDER_BOX labelfont 1 labelsize 11 align 5 textsize 10 - code0 {o->value(part->info.Ptype);} + code0 {o->init("info.Ptype");} + class Fl_Osc_Choice } { MenuItem {} { label {--------------------------} @@ -1027,7 +1021,7 @@ if (x==0) subeditbutton->deactivate(); } } } - Function {PartUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {open + Function {PartUI(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {open } { code {part=NULL; adnoteui=NULL; @@ -1042,6 +1036,8 @@ assert(!loc_.empty()); bankui=bankui_; part_path = part_path_; +base = part_path; +osc = osc; part=part_; npart=npart_; master=master_;