1# data file for the Fltk User Interface Designer (fluid)
2version 1.0304
3header_name {.h}
4code_name {.cc}
5comment {PartUI.h} {not_in_source in_header
6}
7
8comment {PartUI.cc} {in_source not_in_header
9}
10
11comment {Original ZynAddSubFX author Nasca Octavian Paul
12Copyright (C) 2002-2005 Nasca Octavian Paul
13Copyright 2009-2011, Alan Calvert
14Copyright 2014-2021, Will Godfrey
15
16This file is part of yoshimi, which is free software: you can redistribute
17it and/or modify it under the terms of the GNU Library General Public
18License as published by the Free Software Foundation; either version 2 of
19the License, or (at your option) any later version.
20
21yoshimi is distributed in the hope that it will be useful, but WITHOUT ANY
22WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
23FOR A PARTICULAR PURPOSE.   See the GNU General Public License (version 2 or
24later) for more details.
25
26You should have received a copy of the GNU General Public License along with
27yoshimi; if not, write to the Free Software Foundation, Inc., 51 Franklin
28Street, Fifth Floor, Boston, MA  02110-1301, USA.
29
30This file is derivative of ZynAddSubFX original code.
31
32} {selected in_source in_header
33}
34
35decl {\#include <FL/fl_ask.H>
36    \#include <iostream>
37    \#include "Misc/Config.h"
38    \#include "Misc/SynthEngine.h"} {private global
39}
40
41decl {\#include "UI/MiscGui.h"
42    \#include "EffUI.h"
43    \#include "BankUI.h"
44    \#include "ADnoteUI.h"
45    \#include "SUBnoteUI.h"
46    \#include "PADnoteUI.h"
47    \#include "UI/WidgetMWSlider.h"
48    \#include "UI/WidgetSpinner.h"
49    \#include "UI/WidgetCheckButton.h"
50    \#include "Params/Controller.h"} {public global
51}
52
53decl {\#include "Misc/Part.h"
54    \#define MAX_INFO_TEXT_SIZE 256} {public local
55}
56
57decl {\#include "MasterUI.h"} {private global
58}
59
60decl {\#include "Misc/FormatFuncs.h"
61    using func::asString;} {private local
62}
63
64decl {\#include "Misc/TextMsgBuffer.h"
65
66    namespace { // Implementation details...
67        TextMsgBuffer& textMsgBuffer = TextMsgBuffer::instance();
68    }} {private local
69}
70
71decl {\#include "Interface/TextLists.h"} {public local
72}
73
74class PartSysEffSend {: {public Fl_Group}
75} {
76  Function {make_window()} {} {
77    Fl_Window syseffsend {
78      xywh {916 486 30 30} type Double box NO_BOX labelfont 1 hide
79      class Fl_Group
80    } {
81      Fl_Dial sysend {
82        callback {//
83        send_data(TOPLEVEL::action::forceUpdate, neff, o->value(), TOPLEVEL::type::Integer);}
84        xywh {0 0 25 25} box ROUND_UP_BOX labelsize 11 align 1 maximum 127 step 1
85        code0 {o->value(synth->Psysefxvol[neff][npart]);}
86        code1 {o->copy_label(asString(neff + 1).c_str());}
87        code2 {o->setValueType(VC_FXSysSend);}
88        class WidgetPDial
89      }
90    }
91  }
92  Function {PartSysEffSend(int x, int y, int w, int h) :
93    Fl_Group(x, y, w, h, NULL)} {} {
94    code {//
95    neff = 0;
96    npart = 0;} {}
97  }
98  Function {send_data(int action, int control, float value, int type)} {} {
99    code {//
100    type |= TOPLEVEL::type::Write;
101        collect_data(synth, value, action, type, control + PART::control::partToSystemEffect1, npart);} {}
102  }
103  Function {init(int npart_, int neff_, SynthEngine *_synth)} {} {
104    code {//
105    synth = _synth;
106    npart = npart_;
107    neff = neff_;
108    make_window();
109    syseffsend->show();
110    end();} {}
111  }
112  Function {sysRsize(float dScale)} {} {
113    code {//
114    sysend->labelsize(11 * dScale);} {}
115  }
116  Function {~PartSysEffSend()} {} {
117    code {//
118    syseffsend->hide();} {}
119  }
120  decl {int neff;} {private local
121  }
122  decl {int npart;} {private local
123  }
124  decl {SynthEngine *synth;} {private local
125  }
126}
127
128class PartUI_ {} {
129  Function {showparameters(int /* kititem */,int /* engine */)} {return_type virtual
130  } {
131    code {;} {}
132  }
133}
134
135class PartKitItem {: {public Fl_Group}
136} {
137  Function {make_window()} {} {
138    Fl_Window partkititem {
139      xywh {433 86 670 20} type Double box NO_BOX hide
140      class Fl_Group
141    } {
142      Fl_Group partkititemgroup {
143        xywh {55 4 605 20}
144        code0 {if (part->kit[n].Penabled == 0) o->deactivate();}
145      } {
146        Fl_Check_Button mutedcheck {
147          callback {//
148          send_data(0, PART::control::kitItemMute, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
149          xywh {60 4 15 15} box THIN_UP_BOX down_box DOWN_BOX color 237 labelfont 1 labelsize 11
150          code0 {o->value(part->kit[n].Pmuted);}
151          class Fl_Check_Button2
152        }
153        Fl_Button labelbutton {
154          label {Bass Drum}
155          callback {//
156          string tmp = input_text(synth, "Kit item name:", part->kit[n].Pname);
157          if (tmp != "" && tmp != part->kit[n].Pname)
158          {
159              send_data(TOPLEVEL::action::lowPrio, PART::control::instrumentName, 0, TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup, UNUSED, textMsgBuffer.push(tmp));
160              o->copy_label(tmp.c_str());
161          }}
162          xywh {90 4 130 15} box THIN_DOWN_BOX down_box FLAT_BOX color 7 labelfont 1 labelsize 10 align 20
163          code0 {o->copy_label(part->kit[n].Pname.c_str());}
164        }
165        Fl_Counter minkcounter {
166          callback {//
167          int tmp = o->value();
168          int other = maxkcounter->value();
169          if (tmp >= other)
170          {
171              tmp = other;
172              o->value(tmp);
173          }
174
175          send_data(0, PART::control::minNote, tmp, TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
176          xywh {225 4 55 15} type Simple minimum 0 maximum 128 step 1 textfont 1 textsize 12
177          code0 {o->value(part->kit[n].Pminkey);}
178        }
179        Fl_Button setmin {
180          label m
181          callback {//
182          int last = part->lastnote;
183          if (last <= 0)
184              return;
185          int tmp;
186          int other = maxkcounter->value();
187          if (last >= other)
188              tmp = other;
189          else
190              tmp = last;
191          minkcounter->value(tmp);
192
193          send_data(0, PART::control::minToLastKey, tmp, TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
194          tooltip {set the minimum key to the last pressed key} xywh {285 7 15 12} box THIN_UP_BOX labelsize 10
195        }
196        Fl_Button setmax {
197          label M
198          callback {//
199          int last = part->lastnote;
200          if (last <= 0)
201              return;
202          int tmp;
203          int other = minkcounter->value();
204          if (last <= other)
205              tmp = other;
206          else
207              tmp = last;
208          maxkcounter->value(tmp);
209
210          send_data(0, PART::control::maxToLastKey, tmp, TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
211          tooltip {set the maximum key to the last pressed key} xywh {315 7 15 12} box THIN_UP_BOX labelsize 10
212        }
213        Fl_Button setfull {
214          label R
215          callback {//
216          minkcounter->value(0);
217          maxkcounter->value(127);
218
219          send_data(0, PART::control::resetMinMaxKey, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
220          tooltip {reset the minimum key to 0 and maximum key to 127} xywh {300 7 15 12} box THIN_UP_BOX labelfont 1 labelsize 10
221        }
222        Fl_Counter maxkcounter {
223          callback {//
224          int tmp = o->value();
225          int other = minkcounter->value();
226          if (tmp <= other)
227          {
228              tmp = other;
229              o->value(tmp);
230          }
231          send_data(0, PART::control::maxNote, tmp, TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
232          xywh {335 4 55 15} type Simple minimum 0 maximum 128 step 1 textfont 1 textsize 12
233          code0 {o->value(part->kit[n].Pmaxkey);}
234        }
235        Fl_Button adeditbutton {
236          label edit
237          callback {//
238          partui->showparameters(n,0);
239          if ((Fl::event_button() == 3))
240              synth->getGuiMaster()->partui->instrumentkitlist->hide();}
241          xywh {420 4 40 15} box THIN_UP_BOX labelsize 11
242          code0 {if (part->kit[n].Padenabled==0) o->deactivate();}
243        }
244        Fl_Check_Button adcheck {
245          callback {//
246
247          send_data(TOPLEVEL::action::forceUpdate, PART::control::enableAdd, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
248          xywh {400 4 15 15} box THIN_UP_BOX down_box DOWN_BOX color 237 labelfont 1 labelsize 11
249          code0 {o->value(part->kit[n].Padenabled);}
250          class Fl_Check_Button2
251        }
252        Fl_Button subeditbutton {
253          label edit
254          callback {//
255          partui->showparameters(n,1);
256          if ((Fl::event_button() == 3))
257              synth->getGuiMaster()->partui->instrumentkitlist->hide();}
258          xywh {490 4 40 15} box THIN_UP_BOX labelsize 11
259          code0 {if (part->kit[n].Psubenabled==0) o->deactivate();}
260        }
261        Fl_Check_Button subcheck {
262          callback {//
263
264          send_data(TOPLEVEL::action::forceUpdate, PART::control::enableSub, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
265          xywh {470 4 15 15} box THIN_UP_BOX down_box DOWN_BOX color 237 labelfont 1 labelsize 11
266          code0 {o->value(part->kit[n].Psubenabled);}
267          class Fl_Check_Button2
268        }
269        Fl_Button padeditbutton {
270          label edit
271          callback {//
272          partui->showparameters(n,2);
273          if ((Fl::event_button() == 3))
274              synth->getGuiMaster()->partui->instrumentkitlist->hide();}
275          xywh {560 4 40 15} box THIN_UP_BOX labelsize 11
276          code0 {if (part->kit[n].Ppadenabled==0) o->deactivate();}
277        }
278        Fl_Check_Button padcheck {
279          callback {//
280
281          send_data(TOPLEVEL::action::forceUpdate, PART::control::enablePad, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
282          xywh {540 4 15 15} box THIN_UP_BOX down_box DOWN_BOX color 237 labelfont 1 labelsize 11
283          code0 {o->value(part->kit[n].Ppadenabled);}
284          class Fl_Check_Button2
285        }
286        Fl_Choice sendtoeffect {
287          callback {//
288          send_data(0, PART::control::kitEffectNum, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
289          xywh {615 4 45 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
290          code0 {o->add("OFF"); char nrstr[10]; for (int i = 0; i < NUM_PART_EFX; i++) {sprintf(nrstr,"FX%d",i+1);o->add(nrstr);};}
291          code1 {o->value(part->kit[n].Psendtoparteffect+1);if (part->kit[n].Psendtoparteffect==127) o->value(0);}
292        } {}
293      }
294      Fl_Check_Button enabledcheck {
295        label 01
296        callback {//
297        int answer = 1;
298        if (o->value() == 0)
299            answer = (choice(synth, "", "Yes", "No", "Delete the item?") > 1);
300        if (answer != 0)
301        {
302            if (o->value() == 0)
303                clearLine();
304            else
305                partkititemgroup->activate();
306            o->redraw();
307            partui->showparameters(n, -1); // use to delete the ui, if it is not to item 0
308        }
309        else
310            o->value(1);
311        send_data(0, PART::control::enableKitLine, o->value(), TOPLEVEL::type::Integer, n, UNUSED, TOPLEVEL::insert::kitGroup);}
312        xywh {30 4 20 15} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 12 align 4
313        code0 {snprintf(label,10,"%d",(n&15)+1);o->label(label);}
314        code1 {o->value(part->kit[n].Penabled);}
315        code2 {if (n==0) o->hide();}
316        code3 {if (o->value() == 0) labelbutton->color(FL_WHITE);}
317        class Fl_Check_Button2
318      }
319    }
320  }
321  Function {send_data(int action, int control, float value, int type, int kititem = UNUSED, int engine = UNUSED, int insert = UNUSED, int parameter = UNUSED, int miscmsg = UNUSED)} {} {
322    code {//
323        type |= TOPLEVEL::type::Write;
324        collect_data(synth, value, action, type, control, npart, kititem, engine, insert, parameter, UNUSED, miscmsg);} {}
325  }
326  Function {PartKitItem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
327    code {//
328    n=0;part=NULL;} {}
329  }
330  Function {clearLine()} {} {
331    code {//
332    partkititemgroup->deactivate();
333    mutedcheck->value(0);
334    labelbutton->copy_label("");
335    minkcounter->value(0);
336    maxkcounter->value(127);
337    adcheck->value(0);
338    adeditbutton->deactivate();
339    subcheck->value(0);
340    subeditbutton->deactivate();
341    padcheck->value(0);
342    padeditbutton->deactivate();
343    sendtoeffect->value(1);} {}
344  }
345  Function {init(Part *part_, int n_, int npart_, PartUI_ *partui_)} {} {
346    code {//
347    synth = part_->getSynthEngine();
348    part = part_;
349    n = n_;
350    npart = npart_;
351    partui = partui_;
352    make_window();
353    end();} {}
354  }
355  Function {itemRtext(float dScale)} {} {
356    code {//
357    int size = int(10 * dScale);
358    int size11 = int(11 * dScale);
359    int size12 = int(12 * dScale);
360
361    enabledcheck->labelsize(size12);
362    mutedcheck->labelsize(size11);
363    labelbutton->labelsize(size);
364    minkcounter->textsize(size12);
365    setmin->labelsize(size);
366    setmax->labelsize(size);
367    setfull->labelsize(size);
368    maxkcounter->textsize(size12);
369    adeditbutton->labelsize(size11);
370    adcheck->labelsize(size11);
371    subeditbutton->labelsize(size11);
372    subcheck->labelsize(size11);
373    padeditbutton->labelsize(size11);
374    padcheck->labelsize(size11);
375    sendtoeffect->labelsize(size);
376         sendtoeffect->textsize(size);} {}
377  }
378  Function {~PartKitItem()} {} {
379    code {//
380    partkititem->hide();} {}
381  }
382  decl {Part *part;} {public local
383  }
384  decl {int n;} {private local
385  }
386  decl {int npart;} {private local
387  }
388  decl {char label[10];} {private local
389  }
390  decl {PartUI_ *partui;} {private local
391  }
392  decl {SynthEngine *synth;} {private local
393  }
394}
395
396class PartUI {: {public Fl_Group, PartUI_}
397} {
398  Function {make_window()} {} {
399    Fl_Window partgroup {
400      xywh {794 168 380 170} type Double hide
401      class Fl_Group
402    } {
403      Fl_Box {} {
404        xywh {80 60 17 17} box THIN_UP_BOX color 237
405      }
406      Fl_Group partgroupui {
407        xywh {0 0 378 168}
408        code0 {if (part->Penabled != 1) o->deactivate();}
409      } {
410        Fl_Button partedit {
411          label Edit
412          callback {//
413        bool divert = true;
414        if (lastkey >= 49 && lastkey <= 56)
415        { // not working yet :(
416            /*int voiceNum = lastkey - 49;
417            if (Fl::event_button() == 3)
418            {
419                send_data(0, PART::control::enable, 1, TOPLEVEL::type::Integer, UNUSED, 0);
420                adsynenabledcheck->value(1);
421                send_data(TOPLEVEL::action::forceUpdate, PART::control::volumeEnable, voiceNum, TOPLEVEL::type::Integer);
422                //synth->getGuiMaster()->partui->adnoteui->advoice->nvoice = voiceNum;
423                //synth->getGuiMaster()->partui->adnoteui->advoice->voiceonbutton->value(1);
424            }
425            if (adsynenabledcheck->value() == 1)
426            {
427                ;
428            }*/
429            lastkey = -1;
430        }
431        switch(lastkey)
432        {
433            case 97: // a
434                if (Fl::event_button() == 3)
435                {
436                    send_data(0, PART::control::enableAdd, 1, TOPLEVEL::type::Integer, UNUSED, 0);
437                    adsynenabledcheck->value(1);
438                }
439
440                lastkey = -1;
441                if (adsynenabledcheck->value() == 1)
442                {
443                    showparameters(0,0);
444                    checkEngines();
445                    seteditname();
446                }
447                else
448                    divert = false;
449                break;
450            case 115: // s
451                if (Fl::event_button() == 3)
452                {
453                    send_data(0, PART::control::enableSub, 1, TOPLEVEL::type::Integer, UNUSED, 1);
454                    subsynenabledcheck->value(1);
455                }
456                lastkey = -1;
457                if (subsynenabledcheck->value() == 1)
458                {
459                showparameters(0,1);
460                checkEngines();
461                seteditname();
462                }
463                else
464                    divert = false;
465                break;
466            case 100: // d
467            case 112: // p
468                if (Fl::event_button() == 3)
469                {
470                    send_data(0, PART::control::enablePad, 1, TOPLEVEL::type::Integer, UNUSED, 2);
471                    padsynenabledcheck->value(1);
472                }
473                lastkey = -1;
474                if (padsynenabledcheck->value() == 1)
475                {
476                    showparameters(0,2);
477                    checkEngines();
478                    seteditname();
479                    lastkey = -1;
480                }
481                else
482                    divert = false;
483                break;
484            case 107: // k
485                lastkey = -1;
486                Showkit();
487                break;
488            case 101: // e
489                lastkey = -1;
490                Showefx();
491                break;
492            default:
493                divert = false;
494                break;
495        }
496        if (!divert)
497        {
498            lastkey = -1;
499            Showedit();
500        }}
501          xywh {330 6 42 22} box PLASTIC_UP_BOX color 22 labelfont 1 labelsize 12
502        }
503        Fl_Box instrumentaddbox {
504          xywh {136 9 63 16} box FLAT_BOX
505        }
506        Fl_Box instrumentsubbox {
507          xywh {199 9 63 16} box FLAT_BOX
508        }
509        Fl_Box instrumentpadbox {
510          xywh {262 9 63 16} box FLAT_BOX
511        }
512        Fl_Button instrumentlabel {
513          tooltip {Left mouse button: choose/save/.. from/to bank, Right button: instrument name} xywh {134 7 192 20} box THIN_DOWN_FRAME labelsize 12 align 16
514          code0 {setinstrumentlabel();}
515        }
516        Fl_Button buttontop {
517          callback {//
518          int event = Fl::event_button();
519          if (event == FL_LEFT_MOUSE)
520          {
521              synth->getGuiMaster()->activePart = npart;
522              bankui->Show();
523          }
524          else if (event == FL_RIGHT_MOUSE)
525          {
526              string name = input_text(synth, "Instrument name:", part->Pname);
527              if (name == DEFAULT_NAME)
528                  alert(synth, "Can't use name of default sound");
529              else if (name != part->Pname)
530              {
531                  unsigned char id = textMsgBuffer.push(name);
532                  send_data(TOPLEVEL::action::lowPrio | TOPLEVEL::action::forceUpdate, PART::control::instrumentName, 0, TOPLEVEL::type::Integer, UNUSED, UNUSED, UNUSED, UNUSED, id);
533              }
534          }}
535          tooltip {Left mouse button: choose/save/.. from/to bank, Right button: instrument name} xywh {134 7 192 20} box THIN_DOWN_FRAME labeltype NO_LABEL labelsize 12 align 16
536        }
537        Fl_Dial velocitysense {
538          label {Vel. Sens}
539          callback {//
540          send_data(0, PART::control::velocitySense, o->value(), TOPLEVEL::type::Integer);}
541          xywh {192 34 32 32} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
542          code0 {o->value(part->Pvelsns);}
543          code2 {o->setValueType(VC_AmpVelocitySense);}
544          class WidgetPDial
545        }
546        Fl_Dial velocityoffset {
547          label {Vel. Offs}
548          callback {//
549          send_data(0, PART::control::velocityOffset, o->value(), TOPLEVEL::type::Integer);}
550          xywh {242 34 32 32} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
551          code0 {o->value(part->Pveloffs);}
552          class WidgetPDial
553        }
554        Fl_Dial partpan {
555          label Pan
556          callback {//;
557          if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
558              synth->getGuiMaster()->setPanelPartPanWidget(npart % NUM_MIDI_CHANNELS, o->value());
559
560          send_data(0, PART::control::panning, o->value(), 0);}
561          xywh {289 34 32 32} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
562          code0 {o->setValueType(VC_PanningStd);}
563          code1 {o->value(part->Ppanning);}
564          class WidgetPDial
565        }
566        Fl_Dial partvol {
567          label Volume
568          callback {//;
569          if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
570          synth->getGuiMaster()->setPanelPartVolWidget(npart % NUM_MIDI_CHANNELS, o->value());
571
572          send_data(0, PART::control::volume, o->value(), 0);}
573          xywh {335 34 32 32} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
574          code0 {o->setValueType(VC_PartVolume);}
575          code1 {o->value(part->Pvolume);}
576          class WidgetPDial
577        }
578        Fl_Check_Button enportamento {
579          label Portamento
580          callback {//
581          send_data(0, PART::control::portamento, o->value(), TOPLEVEL::type::Integer);}
582          tooltip {Enable/Disable the portamento} xywh {82 61 17 15} down_box DOWN_BOX color 237 labelsize 11 align 8
583          code0 {o->value(part->ctl->portamento.portamento);}
584          class Fl_Check_Button2
585        }
586        Fl_Spinner midich {
587          label Midi
588          callback {//
589          int tmp = ((int)o->value() -1);
590          if (tmp > 15)
591          {
592              tmp &= 15;
593              o->value(tmp +1);
594          }
595          o->textcolor(FL_BLACK);
596          if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
597              synth->getGuiMaster()->setPanelPartMidiWidget(npart % NUM_MIDI_CHANNELS, tmp);
598
599          send_data(0, PART::control::midiChannel, tmp, TOPLEVEL::type::Integer);}
600          tooltip {MIDI channel for this part} xywh {31 36 40 19} labelsize 11 maximum 16 textsize 11
601          code0 {o->value(part->Prcvchn + 1);}
602          code1 {if (part->Prcvchn < NUM_MIDI_CHANNELS) o->textcolor(FL_BLACK); else o->textcolor(FL_WHITE);}
603          class WidgetSpinner
604        }
605        Fl_Box modepatch {
606          label Mode
607          xywh {150 37 32 17} box FLAT_BOX color 29 labelsize 11
608        }
609        Fl_Choice keymode {
610          callback {//
611          if (o->value() > 1 && drumMode->value() != 0)
612              modepatch->color(91);
613          else
614              modepatch->color(29);
615          modepatch->redraw();
616          send_data(0, PART::control::keyMode, o->value(), TOPLEVEL::type::Integer);}
617          tooltip {Poly, Mono or Legato mode} xywh {82 36 68 19} down_box BORDER_BOX selection_color 49 labelsize 11 align 8 textfont 1 textsize 11
618          code0 {o->add("Poly");o->add("Mono");o->add("Legato");}
619          code1 {int tmp = synth->ReadPartKeyMode(npart);}
620          code2 {if (tmp > 1) o->value(2); else o->value(tmp);}
621        } {}
622        Fl_Button partcontrollers {
623          label Controllers
624          callback {//
625          Showctl();}
626          tooltip {MIDI Controller range settings} xywh {2 82 86 22} box PLASTIC_UP_BOX color 228 labelsize 12
627        }
628        Fl_Button midiCCs {
629          label {Midi CCs}
630          callback {//
631          Showctlmidi();}
632          tooltip {Emulates common MIDI CCs} xywh {96 82 60 22} box PLASTIC_UP_BOX color 228 labelsize 12
633        }
634        Fl_Spinner partkeyshift {
635          label {Key Shift}
636          callback {//
637          send_data(TOPLEVEL::action::lowPrio, PART::control::keyShift, o->value(), TOPLEVEL::type::Integer);}
638          xywh {194 111 38 20} labelsize 10 minimum -36 maximum 36 textsize 11
639          code0 {o->range(MIN_KEY_SHIFT, MAX_KEY_SHIFT);o->step(1.0);}
640          code1 {o->value(part->Pkeyshift - 64);}
641          class WidgetSpinner
642        }
643        Fl_Spinner partkeylimit {
644          label {Key Limit}
645          callback {//
646          send_data(0, PART::control::maxNotes, o->value(), TOPLEVEL::type::Integer);}
647          tooltip {Maximum keys for this part} xywh {194 143 38 20} labelsize 10 value 20 textsize 11
648          code0 {o->range(1, POLIPHONY); // enough for one part!}
649          code1 {o->value(part->Pkeylimit);}
650          class WidgetSpinner
651        }
652        Fl_Spinner minkcounter {
653          label {Min Note}
654          callback {//
655          int tmp = o->value();
656          int other = maxkcounter->value();
657          if (tmp > other)
658          {
659              tmp = other;
660              o->value(tmp);
661          }
662
663          send_data(0, PART::control::minNote, tmp, TOPLEVEL::type::Integer);}
664          tooltip {Minimum note the part receives} xywh {57 111 42 20} labelsize 10 minimum 0 maximum 127 textsize 11
665          code0 {o->range(0.0, 127.0);o->step(1.0);}
666          code1 {o->value(part->Pminkey);}
667          class WidgetSpinner
668        }
669        Fl_Spinner maxkcounter {
670          label {Max Note}
671          callback {//
672          int tmp = o->value();
673          int other = minkcounter->value();
674          if (tmp < other)
675          {
676              tmp = other;
677              o->value(tmp);
678          }
679
680          send_data(0, PART::control::maxNote, tmp, TOPLEVEL::type::Integer);}
681          tooltip {Maximum note the part receives} xywh {57 143 42 20} labelsize 10 minimum 0 maximum 127 textsize 11
682          code0 {o->range(0.0, 127.0);o->step(1.0);}
683          code1 {o->value(part->Pmaxkey);}
684          class WidgetSpinner
685        }
686        Fl_Button setmin {
687          label Set
688          callback {//
689          if (part->lastnote >= 0)
690              minkcounter->value(part->lastnote);
691
692          send_data(0, PART::control::minToLastKey, o->value(), TOPLEVEL::type::Integer);}
693          tooltip {Set minimum note to the last note played} xywh {104 111 30 16} box PLASTIC_UP_BOX labelsize 10
694        }
695        Fl_Button setnorm {
696          label R
697          callback {//
698          minkcounter->value(0);
699          maxkcounter->value(127);
700
701          send_data(0, PART::control::resetMinMaxKey, o->value(), TOPLEVEL::type::Integer);}
702          tooltip {Reset the minimum key to 0 and maximum key to 127} xywh {104 129 30 16} box PLASTIC_UP_BOX labelfont 1 labelsize 11
703        }
704        Fl_Button setmax {
705          label Set
706          callback {//
707          if (part->lastnote >= 0) maxkcounter->value(part->lastnote);
708
709          send_data(0, PART::control::maxToLastKey, o->value(), TOPLEVEL::type::Integer);}
710          tooltip {Set maximum note to the last note played} xywh {104 147 30 16} box PLASTIC_UP_BOX labelsize 10
711        }
712        Fl_Box {} {
713          xywh {240 106 134 62} box ENGRAVED_FRAME labelfont 1 labelsize 11 align 18
714        }
715        Fl_Pack toSysEfx {
716          xywh {246 122 122 39} type HORIZONTAL labeltype NO_LABEL labelsize 10 align 0
717          code0 {o->spacing(7);}
718          code1 {//
719              for (int i = 0; i < NUM_SYS_EFX; ++i)
720            {
721              psyef[i] = new PartSysEffSend(0, 0, 25, 25);
722              psyef[i]->init(npart, i, synth);
723            }}
724          code2 {if (part->Penabled != 1)
725        {
726            toSysEfx->deactivate();
727        }
728        else
729        {
730           toSysEfx->activate();
731        }}
732        } {}
733      }
734      Fl_Text_Display syseffname {
735        label {Send to System Effect}
736        xywh {255 134 103 15} box NO_BOX labelsize 11 align 2
737      }
738      Fl_Check_Button partGroupEnable {
739        label Enabled
740        callback {//;
741        if (o->value() != 1)
742        {
743            partgroupui->deactivate();
744            toSysEfx->deactivate();
745        }
746        else
747        {
748            partgroupui->activate();
749            toSysEfx->activate();
750        }
751
752        if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
753        {
754            synth->getGuiMaster()->panellistitem[npart % NUM_MIDI_CHANNELS]->partenabled->value(o->value());
755            if (o->value() != 1)
756                synth->getGuiMaster()->panellistitem[npart % NUM_MIDI_CHANNELS]->panellistitemgroup->deactivate();
757            else
758            synth->getGuiMaster()->panellistitem[npart % NUM_MIDI_CHANNELS]->panellistitemgroup->activate();
759        }
760
761        send_data(0, PART::control::enable, o->value(), TOPLEVEL::type::Integer);}
762        xywh {58 59 20 20} down_box DOWN_BOX labelsize 11 align 4
763        code0 {o->value(part->Penabled == 1);}
764        class Fl_Check_Button2
765      }
766    }
767    Fl_Window instrumentkitlist {
768      label {Instrument Kit}
769      xywh {341 129 670 370} type Double hide resizable
770      code0 {o->copy_label(synth->getGuiMaster()->setPartWindowTitle("kit List").c_str());}
771      code2 {kitDW = o->w(); kitDH = o->h();}
772      code3 {o->size_range(kitDW, kitDH, 0, 0, 0, 0, 1);}
773    } {
774      Fl_Group kitlist {
775        xywh {4 20 662 324} box THIN_UP_FRAME
776      } {
777        Fl_Pack kitpack {
778          xywh {0 21 670 322}
779          code0 {for (int i=0;i<NUM_KIT_ITEMS;i++){partkititem[i]=new PartKitItem(0,0,670,20,"");partkititem[i]->init(part, i, npart, this);}}
780        } {}
781      }
782      Fl_Box kitnum {
783        label {No.}
784        xywh {10 0 25 15} labelfont 1 labelsize 11 align 18
785      }
786      Fl_Box kitmute {
787        label Mute
788        xywh {55 0 25 15} labelfont 1 labelsize 11 align 18
789      }
790      Fl_Box kitID {
791        label Name
792        xywh {137 0 40 15} labelfont 1 labelsize 11 align 18
793      }
794      Fl_Box kitminkey {
795        label {Min key}
796        xywh {235 0 40 15} labelfont 1 labelsize 11 align 18
797      }
798      Fl_Box kitmaxkey {
799        label {Max key}
800        xywh {345 0 40 15} labelfont 1 labelsize 11 align 18
801      }
802      Fl_Box kitadd {
803        label ADsynth
804        xywh {410 0 50 15} labelfont 1 labelsize 11 align 18
805      }
806      Fl_Box kitsub {
807        label SUBsynth
808        xywh {470 0 60 15} labelfont 1 labelsize 11 align 18
809      }
810      Fl_Box kitpad {
811        label PADsynth
812        xywh {540 0 60 15} labelfont 1 labelsize 11 align 18
813      }
814      Fl_Box kitfxnum {
815        label {FX.r.}
816        xywh {620 0 30 15} labelfont 1 labelsize 11 align 18
817      }
818      Fl_Choice kitMode {
819        label Mode
820        callback {//
821        int tmp = o->value();
822        partKitOn = tmp > 0;
823        if (partKitOn)
824            kitlist->activate();
825        else
826            kitlist->deactivate();
827
828        send_data(0, PART::control::kitMode, tmp, TOPLEVEL::type::Integer);}
829        tooltip {Single = only 1st item in defined note range sounds} xywh {41 348 88 19} down_box BORDER_BOX labelsize 11 textfont 1 textsize 11
830        code0 {o->add("Off");o->add("Multi");o->add("Single");o->add("Crossfade");}
831        code1 {if (part->Pkitfade) {o->value(3);} else {o->value(part->Pkitmode);}}
832        code2 {partKitOn = o->value() > 0;}
833        code3 {if (!partKitOn) kitlist->deactivate();}
834      } {}
835      Fl_Check_Button drumMode {
836        label {Drum mode}
837        callback {//
838        send_data(TOPLEVEL::action::forceUpdate, PART::control::drumMode, o->value(), TOPLEVEL::type::Integer);}
839        tooltip {Disables microtonal tuning} xywh {285 350 15 15} down_box DOWN_BOX labelsize 11
840        code0 {o->value(part->Pdrummode);}
841        class Fl_Check_Button2
842      }
843      Fl_Button kitClose {
844        label Close
845        callback {//
846        instrumentkitlist->hide();
847        if ((Fl::event_button() == 3))
848        synth->getGuiMaster()->partui->instrumenteditwindow->show();}
849        tooltip {Right click: also reopen previous} xywh {569 348 63 20} box THIN_UP_BOX
850      }
851    }
852    Fl_Window instrumenteditwindow {
853      label {Instrument Edit}
854      callback {editClose->do_callback();}
855      xywh {330 188 395 385} type Double hide resizable
856      code0 {seteditname();}
857      code1 {o->copy_label(synth->getGuiMaster()->setPartWindowTitle("Instrument Edit").c_str());}
858      code2 {editDW = 395; editDH = 385;}
859      code3 {o->size_range(editDW, editDH, 0, 0, 0, 0, 1);}
860    } {
861      Fl_Group {} {
862        xywh {0 220 395 103} box ENGRAVED_BOX
863      } {
864        Fl_Group ADD {
865          label ADDsynth
866          xywh {5 246 100 72} box ENGRAVED_FRAME labelfont 1
867        } {
868          Fl_Check_Button adsynenabledcheck {
869            label Enabled
870            callback {//
871
872            send_data(TOPLEVEL::action::forceUpdate, PART::control::enableAdd, o->value(), TOPLEVEL::type::Integer);}
873            tooltip {enable/disable ADsynth} xywh {15 252 80 20} box PLASTIC_UP_BOX down_box DOWN_BOX color 228 labelfont 1 labelsize 11
874            code1 {o->value(part->kit[0].Padenabled);}
875            class Fl_Check_Button2
876          }
877          Fl_Box addbox {
878            xywh {10 226 89 18} box FLAT_BOX
879            code1 {if (adsynenabledcheck->value() != 0 && engine != 0) o->color(ADD_COLOUR); else o->color(BASE_COLOUR);}
880          }
881          Fl_Button adeditbutton {
882            label Edit
883            callback {//
884            showparameters(0,0);
885            checkEngines();
886            seteditname();
887            if ((Fl::event_button() == 3))
888            {
889                instrumenteditwindow->hide();}}
890            tooltip {Right click: also close this} xywh {15 276 80 34} box PLASTIC_UP_BOX color 222 selection_color 220 labelfont 1 align 128
891            code0 {if (part->kit[0].Padenabled==0) o->deactivate();}
892          }
893        }
894        Fl_Group SUB {
895          label SUBsynth
896          xywh {105 246 100 72} box ENGRAVED_FRAME labelfont 1
897        } {
898          Fl_Check_Button subsynenabledcheck {
899            label Enabled
900            callback {//
901
902            send_data(TOPLEVEL::action::forceUpdate, PART::control::enableSub, o->value(), TOPLEVEL::type::Integer);}
903            tooltip {enable/disable SUBsynth} xywh {115 252 80 20} box PLASTIC_UP_BOX down_box DOWN_BOX color 228 labelfont 1 labelsize 11
904            code1 {o->value(part->kit[0].Psubenabled);}
905            class Fl_Check_Button2
906          }
907          Fl_Box subbox {
908            xywh {110 226 89 18} box FLAT_BOX
909            code1 {if (subsynenabledcheck->value() != 0 && engine != 0) o->color(SUB_COLOUR); else o->color(BASE_COLOUR);}
910          }
911          Fl_Button subeditbutton {
912            label Edit
913            callback {//
914            showparameters(0,1);
915            checkEngines();
916            seteditname();
917            if ((Fl::event_button() == 3))
918            {
919                instrumenteditwindow->hide();}}
920            tooltip {Right click: also close this} xywh {115 276 80 35} box PLASTIC_UP_BOX color 222 selection_color 220 labelfont 1 align 128
921            code0 {if (part->kit[0].Psubenabled==0) o->deactivate();}
922          }
923        }
924        Fl_Group PAD {
925          label PADsynth
926          xywh {205 246 100 72} box ENGRAVED_FRAME labelfont 1
927        } {
928          Fl_Check_Button padsynenabledcheck {
929            label Enabled
930            callback {//
931
932            send_data(TOPLEVEL::action::forceUpdate, PART::control::enablePad, o->value(), TOPLEVEL::type::Integer);}
933            tooltip {enable/disable PADsynth} xywh {215 252 80 20} box PLASTIC_UP_BOX down_box DOWN_BOX color 228 labelfont 1 labelsize 11
934            code1 {o->value(part->kit[0].Ppadenabled);}
935            class Fl_Check_Button2
936          }
937          Fl_Box padbox {
938            xywh {210 226 89 18} box FLAT_BOX
939            code1 {if (padsynenabledcheck->value() != 0 && engine != 0) o->color(PAD_COLOUR); else o->color(BASE_COLOUR);}
940          }
941          Fl_Button padeditbutton {
942            label Edit
943            callback {//
944            showparameters(0,2);
945            checkEngines();
946            seteditname();
947            if ((Fl::event_button() == 3))
948            {
949                instrumenteditwindow->hide();}}
950            tooltip {Right click: also close this} xywh {215 276 80 35} box PLASTIC_UP_BOX color 222 selection_color 220 labelfont 1 align 128
951            code0 {if (part->kit[0].Ppadenabled==0) o->deactivate();}
952          }
953        }
954        Fl_Button kitedit {
955          label {Kit Edit}
956          callback {//
957          Showkit();
958          if ((Fl::event_button() == 3))
959          {
960              instrumenteditwindow->hide();}}
961          tooltip {Right click: also close this} xywh {310 245 80 35} box PLASTIC_UP_BOX color 230 selection_color 220 labelfont 1 align 128
962        }
963        Fl_Button effects {
964          label Effects
965          callback {//
966          Showefx();
967          if ((Fl::event_button() == 3))
968          {
969              instrumenteditwindow->hide();}}
970          tooltip {Right click: also close this} xywh {310 283 80 35} box PLASTIC_UP_BOX color 230 labelfont 1
971        }
972      }
973      Fl_Group {} {
974        xywh {0 5 395 215} box ENGRAVED_FRAME
975      } {
976        Fl_Text_Display A_C_display {
977          label {Author and Copyright}
978          xywh {171 44 148 4} box NO_BOX labelsize 12
979        }
980        Fl_Button A_C_default {
981          label Default
982          callback {//
983            int param = 0;
984            if (Fl::event_state(FL_CTRL))
985            param = 1;
986            send_data(TOPLEVEL::action::lowPrio | TOPLEVEL::action::forceUpdate, PART::control::defaultInstrumentCopyright, 0, TOPLEVEL::type::Integer, 255, 255, 255, param);}
987          tooltip {Load default author & copyright
988 + Ctrl: save current text as default} xywh {327 25 63 20} labelsize 12
989        }
990        Fl_Input copyright {
991          callback {//
992           send_data(TOPLEVEL::action::lowPrio, PART::control::instrumentCopyright, 0, TOPLEVEL::type::Integer, UNUSED, UNUSED, UNUSED, UNUSED, textMsgBuffer.push(string(o->value())));}
993          xywh {5 49 385 55} type Multiline color 26 labelsize 12 align 9
994          code0 {o->maximum_size(MAX_INFO_TEXT_SIZE);}
995          code1 {o->value(part->info.Pauthor.c_str());}
996        }
997        Fl_Input commentField {
998          label Comments
999          callback {//
1000          send_data(TOPLEVEL::action::lowPrio, PART::control::instrumentComments, 0, TOPLEVEL::type::Integer, UNUSED, UNUSED, UNUSED, UNUSED, textMsgBuffer.push(string(o->value())));}
1001          xywh {5 123 385 91} type Multiline color 26 labelsize 12 align 5
1002          code0 {o->maximum_size(MAX_INFO_TEXT_SIZE);}
1003          code1 {o->value(part->info.Pcomments.c_str());}
1004        }
1005        Fl_Choice instrumentType {
1006          label {Type:}
1007          callback {//
1008              send_data(TOPLEVEL::action::lowPrio, PART::control::instrumentType, o->value(), TOPLEVEL::type::Integer);}
1009          xywh {5 25 155 20} down_box BORDER_BOX labelfont 1 labelsize 11 align 5 textfont 1 textsize 11
1010          code0 {fillInstrumentType();}
1011          code1 {o->value(part->info.Ptype);}
1012        } {}
1013      }
1014      Fl_Box {} {
1015        xywh {0 322 268 62} box ENGRAVED_FRAME labelfont 1 align 8
1016      }
1017      Fl_Text_Display humanise_display {
1018        label Humanise
1019        xywh {102 342 78 7} box NO_BOX labelfont 1
1020      }
1021      Fl_Value_Slider humanise {
1022        label Detune
1023        callback {//
1024
1025        send_data(0, PART::control::humanise, o->value(), TOPLEVEL::type::Integer);}
1026        tooltip {Random detune of whole part in cents} xywh {12 342 201 16} type {Horz Knob} box THIN_DOWN_BOX labelsize 12 align 8 maximum 50 step 1
1027        code1 {o->setValueType(VC_PartHumaniseDetune);//o->useCustomTip(true);}
1028        class mwheel_val_slider_rev
1029      }
1030      Fl_Value_Slider velocityhumanise {
1031        label Velocity
1032        callback {//
1033
1034        send_data(0, PART::control::humanvelocity, o->value(), TOPLEVEL::type::Integer);}
1035        tooltip {Random velocity attenuation of whole part} xywh {12 363 201 16} type {Horz Knob} box THIN_DOWN_BOX labelsize 12 align 8 maximum 50 step 1
1036        code1 {o->setValueType(VC_PartHumaniseVelocity);o->useCustomTip(true);}
1037        class mwheel_val_slider_rev
1038      }
1039      Fl_Button editClose {
1040        label Close
1041        callback {//
1042                  saveWin(synth, instrumenteditwindow->w(), instrumenteditwindow->h(), instrumenteditwindow->x(),instrumenteditwindow->y(), false, "Part-edit");
1043                  editSeen = false;
1044                  lasteditW = 0;
1045                  instrumenteditwindow->hide();}
1046        xywh {290 358 86 21} box THIN_UP_BOX labelfont 1
1047      }
1048      Fl_Button editAT {
1049        label Aftertouch
1050        callback {//
1051                ShowAT();
1052                atSeen = 2;
1053                if ((Fl::event_button() == 3))
1054                    instrumenteditwindow->hide();}
1055        xywh {283 328 101 26} box PLASTIC_UP_BOX color 230 labelfont 1
1056      }
1057      Fl_Text_Display originalname {
1058        label {Derived From}
1059        xywh {200 108 1 15} box NO_BOX labelfont 1 labelsize 12 align 4 textsize 11 hide
1060      }
1061      Fl_Text_Display originaltext {
1062        label text
1063        xywh {198 108 1 15} box NO_BOX labelfont 1 labelsize 12 labelcolor 4 align 8 textsize 11 hide
1064      }
1065    }
1066    Fl_Window partfx {
1067      label {Part's Insert Effects}
1068      xywh {520 67 385 160} type Double hide resizable
1069      code0 {o->copy_label(synth->getGuiMaster()->setPartWindowTitle("Insert Effects").c_str());}
1070      code1 {fxDW = o->w(); fxDH = o->h();}
1071      code2 {o->size_range(fxDW, fxDH, 0, 0, 0, 0, 1);}
1072    } {
1073      Fl_Spinner inseffnocounter {
1074        callback {//
1075                ninseff = o->value() - 1;
1076                insefftype->value(part->partefx[ninseff]->geteffect());
1077
1078                inseffectui->refresh(part->partefx[ninseff], npart, ninseff);
1079                int x = part->Pefxroute[ninseff];
1080                if (x == 127)
1081                    x = 1;
1082                bypasseff->value(part->Pefxbypass[ninseff]);
1083                sendtochoice->value(x);
1084
1085                send_data(0, PART::control::effectNumber, ninseff, TOPLEVEL::type::Integer, UNUSED, ninseff, TOPLEVEL::insert::partEffectSelect);}
1086        tooltip {Effect No.} xywh {20 8 35 22} labelsize 12 maximum 3 textsize 12
1087        code1 {o->value(ninseff+1);}
1088        class WidgetSpinner
1089      }
1090      Fl_Choice insefftype {
1091        callback {//
1092        send_data(TOPLEVEL::action::forceUpdate, PART::control::effectType, o->value(), TOPLEVEL::type::Integer, UNUSED, ninseff, TOPLEVEL::insert::partEffectSelect);}
1093        tooltip {Effect Type} xywh {86 8 92 22} box UP_BOX down_box BORDER_BOX labelsize 11 textfont 1 textsize 12
1094        code0 {o->add("No Effect");o->add("Reverb");o->add("Echo");o->add("Chorus");o->add("Phaser");o->add("AlienWah");o->add("Distortion");o->add("EQ");o->add("DynFilter");}
1095        code1 {o->value(part->partefx[ninseff]->geteffect());}
1096      } {}
1097      Fl_Group inseffectuigroup {
1098        xywh {3 37 380 96} box FLAT_BOX color 48
1099      } {
1100        Fl_Group inseffectui {
1101          xywh {5 38 379 95}
1102          code0 {o->init(part->partefx[ninseff], npart, ninseff);}
1103          class EffUI
1104        } {}
1105      }
1106      Fl_Choice sendtochoice {
1107        label To
1108        callback {//
1109        send_data(0, PART::control::effectDestination, o->value(), TOPLEVEL::type::Integer, UNUSED, ninseff, TOPLEVEL::insert::partEffectSelect);}
1110        xywh {225 8 102 22} down_box BORDER_BOX labelfont 1 labelsize 12 textfont 1 textsize 12
1111        code0 {o->add("Next Effect");o->add("Part Out");o->add("Dry Out");}
1112        code1 {int x = part->Pefxroute[ninseff]; if (x == 127) x = 1;}
1113        code2 {o->value(x);}
1114      } {}
1115      Fl_Button effCopy {
1116        label C
1117        callback {//
1118        synth->getGuiMaster()->getPresetsUi()->copy(part->partefx[ninseff]);}
1119        xywh {346 3 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
1120      }
1121      Fl_Button effPaste {
1122        label P
1123        callback {//
1124        synth->getGuiMaster()->getPresetsUi()->paste(part->partefx[ninseff], inseffectui);
1125        synth->getRuntime().effectChange = npart | (ninseff << 8); // temporary fix}
1126        xywh {346 19 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
1127      }
1128      Fl_Check_Button bypasseff {
1129        label Bypass
1130        callback {//
1131        send_data(0, PART::control::effectBypass, o->value(), TOPLEVEL::type::Integer, UNUSED, ninseff, TOPLEVEL::insert::partEffectSelect);}
1132        tooltip {if the effect is not used (is bypassed)} xywh {20 135 63 21} box THIN_UP_BOX down_box DOWN_BOX color 237 labelsize 12
1133        code0 {int x=part->Pefxbypass[ninseff];o->value(x);}
1134        class Fl_Check_Button2
1135      }
1136      Fl_Button effClose {
1137        label Close
1138        callback {//
1139        saveWin(synth,  partfx->w(), partfx->h(),  partfx->x(),  partfx->y(), false, "Part-effects");
1140        if(inseffectui->filterwindow != NULL)
1141            inseffectui->filterwindow->hide();
1142        fxSeen = false;
1143        partfx->hide();
1144        if ((Fl::event_button() == 3))
1145            synth->getGuiMaster()->partui->instrumenteditwindow->show();}
1146        tooltip {Right click: also reopen previous} xywh {307 136 60 20} box THIN_UP_BOX
1147      }
1148    }
1149    comment {ctlmidi, ctlwindow, aftertouch control MUST be that order} {in_source in_header
1150    }
1151    Fl_Window ctlmidi {
1152      label {MIDI Controls}
1153      xywh {591 324 365 60} type Double hide resizable
1154      code0 {o->copy_label(synth->getGuiMaster()->setPartWindowTitle("MIDI Controls").c_str());}
1155      code1 {midiDW = o->w(); midiDH = o->h();}
1156      code2 {o->size_range(midiDW, midiDH, 0, 0, 0, 0, 1);}
1157    } {
1158      Fl_Dial modulation {
1159        label Modulation
1160        callback {//
1161        send_data(0, PART::control::midiModWheel, o->value(), TOPLEVEL::type::Integer);}
1162        tooltip {Modulation Wheel} xywh {20 10 30 30} labelsize 10 maximum 127 step 1
1163        code0 {o->value(part->ctl->modwheel.data);}
1164        class WidgetPDial
1165      }
1166      Fl_Dial expression {
1167        label Expression
1168        callback {//
1169        send_data(0, PART::control::midiExpression,  o->value(), TOPLEVEL::type::Integer);}
1170        tooltip Expression xywh {80 10 30 30} labelsize 10 maximum 127 step 1
1171        code0 {o->value(part->ctl->expression.data);}
1172        class WidgetPDial
1173      }
1174      Fl_Dial filterq {
1175        label {Filter Q}
1176        callback {//
1177        send_data(0, PART::control::midiFilterQ, o->value(), TOPLEVEL::type::Integer);}
1178        tooltip {Filter Q} xywh {140 10 30 30} labelsize 10 maximum 127 step 1
1179        code0 {o->value(part->ctl->filterq.data);}
1180        class WidgetPDial
1181      }
1182      Fl_Dial filtercutoff {
1183        label {Filter Cutoff}
1184        callback {//
1185        send_data(0, PART::control::midiFilterCutoff, o->value(), TOPLEVEL::type::Integer);}
1186        tooltip {Filter Cutoff} xywh {200 10 30 30} labelsize 10 maximum 127 step 1
1187        code0 {o->value(part->ctl->filtercutoff.data);}
1188        class WidgetPDial
1189      }
1190      Fl_Dial masterbandwidth {
1191        label Bandwidth
1192        callback {//
1193        send_data(0, PART::control::midiBandwidth, o->value(), TOPLEVEL::type::Integer);}
1194        tooltip {Master Bandwidth} xywh {260 10 30 30} labelsize 10 maximum 127 step 1
1195        code0 {o->value(part->ctl->bandwidth.data);}
1196        class WidgetPDial
1197      }
1198      Fl_Button ctlmidiclose {
1199        label Close
1200        callback {//
1201                saveWin(synth,  ctlmidi->w(),  ctlmidi->h(), ctlmidi->x(), ctlmidi->y(), false, "Part-ctlmidi");
1202                ctlmidiSeen = false;
1203                ctlmidi->hide();}
1204        xywh {309 35 50 20} box THIN_UP_BOX
1205      }
1206    }
1207    Fl_Window ctlwindow {
1208      label Controllers
1209      callback {ctlclose->do_callback();}
1210      xywh {568 179 505 130} type Double hide resizable
1211      code0 {o->copy_label(synth->getGuiMaster()->setPartWindowTitle("Controllers").c_str());}
1212      code1 {ctlDW = o->w(); ctlDH = o->h();}
1213      code2 {o->size_range(ctlDW, ctlDH, 0, 0, 0, 0, 1);}
1214    } {
1215      Fl_Dial volrng {
1216        label {Vol Rng}
1217        callback {//
1218        send_data(0, PART::control::volumeRange, o->value(), TOPLEVEL::type::Integer);}
1219        tooltip {Volume Range} xywh {132 55 30 30} labelsize 10 minimum 64 maximum 127 step 1
1220        code0 {o->value(part->ctl->volume.data);}
1221        class WidgetPDial
1222      }
1223      Fl_Check_Button vol {
1224        label Vol
1225        callback {//
1226        send_data(0, PART::control::volumeEnable, o->value(), TOPLEVEL::type::Integer);}
1227        tooltip {Volume enable} xywh {175 81 45 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
1228        code0 {o->value(part->ctl->volume.receive);}
1229        class Fl_Check_Button2
1230      }
1231      Fl_Dial panwidth {
1232        label PanWdth
1233        callback {//
1234        send_data(0, PART::control::panningWidth, o->value(), TOPLEVEL::type::Integer);}
1235        tooltip {Panning Width} xywh {10 55 30 30} labelsize 10 maximum 64 step 1
1236        code0 {o->value(part->ctl->panning.depth);}
1237        class WidgetPDial
1238      }
1239      Fl_Dial modwh {
1240        label ModWh
1241        callback {//
1242        send_data(0, PART::control::modWheelDepth, o->value(), TOPLEVEL::type::Integer);}
1243        tooltip {Modulation Wheel depth} xywh {50 10 30 30} labelsize 10 maximum 127 step 1
1244        code0 {o->value(part->ctl->modwheel.depth);}
1245        class WidgetPDial
1246      }
1247      Fl_Check_Button expmwh {
1248        label {Exp MWh}
1249        callback {//
1250        send_data(0, PART::control::exponentialModWheel, o->value(), TOPLEVEL::type::Integer);}
1251        tooltip {Exponential modulation wheel} xywh {10 15 40 25} down_box DOWN_BOX labelsize 10 align 148
1252        code0 {o->value(part->ctl->modwheel.exponential);}
1253        class Fl_Check_Button2
1254      }
1255      Fl_Dial bwdpth {
1256        label BwDpth
1257        callback {//
1258        send_data(0, PART::control::bandwidthDepth, o->value(), TOPLEVEL::type::Integer);}
1259        tooltip {BandWidth depth} xywh {132 10 30 30} labelsize 10 maximum 127 step 1
1260        code0 {o->value(part->ctl->bandwidth.depth);}
1261        class WidgetPDial
1262      }
1263      Fl_Check_Button expbw {
1264        label {Exp BW}
1265        callback {//
1266        send_data(0, 134, o->value(), TOPLEVEL::type::Integer);}
1267        tooltip {Exponential BandWidth Controller} xywh {92 15 35 25} down_box DOWN_BOX labelsize 10 align 148
1268        code0 {o->value(part->ctl->bandwidth.exponential);}
1269        class Fl_Check_Button2
1270      }
1271      Fl_Check_Button expr {
1272        label Expr
1273        callback {//
1274        send_data(0, 135, o->value(), TOPLEVEL::type::Integer);}
1275        tooltip {Expression enable} xywh {175 59 45 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
1276        code0 {o->value(part->ctl->expression.receive);}
1277        class Fl_Check_Button2
1278      }
1279      Fl_Check_Button fmamp {
1280        label FMamp
1281        callback {//
1282        send_data(0, PART::control::FMamplitudeEnable, o->value(), TOPLEVEL::type::Integer);}
1283        tooltip {FM amplitude enable} xywh {225 59 60 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
1284        code0 {o->value(part->ctl->fmamp.receive);}
1285        class Fl_Check_Button2
1286      }
1287      Fl_Check_Button sustain {
1288        label Sustain
1289        callback {//
1290        send_data(0, PART::control::sustainPedalEnable, o->value(), TOPLEVEL::type::Integer);}
1291        tooltip {Sustain pedal enable} xywh {225 81 60 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
1292        code0 {o->value(part->ctl->sustain.receive);}
1293        class Fl_Check_Button2
1294      }
1295      Fl_Check_Button breath {
1296        label Breath
1297        callback {//
1298        send_data(0, 141, o->value(), TOPLEVEL::type::Integer);}
1299        tooltip {Breath Control enable} xywh {225 38 60 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
1300        code0 {o->value(part->PbreathControl == 2);}
1301        class Fl_Check_Button2
1302      }
1303      Fl_Counter pwheelbrng {
1304        label {PWheel Rng (cents)}
1305        callback {//
1306        send_data(0, PART::control::pitchWheelRange, o->value(), TOPLEVEL::type::Integer);}
1307        tooltip {Pitch Wheel Bend Range (cents)} xywh {174 15 110 20} color 237 selection_color 0 labelsize 10 align 1 minimum -6400 maximum 6400 step 1
1308        code0 {o->value(part->ctl->pitchwheel.bendrange);}
1309        code1 {o->lstep(100);}
1310      }
1311      Fl_Dial filtq {
1312        label FltQ
1313        callback {//
1314        send_data(0, PART::control::filterQdepth, o->value(), TOPLEVEL::type::Integer);}
1315        tooltip {Filter Q depth} xywh {50 55 30 30} labelsize 10 maximum 127 step 1
1316        code0 {o->value(part->ctl->filterq.depth);}
1317        class WidgetPDial
1318      }
1319      Fl_Dial fltcut {
1320        label FltCut
1321        callback {//
1322        send_data(0, PART::control::filterCutoffDepth, o->value(), TOPLEVEL::type::Integer);}
1323        tooltip {Filter Cutoff depth} xywh {90 55 30 30} labelsize 10 maximum 127 step 1
1324        code0 {o->value(part->ctl->filtercutoff.depth);}
1325        class WidgetPDial
1326      }
1327      Fl_Group ctlresonance {
1328        label Resonance
1329        xywh {290 15 45 85} box ENGRAVED_BOX labelfont 1 labelsize 10 align 5
1330      } {
1331        Fl_Dial cfdpth {
1332          label CFdpth
1333          callback {//
1334          send_data(0, PART::control::resonanceCenterFrequencyDepth, o->value(), TOPLEVEL::type::Integer);}
1335          tooltip {Center Frequency controller Depth} xywh {300 20 25 25} labelsize 10 maximum 127 step 1
1336          code0 {o->value(part->ctl->resonancecenter.depth);}
1337          class WidgetPDial
1338        }
1339        Fl_Dial rbwdpth {
1340          label BWdpth
1341          callback {//
1342          send_data(0, PART::control::resonanceBandwidthDepth, o->value(), TOPLEVEL::type::Integer);}
1343          tooltip {BandWidth controller depth} xywh {300 60 25 25} labelsize 10 maximum 127 step 1
1344          code0 {o->value(part->ctl->resonancebandwidth.depth);}
1345          class WidgetPDial
1346        }
1347      }
1348      Fl_Group ctlportamento {
1349        label Portamento
1350        xywh {340 15 160 85} box ENGRAVED_FRAME labelfont 1 labelsize 10
1351      } {
1352        Fl_Box ctlx100 {
1353          label {x100 cnt.}
1354          xywh {400 50 55 15} labelsize 10 align 16
1355        }
1356        Fl_Dial prtime {
1357          label time
1358          callback {//
1359          send_data(0, PART::control::portamentoTime, o->value(), TOPLEVEL::type::Integer);}
1360          tooltip {Portamento time} xywh {345 60 25 25} labelsize 10 maximum 127 step 1
1361          code0 {o->value(part->ctl->portamento.time);}
1362          class WidgetPDial
1363        }
1364        Fl_Dial timedu {
1365          label {t.dn/up}
1366          callback {//
1367          send_data(0, PART::control::portamentoTimeStretch, o->value(), TOPLEVEL::type::Integer);}
1368          tooltip {Portamento time stretch (up/down)} xywh {375 60 25 25} labelsize 10 maximum 127 step 1
1369          code0 {o->value(part->ctl->portamento.updowntimestretch);}
1370          class WidgetPDial
1371        }
1372        Fl_Counter thresh {
1373          label Thresh
1374          callback {//
1375          send_data(0, PART::control::portamentoThreshold, o->value(), TOPLEVEL::type::Integer);}
1376          tooltip {Minimum or max. difference of the notes in order to do the portamento (x 100 cents)} xywh {400 20 50 20} type Simple color 237 selection_color 0 labelsize 10 minimum 0 maximum 127 step 1
1377          code0 {o->value(part->ctl->portamento.pitchthresh);}
1378        }
1379        Fl_Check_Button thtype {
1380          label {th.type}
1381          callback {//
1382          send_data(0, PART::control::portamentoThresholdType, o->value(), TOPLEVEL::type::Integer);}
1383          tooltip {Threshold type (min/max)} xywh {425 68 15 15} down_box DOWN_BOX labelsize 10 align 2
1384          code0 {o->value(part->ctl->portamento.pitchthreshtype);}
1385          class Fl_Check_Button2
1386        }
1387        Fl_Dial propta {
1388          label {Prp.Rate}
1389          callback {//
1390          send_data(0, PART::control::proportionalPortamentoRate, o->value(), TOPLEVEL::type::Integer);}
1391          tooltip {Distance required to double change from nonpropotinal portamento time} xywh {463 20 25 25} labelsize 10 maximum 127 step 1
1392          code0 {o->value(part->ctl->portamento.propRate);}
1393          class WidgetPDial
1394        }
1395        Fl_Dial proptb {
1396          label {Prp.Dpth}
1397          callback {//
1398          send_data(0, PART::control::proportionalPortamentoDepth, o->value(), TOPLEVEL::type::Integer);}
1399          tooltip {The difference from nonproportinal portamento} xywh {463 60 25 25} labelsize 10 maximum 127 step 1
1400          code0 {o->value(part->ctl->portamento.propDepth);}
1401          class WidgetPDial
1402        }
1403        Fl_Check_Button rcv {
1404          label Rcv
1405          callback {//
1406          send_data(0, PART::control::receivePortamento, o->value(), TOPLEVEL::type::Integer);}
1407          tooltip {Receive Portamento Controllers} xywh {345 20 40 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
1408          code0 {o->value(part->ctl->portamento.receive);}
1409          class Fl_Check_Button2
1410        }
1411        Fl_Check_Button proprt {
1412          label {Proprt.}
1413          callback {//
1414          if (o->value())
1415          {
1416              propta->activate();
1417              proptb->activate();
1418          }
1419          else
1420          {
1421              propta->deactivate();
1422              proptb->deactivate();
1423          }
1424          send_data(0, PART::control::enableProportionalPortamento, o->value(), TOPLEVEL::type::Integer);}
1425          tooltip {Enable Proportinal Portamento (over fixed Portamento)} xywh {345 40 50 18} box THIN_UP_BOX down_box DOWN_BOX labelsize 9
1426          code0 {o->value(part->ctl->portamento.proportional);}
1427          code1 {if (o->value()){propta->activate();proptb->activate();}}
1428          code2 {else {propta->deactivate();proptb->deactivate();}}
1429          class Fl_Check_Button2
1430        }
1431      }
1432      Fl_Button resetallctl {
1433        label {Reset all controllers}
1434        callback {//
1435        send_data(TOPLEVEL::action::forceUpdate, PART::control::resetAllControllers, o->value(), TOPLEVEL::type::Integer);}
1436        xywh {5 105 210 20} box THIN_UP_BOX
1437      }
1438      Fl_Button aftertouch {
1439        label Aftertouch
1440        callback {//;
1441                ShowAT();
1442                atSeen = 1;
1443                if ((Fl::event_button() == 3))
1444                    ctlwindow->hide();}
1445        xywh {245 105 130 20} box PLASTIC_THIN_UP_BOX color 230
1446      }
1447      Fl_Button ctlclose {
1448        label Close
1449        callback {//;
1450        saveWin(synth, ctlwindow->w(), ctlwindow->h(), ctlwindow->x(), ctlwindow->y(), false, "Part-controllers");
1451        ctlSeen = false;
1452        lastctlW = 0;
1453        ctlwindow->hide();}
1454        xywh {405 105 95 20} box THIN_UP_BOX
1455      }
1456    }
1457    Fl_Window aftertouchcontrol {
1458      label Aftertouch
1459      callback {atClose->do_callback();}
1460      xywh {569 115 485 180} type Double hide resizable
1461      code0 {atDW = o->w(); atDH = o->h();}
1462      code1 {o->size_range(atDW, atDH, 0, 0, 0, 0, 1);}
1463    } {
1464      Fl_Box {} {
1465        xywh {9 5 228 171} box ENGRAVED_FRAME
1466      }
1467      Fl_Box {} {
1468        xywh {241 5 234 143} box ENGRAVED_FRAME
1469      }
1470      Fl_Box ATchan {
1471        label Channel
1472        xywh {95 13 35 17} labelfont 1
1473      }
1474      Fl_Button channeloff {
1475        label Off
1476        callback {//
1477                channelfiltercutoff->value(0);
1478                channelfilterCminus->value(0);
1479                channelfilterCminus->deactivate();
1480                channelfilterQ->value(0);
1481                channelfilterQminus->value(0);
1482                channelfilterQminus->deactivate();
1483                channelpitchbend->value(0);
1484                channelpitchBminus->value(0);
1485                channelpitchBminus->deactivate();
1486                channelmodulation->value(0);
1487                channelvolume->value(0);
1488                setATchannel(PART::aftertouchType::off, true);}
1489        xywh {55 40 48 20}
1490      }
1491      Fl_Check_Button channelfiltercutoff {
1492        label {Filter Cutoff}
1493        callback {//
1494                if (o->value())
1495                    channelfilterCminus->activate();
1496                else
1497                {
1498                    channelfilterCminus->value(0);
1499                    channelfilterCminus->deactivate();
1500                }
1501                setATchannel(PART::aftertouchType::filterCutoff, o->value());}
1502        tooltip {Between current MIDI setting and max.} xywh {25 65 70 15} down_box DOWN_BOX
1503        class Fl_Check_Button2
1504      }
1505      Fl_Check_Button channelfilterCminus {
1506        label Down
1507        callback {//
1508                setATchannel(PART::aftertouchType::filterCutoffDown, o->value());}
1509        tooltip {Between current MIDI setting and zero} xywh {150 65 70 15} down_box DOWN_BOX deactivate
1510        class Fl_Check_Button2
1511      }
1512      Fl_Check_Button channelfilterQ {
1513        label {Filter Q}
1514        callback {//
1515                if (o->value())
1516                    channelfilterQminus->activate();
1517                else
1518                {
1519                    channelfilterQminus->value(0);
1520                    channelfilterQminus->deactivate();
1521                }
1522                setATchannel(PART::aftertouchType::filterQ, o->value());}
1523        tooltip {Between current MIDI setting and max.} xywh {25 85 70 15} down_box DOWN_BOX
1524        class Fl_Check_Button2
1525      }
1526      Fl_Check_Button channelfilterQminus {
1527        label Down
1528        callback {//
1529                setATchannel(PART::aftertouchType::filterQdown, o->value());}
1530        tooltip {Between current MIDI setting and zero} xywh {150 85 70 15} down_box DOWN_BOX deactivate
1531        class Fl_Check_Button2
1532      }
1533      Fl_Check_Button channelpitchbend {
1534        label {Pitch Bend}
1535        callback {//
1536                if (o->value())
1537                    channelpitchBminus->activate();
1538                else
1539                {
1540                    channelpitchBminus->value(0);
1541                    channelpitchBminus->deactivate();
1542                }
1543                setATchannel(PART::aftertouchType::pitchBend, o->value());}
1544        tooltip {Between current pitch wheel position and max.} xywh {25 105 70 15} down_box DOWN_BOX
1545        class Fl_Check_Button2
1546      }
1547      Fl_Check_Button channelpitchBminus {
1548        label Down
1549        callback {//
1550                setATchannel(PART::aftertouchType::pitchBendDown, o->value());}
1551        tooltip {Between current pitch wheel position and min.} xywh {150 105 70 15} down_box DOWN_BOX deactivate
1552        class Fl_Check_Button2
1553      }
1554      Fl_Check_Button channelmodulation {
1555        label Modulation
1556        callback {//
1557                setATchannel(PART::aftertouchType::modulation, o->value());}
1558        tooltip {Between zero and Add/Pad frequency LFO depth} xywh {25 125 70 15} down_box DOWN_BOX
1559        class Fl_Check_Button2
1560      }
1561      Fl_Check_Button channelvolume {
1562        label Volume
1563        callback {//
1564                setATchannel(PART::aftertouchType::volume, o->value());}
1565        tooltip {Between current part volume and max.} xywh {25 145 70 15} down_box DOWN_BOX
1566        class Fl_Check_Button2
1567      }
1568      Fl_Box ATkey {
1569        label Key
1570        xywh {328 13 35 17} labelfont 1
1571      }
1572      Fl_Button polyoff {
1573        label Off
1574        callback {//
1575                polyfiltercutoff->value(0);
1576                polyfilterCminus->value(0);
1577                polyfilterCminus->deactivate();
1578                polyfilterQ->value(0);
1579                polyfilterQminus->value(0);
1580                polyfilterQminus->deactivate();
1581                polypitchbend->value(0);
1582                polypitchBminus->value(0);
1583                polypitchBminus->deactivate();
1584                polymodulation->value(0);
1585                setATkey(PART::aftertouchType::off, true);}
1586        xywh {300 40 48 20}
1587      }
1588      Fl_Check_Button polyfiltercutoff {
1589        label {Filter Cutoff}
1590        callback {//
1591                if (o->value())
1592                    polyfilterCminus->activate();
1593                else
1594                {
1595                    polyfilterCminus->value(0);
1596                    polyfilterCminus->deactivate();
1597                }
1598                setATkey(PART::aftertouchType::filterCutoff, o->value());}
1599        tooltip {Between current MIDI setting and max.} xywh {270 65 70 15} down_box DOWN_BOX
1600        class Fl_Check_Button2
1601      }
1602      Fl_Check_Button polyfilterCminus {
1603        label Down
1604        callback {//
1605                setATkey(PART::aftertouchType::filterCutoffDown, o->value());}
1606        tooltip {Between current MIDI setting and zero} xywh {395 65 70 15} down_box DOWN_BOX deactivate
1607        class Fl_Check_Button2
1608      }
1609      Fl_Check_Button polyfilterQ {
1610        label {Filter Q}
1611        callback {//
1612                if (o->value())
1613                    polyfilterQminus->activate();
1614                else
1615                {
1616                    polyfilterQminus->value(0);
1617                    polyfilterQminus->deactivate();
1618                }
1619                setATkey(PART::aftertouchType::filterQ, o->value());}
1620        tooltip {Between current MIDI setting and max.} xywh {270 85 70 15} down_box DOWN_BOX
1621        class Fl_Check_Button2
1622      }
1623      Fl_Check_Button polyfilterQminus {
1624        label Down
1625        callback {//
1626                setATkey(PART::aftertouchType::filterQdown, o->value());}
1627        tooltip {Between current MIDI setting and zero} xywh {395 85 70 15} down_box DOWN_BOX deactivate
1628        class Fl_Check_Button2
1629      }
1630      Fl_Check_Button polypitchbend {
1631        label {Pitch Bend}
1632        callback {//
1633                if (o->value())
1634                    polypitchBminus->activate();
1635                else
1636                {
1637                    polypitchBminus->value(0);
1638                    polypitchBminus->deactivate();
1639                }
1640                setATkey(PART::aftertouchType::pitchBend, o->value());}
1641        tooltip {Between current pitch wheel position and max.} xywh {270 105 70 15} down_box DOWN_BOX
1642        class Fl_Check_Button2
1643      }
1644      Fl_Check_Button polypitchBminus {
1645        label Down
1646        callback {//
1647                setATkey(PART::aftertouchType::pitchBendDown, o->value());}
1648        tooltip {Between current pitch wheel position and min.} xywh {395 105 70 15} down_box DOWN_BOX deactivate
1649        class Fl_Check_Button2
1650      }
1651      Fl_Check_Button polymodulation {
1652        label Modulation
1653        callback {//
1654                setATkey(PART::aftertouchType::modulation, o->value());}
1655        tooltip {Between zero and Add/Pad frequency LFO depth} xywh {270 125 70 15} down_box DOWN_BOX
1656        class Fl_Check_Button2
1657      }
1658      Fl_Button atClose {
1659        label Close
1660        callback {//
1661        saveWin(synth, aftertouchcontrol->w(), aftertouchcontrol->h(), aftertouchcontrol->x(), aftertouchcontrol->y(), false, "Part-aftertouch");
1662        if ((Fl::event_button() == 3))
1663        {
1664            if (atSeen > 1)
1665                instrumenteditwindow->show();
1666            else
1667                ctlwindow->show();
1668        }
1669        atSeen = 0;
1670        aftertouchcontrol->hide();}
1671        xywh {420 154 50 20} box THIN_UP_BOX
1672      }
1673    }
1674  }
1675  Function {handle(int event)} {return_type int
1676  } {
1677    code {//
1678        int ret = Fl_Group::handle(event);
1679        switch(event)
1680        {
1681            case FL_FOCUS:
1682            case FL_UNFOCUS:
1683                ret = 1;
1684                break;
1685            case FL_SHORTCUT:           // in case widget that isn't ours has focus
1686            case FL_KEYDOWN:            // keyboard key pushed
1687            //case FL_KEYUP:              // keyboard key released
1688            {
1689                if (lastkey != Fl::event_key())
1690                {
1691                    lastkey = Fl::event_key();
1692                    //cout << "Key " << lastkey << endl;
1693                }
1694                break;
1695            }
1696            case FL_KEYUP:
1697            {
1698                if (lastkey == Fl::event_key())
1699                    lastkey = -1;
1700                break;
1701            }
1702        }
1703        return(ret);} {}
1704  }
1705  Function {send_data(int action, int control, float value, int type, int kititem = UNUSED, int engine = UNUSED, int insert = UNUSED, int parameter = UNUSED, int miscmsg = UNUSED)} {} {
1706    code {//
1707        type |= TOPLEVEL::type::Write;
1708        collect_data(synth, value, action, type, control, npart, kititem, engine, insert, parameter, UNUSED, miscmsg);} {}
1709  }
1710  Function {fetchData(float value, int control, int part, int kititem = UNUSED, int engine = UNUSED, int insert = UNUSED, int parameter = UNUSED, int offset = UNUSED, int miscmsg = UNUSED, int request = UNUSED)} {return_type float
1711  } {
1712    code {//
1713        return collect_readData(synth, value, control, part, kititem, engine, insert, parameter, offset, miscmsg, request);} {}
1714  }
1715  Function {returns_update(CommandBlock *getData)} {} {
1716    code {//
1717    float value = getData->data.value;
1718    unsigned char control = getData->data.control;
1719    unsigned char newpart = getData->data.part;
1720    unsigned char kititem = getData->data.kit;
1721    unsigned char engine = getData->data.engine;
1722    unsigned char insert = getData->data.insert;
1723    unsigned char parameter = getData->data.parameter;
1724    unsigned char miscmsg = getData->data.miscmsg;
1725    bool valBool = _SYS_::F2B(value);
1726    int valInt = lrint(value);
1727    string text;
1728    if (miscmsg != NO_MSG)
1729        text = textMsgBuffer.fetch(miscmsg);
1730
1731    // these are specific to the mixer panel
1732    if (newpart >= *plgroup && newpart < (*plgroup + NUM_MIDI_CHANNELS))
1733    {
1734        int displaypart = newpart % NUM_MIDI_CHANNELS;
1735        switch (control)
1736        {
1737            case PART::control::enable:
1738                synth->getGuiMaster()->panellistitem[displaypart]->partenabled->value(valBool);
1739                if (valBool)
1740                    synth->getGuiMaster()->panellistitem[displaypart]->panellistitemgroup->activate();
1741                else
1742                    synth->getGuiMaster()->panellistitem[displaypart]->panellistitemgroup->deactivate();
1743                break;
1744            case PART::control::volume:
1745                synth->getGuiMaster()->panellistitem[displaypart]->partvolume->value(value);
1746                break;
1747            case PART::control::panning:
1748                synth->getGuiMaster()->panellistitem[displaypart]->partpanning->value(value);
1749                break;
1750            case PART::control::midiChannel:
1751                synth->getGuiMaster()->panellistitem[displaypart]->partrcv->value(valInt & 0xf);
1752                if (valInt < (NUM_MIDI_CHANNELS - 1))
1753                    synth->getGuiMaster()->panellistitem[displaypart]->partrcv->textcolor(FL_BLACK);
1754                else
1755                    synth->getGuiMaster()->panellistitem[displaypart]->partrcv->textcolor(FL_WHITE);
1756                break;
1757            case PART::control::audioDestination:
1758                int send = valInt - 1;
1759                if (send < 0 or send > 2)
1760                    send = 0;
1761                synth->getGuiMaster()->panellistitem[displaypart]->audiosend->value(send);
1762        }
1763    }
1764    //std::cout << "reached npart " << int(npart) << "  new " << int(newpart) <<std::endl;
1765    if (npart != newpart)
1766        return;
1767    bool sameEff = (engine == ninseff);
1768    bool kitType = (insert == TOPLEVEL::insert::kitGroup);
1769    if (!kitType)
1770        kititem = 0;
1771    switch(control)
1772    {
1773        case PART::control::enable:
1774            partGroupEnable->value(valBool);
1775            if (valBool)
1776            {
1777                partgroupui->activate();
1778                toSysEfx->activate();
1779            }
1780            else
1781            {
1782                partgroupui->deactivate();
1783                toSysEfx->deactivate();
1784            }
1785            break;
1786        case PART::control::enableAdd:
1787            partkititem[kititem]->adcheck->value(valBool);
1788            if (valBool)
1789            {
1790                partkititem[kititem]->adeditbutton->activate();
1791                if (kititem == 0)
1792                {
1793                    adsynenabledcheck->value(1);
1794                    adeditbutton->activate();
1795                }
1796            }
1797            else
1798            {
1799                partkititem[kititem]->adeditbutton->deactivate();
1800                if (kititem == 0)
1801                {
1802                    adsynenabledcheck->value(0);
1803                    adeditbutton->deactivate();
1804                }
1805            }
1806            break;
1807        case PART::control::enableSub:
1808            partkititem[kititem]->subcheck->value(valBool);
1809            if (valBool)
1810            {
1811                partkititem[kititem]->subeditbutton->activate();
1812                if (kititem == 0)
1813                {
1814                    subsynenabledcheck->value(1);
1815                    subeditbutton->activate();
1816                }
1817            }
1818            else
1819            {
1820                partkititem[kititem]->subeditbutton->deactivate();
1821                if (kititem == 0)
1822                {
1823                    subsynenabledcheck->value(0);
1824                    subeditbutton->deactivate();
1825                }
1826            }
1827            break;
1828        case PART::control::enablePad:
1829            partkititem[kititem]->padcheck->value(valBool);
1830            if (valBool)
1831            {
1832                partkititem[kititem]->padeditbutton->activate();
1833                if (kititem ==0)
1834                {
1835                    padsynenabledcheck->value(1);
1836                    padeditbutton->activate();
1837                }
1838            }
1839            else
1840            {
1841                partkititem[kititem]->padeditbutton->deactivate();
1842                if (kititem ==0)
1843                {
1844                    padsynenabledcheck->value(0);
1845                    padeditbutton->deactivate();
1846                }
1847            }
1848            break;
1849        case PART::control::enableKitLine:
1850            partkititem[kititem]->enabledcheck->value(valBool);
1851            if (valBool)
1852                partkititem[kititem]->partkititemgroup->activate();
1853            else
1854                partkititem[kititem]->clearLine();
1855            break;
1856
1857        case PART::control::volume:
1858            partvol->value(value);
1859            break;
1860
1861        case PART::control::velocitySense:
1862            velocitysense->value(value);
1863            break;
1864
1865        case PART::control::panning:
1866            partpan->value(value);
1867            break;
1868
1869        case PART::control::velocityOffset:
1870            velocityoffset->value(value);
1871            break;
1872
1873        case PART::control::midiChannel:
1874            midich->value(valInt + 1);
1875            if (valInt < NUM_MIDI_CHANNELS)
1876                midich->textcolor(FL_BLACK);
1877            else
1878                midich->textcolor(FL_WHITE);
1879            break;
1880
1881        case PART::control::keyMode:
1882            modepatch->color(29);
1883            if (valInt > 1)
1884            {
1885                keymode->value(2);
1886                if (drumMode->value())
1887                    modepatch->color(91);
1888            }
1889            else
1890                keymode->value(valInt);
1891            modepatch->redraw();
1892            break;
1893        case PART::control::channelATset:
1894            channelATselection = valInt;
1895            fetchChannel();
1896            if (parameter != UNUSED)
1897            {
1898                keyATselection = parameter;
1899                fetchKey();
1900            }
1901            break;
1902        case PART::control::keyATset:
1903            keyATselection = valInt;
1904            fetchKey();
1905            if (parameter != UNUSED)
1906            {
1907                channelATselection = parameter;
1908                fetchChannel();
1909            }
1910            break;
1911
1912        case PART::control::portamento:
1913            enportamento->value(valBool);
1914            break;
1915
1916        case PART::control::kitItemMute:
1917            partkititem[kititem]->mutedcheck->value(valBool);
1918            break;
1919        case PART::control::minNote:
1920        case PART::control::minToLastKey: // this will have been modified for last key press
1921            if (kitType)
1922               partkititem[kititem]->minkcounter->value(valInt);
1923            else
1924                minkcounter->value(valInt);
1925            break;
1926
1927        case PART::control::maxNote:
1928        case PART::control::maxToLastKey: // this will have been modified for last key press
1929            if (kitType)
1930                partkititem[kititem]->maxkcounter->value(valInt);
1931            else
1932                maxkcounter->value(valInt);
1933            break;
1934
1935        case PART::control::resetMinMaxKey:
1936            if (kitType)
1937            {
1938                partkititem[kititem]->minkcounter->value(0);
1939                partkititem[kititem]->maxkcounter->value(127);
1940            }
1941            else
1942            {
1943                minkcounter->value(0);
1944                maxkcounter->value(127);
1945            }
1946            break;
1947
1948        case PART::control::kitEffectNum:
1949            partkititem[kititem]->sendtoeffect->value(valInt);
1950            break;
1951
1952        case PART::control::maxNotes:
1953            partkeylimit->value(valInt);
1954            break;
1955
1956        case PART::control::keyShift:
1957            partkeyshift->value(valInt);
1958            break;
1959
1960        case PART::control::partToSystemEffect1:
1961        case PART::control::partToSystemEffect2:
1962        case PART::control::partToSystemEffect3:
1963        case PART::control::partToSystemEffect4:
1964            psyef[control - PART::control::partToSystemEffect1]->sysend->value(value);
1965            break;
1966
1967        case PART::control::humanise:
1968            humanise->value(valInt);
1969            break;
1970
1971        case PART::control::humanvelocity:
1972            velocityhumanise->value(valInt);
1973            break;
1974
1975
1976        case PART::control::drumMode:
1977            drumMode->value(valBool);
1978            if (valBool && keymode->value() > 1)
1979                modepatch->color(91);
1980            else
1981                modepatch->color(29);
1982            modepatch->redraw();
1983            break;
1984
1985        case PART::control::kitMode:
1986            kitMode->value(valInt);
1987            partKitOn =  (kitMode->value() > 0);
1988            if (partKitOn > 0)
1989                kitlist->activate();
1990            else
1991                kitlist->deactivate();
1992            break;
1993
1994        case PART::control::effectNumber:
1995            if (sameEff)
1996                inseffectui->UpdatePresetColour(parameter, insefftype->value());
1997            else
1998                lastfxW = 0;
1999            break;
2000
2001        case PART::control::effectType:
2002            if (sameEff)
2003            {
2004                insefftype->value(valInt);
2005                part->partefx[engine]->geteffect();
2006                inseffectui->UpdatePresetColour(parameter, insefftype->value());
2007                inseffectui->refresh(part->partefx[engine], npart, engine);
2008                fxRtext();
2009            }
2010            break;
2011
2012        case PART::control::effectDestination:
2013            if (sameEff)
2014                sendtochoice->value(valInt);
2015            break;
2016
2017        case PART::control::effectBypass:
2018            if (sameEff)
2019                bypasseff->value(valBool);
2020            break;
2021
2022// controllers
2023        case PART::control::volumeRange:
2024            volrng->value(valInt);
2025            break;
2026
2027        case PART::control::volumeEnable:
2028            vol->value(valInt);
2029            break;
2030
2031        case PART::control::panningWidth:
2032            panwidth->value(valInt);
2033            break;
2034
2035        case PART::control::modWheelDepth:
2036            modwh->value(valInt);
2037            break;
2038
2039        case PART::control::exponentialModWheel:
2040            expmwh->value(valInt);
2041            break;
2042
2043        case PART::control::bandwidthDepth:
2044            bwdpth->value(valInt);
2045            break;
2046
2047        case PART::control::exponentialBandwidth:
2048            expbw->value(valInt);
2049            break;
2050
2051        case PART::control::expressionEnable:
2052            expr->value(valInt);
2053            break;
2054
2055        case PART::control::FMamplitudeEnable:
2056            fmamp->value(valInt);
2057            break;
2058
2059        case PART::control::sustainPedalEnable:
2060            sustain->value(valInt);
2061            break;
2062
2063        case PART::control::pitchWheelRange:
2064            pwheelbrng->value(valInt);
2065            break;
2066
2067        case PART::control::filterQdepth:
2068            filtq->value(valInt);
2069            break;
2070
2071        case PART::control::filterCutoffDepth:
2072            fltcut->value(valInt);
2073            break;
2074
2075        case PART::control::breathControlEnable:
2076            breath->value(valBool);
2077            break;
2078
2079        case PART::control::resonanceCenterFrequencyDepth:
2080            cfdpth->value(valInt);
2081            break;
2082
2083        case PART::control::resonanceBandwidthDepth:
2084            rbwdpth->value(valInt);
2085            break;
2086
2087        case PART::control::portamentoTime:
2088            prtime->value(valInt);
2089            break;
2090
2091        case PART::control::portamentoTimeStretch:
2092            timedu->value(valInt);
2093            break;
2094
2095        case PART::control::portamentoThreshold:
2096            thresh->value(valInt);
2097            break;
2098
2099        case PART::control::portamentoThresholdType:
2100            thtype->value(valInt);
2101            break;
2102
2103        case PART::control::enableProportionalPortamento:
2104            proprt->value(valInt);
2105            if (value != 0)
2106            {
2107                propta->activate();
2108                proptb->activate();
2109            }
2110            else
2111            {
2112                propta->deactivate();
2113                proptb->deactivate();
2114            }
2115            break;
2116
2117        case PART::control::proportionalPortamentoRate:
2118            propta->value(valInt);
2119            break;
2120
2121        case PART::control::proportionalPortamentoDepth:
2122            proptb->value(valInt);
2123            break;
2124
2125        case PART::control::receivePortamento:
2126            rcv->value(valInt);
2127            break;
2128
2129        case PART::control::midiModWheel:
2130            modulation->value(value);
2131            break;
2132        case PART::control::midiExpression:
2133            expression->value(value);
2134            break;
2135        case PART::control::midiFilterQ:
2136            filterq->value(value);
2137            break;
2138        case PART::control::midiFilterCutoff:
2139            filtercutoff->value(value);
2140            break;
2141        case PART::control::midiBandwidth:
2142            masterbandwidth->value(value);
2143            break;
2144
2145        case PART::control::instrumentCopyright:
2146            copyright->value("");
2147            copyright->value(text.c_str());
2148            break;
2149        case PART::control::instrumentComments:
2150            commentField->value("");
2151            commentField->value(text.c_str());
2152            break;
2153        case PART::control::instrumentName:
2154            if (!kitType)
2155                checkEngines(text);
2156            else
2157                partkititem[kititem]->labelbutton->copy_label(text.c_str());
2158            break;
2159        case PART::control::instrumentType:
2160            instrumentType->value(value);
2161            break;
2162        case PART::control::defaultInstrumentCopyright:
2163            if (parameter == 0)
2164                copyright->value(text.c_str());
2165            break;
2166        case PART::control::resetAllControllers:
2167            updatecontrollers();
2168            break;
2169        default:
2170            break;
2171    }
2172    if (control == PART::control::enableAdd || control == PART::control::enableSub || control == PART::control::enablePad)
2173    checkEngines();} {}
2174  }
2175  Function {PartUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
2176    code {//
2177    part = NULL;
2178    adnoteui = NULL;
2179    subnoteui = NULL;
2180    padnoteui = NULL;
2181    editSeen = false;
2182    fxSeen = false;
2183    kitSeen = false;
2184    ctlSeen = false;
2185    ctlmidiSeen = false;
2186    atSeen = false;
2187    lastfxW = 0;
2188    lastkitW = 0;
2189    lastmidiW = 0;
2190    lastatW = 0;
2191    lastkititem = -1;} {}
2192  }
2193  Function {fillInstrumentType()} {} {
2194    code {//
2195
2196        int i = 0;
2197        string entry = type_list[i];
2198        while (entry != "@end")
2199        {
2200            instrumentType->add(entry.c_str());
2201            ++ i;
2202            entry = type_list[i];
2203        }} {}
2204  }
2205  Function {updatecontrollers()} {} {
2206    code {//
2207    enportamento->value(0);
2208    keymode->value(part->Pkeymode & MIDI_NOT_LEGATO);
2209    expmwh->value(part->ctl->modwheel.exponential);
2210    modwh->value(part->ctl->modwheel.depth);
2211    expbw->value(part->ctl->bandwidth.exponential);
2212    bwdpth->value(part->ctl->bandwidth.depth);
2213    pwheelbrng->value(part->ctl->pitchwheel.bendrange);
2214    panwidth->value(part->ctl->panning.depth);
2215    filtq->value(part->ctl->filterq.depth);
2216    fltcut->value(part->ctl->filtercutoff.depth);
2217    volrng->value(part->ctl->volume.data);
2218    expr->value(part->ctl->expression.receive);
2219    fmamp->value(part->ctl->fmamp.receive);
2220    vol->value(part->ctl->volume.receive);
2221    sustain->value(part->ctl->sustain.receive);
2222
2223    cfdpth->value(part->ctl->resonancecenter.depth);
2224    rbwdpth->value(part->ctl->resonancebandwidth.depth);
2225
2226    rcv->value(part->ctl->portamento.receive);
2227    thresh->value(part->ctl->portamento.pitchthresh);
2228    propta->value(part->ctl->portamento.propRate);
2229    proprt->value(part->ctl->portamento.proportional);
2230    if (proprt->value())
2231    {
2232        propta->activate();
2233        proptb->activate();
2234    }
2235    else
2236    {
2237        propta->deactivate();
2238        proptb->deactivate();
2239    }
2240    prtime->value(part->ctl->portamento.time);
2241    timedu->value(part->ctl->portamento.updowntimestretch);
2242    thtype->value(part->ctl->portamento.pitchthreshtype);
2243    proptb->value(part->ctl->portamento.propDepth);} {}
2244  }
2245  Function {fetchChannel()} {} {
2246    code {//
2247            channelfiltercutoff->value(0); // clear settings first
2248            channelfilterCminus->value(0);
2249            channelfilterCminus->deactivate();
2250            channelfilterQ->value(0);
2251            channelfilterQminus->value(0);
2252            channelfilterQminus->deactivate();
2253            channelpitchbend->value(0);
2254            channelpitchBminus->value(0);
2255            channelpitchBminus->deactivate();
2256            channelmodulation->value(0);
2257            channelvolume->value(0);
2258
2259
2260    if (channelATselection & PART::aftertouchType::filterCutoff)
2261    {
2262         channelfiltercutoff->value(1);
2263         channelfilterCminus->activate();
2264         if (channelATselection & PART::aftertouchType::filterCutoffDown)
2265             channelfilterCminus->value(1);
2266    }
2267    if (channelATselection & PART::aftertouchType::filterQ)
2268    {
2269         channelfilterQ->value(1);
2270         channelfilterQminus->activate();
2271         if (channelATselection & PART::aftertouchType::filterQdown)
2272             channelfilterQminus->value(1);
2273    }
2274    if (channelATselection & PART::aftertouchType::pitchBend)
2275    {
2276        channelpitchbend->value(1);
2277         channelpitchBminus->activate();
2278        if (channelATselection & PART::aftertouchType::pitchBendDown)
2279            channelpitchBminus->value(1);
2280    }
2281    if (channelATselection & PART::aftertouchType::modulation)
2282        channelmodulation->value(1);
2283    if (channelATselection & PART::aftertouchType::volume)
2284        channelvolume->value(1);} {}
2285  }
2286  Function {fetchKey()} {} {
2287    code {//
2288            polyfiltercutoff->value(0); // clear settings first
2289            polyfilterCminus->value(0);
2290            polyfilterCminus->deactivate();
2291            polyfilterQ->value(0);
2292            polyfilterQminus->value(0);
2293            polyfilterQminus->deactivate();
2294            polypitchbend->value(0);
2295            polypitchBminus->value(0);
2296            polypitchBminus->deactivate();
2297            polymodulation->value(0);
2298
2299    if (keyATselection & PART::aftertouchType::filterCutoff)
2300    {
2301         polyfiltercutoff->value(1);
2302         polyfilterCminus->activate();
2303         if (keyATselection & PART::aftertouchType::filterCutoffDown)
2304             polyfilterCminus->value(1);
2305    }
2306    if (keyATselection & PART::aftertouchType::filterQ)
2307    {
2308         polyfilterQ->value(1);
2309         polyfilterQminus->activate();
2310         if (keyATselection & PART::aftertouchType::filterQdown)
2311             polyfilterQminus->value(1);
2312    }
2313    if (keyATselection & PART::aftertouchType::pitchBend)
2314    {
2315        polypitchbend->value(1);
2316         polypitchBminus->activate();
2317        if (keyATselection & PART::aftertouchType::pitchBendDown)
2318            polypitchBminus->value(1);
2319    }
2320    if (keyATselection & PART::aftertouchType::modulation)
2321        polymodulation->value(1);} {}
2322  }
2323  Function {setATchannel(int type, int state)} {} {
2324    code {//
2325        if (type == PART::aftertouchType::off)
2326            channelATselection = 0;
2327        else
2328        {
2329            if (state > 0)
2330            {
2331                channelATselection |= type;
2332                if (keyATselection & type)
2333                {
2334                    keyATselection &= ~type;
2335                    fetchKey();
2336                }
2337
2338            }
2339            else
2340            {
2341                channelATselection &= ~type;
2342                if (type == PART::aftertouchType::filterCutoff)
2343                    channelATselection &= ~PART::aftertouchType::filterCutoffDown;
2344                else if (type == PART::aftertouchType::pitchBend)
2345                    channelATselection &= ~PART::aftertouchType::pitchBendDown;
2346            }
2347        }
2348        send_data(0, PART::channelATset, channelATselection, TOPLEVEL::type::Integer);} {}
2349  }
2350  Function {setATkey(int type, int state)} {} {
2351    code {//
2352        if (type == PART::aftertouchType::off)
2353            keyATselection = 0;
2354        else
2355        {
2356            if (state > 0)
2357            {
2358                keyATselection |= type;
2359                if (channelATselection & type)
2360                {
2361                    channelATselection &= ~type;
2362                    fetchChannel();
2363                }
2364            }
2365            else
2366            {
2367                keyATselection &= ~type;
2368                if (type == PART::aftertouchType::filterCutoff)
2369                    keyATselection &= ~PART::aftertouchType::filterCutoffDown;
2370                else if (type == PART::aftertouchType::pitchBend)
2371                    keyATselection &= ~PART::aftertouchType::pitchBendDown;
2372            }
2373        }
2374        send_data(0, PART::keyATset, keyATselection, TOPLEVEL::type::Integer);} {}
2375  }
2376  Function {init(Part *part_,int npart_,BankUI *bankui_)} {} {
2377    code {//
2378    synth = part_->getSynthEngine();
2379    bankui = bankui_;
2380    part = part_;
2381    npart = npart_;
2382    plgroup = &synth->getGuiMaster()->panelgroup;
2383    ninseff = 0;
2384    make_window();
2385    partgroup->position(this->parent()->x() + 2, this->parent()->y() + 2);
2386    int efftype = fetchData(0, PART::control::effectType, npart, UNUSED, 0, TOPLEVEL::insert::partEffectSelect);
2387    if (efftype > 0)
2388    {
2389        bool status = fetchData(0, 200, npart, efftype + EFFECT::type::none, ninseff);
2390        inseffectui->UpdatePresetColour(status, insefftype->value());
2391    }
2392
2393    channelATselection = int(fetchData(0, PART::control::channelATset, npart));
2394    int tmp = int(fetchData(0, PART::control::humanise, npart));
2395    humanise->value(tmp); // will inc number
2396    tmp = int(fetchData(0, PART::control::humanvelocity, npart));
2397    velocityhumanise->value(tmp); // will inc number
2398
2399    fetchChannel();
2400    keyATselection = int(fetchData(0, PART::control::keyATset, npart));
2401    fetchKey();
2402
2403    string name = part->Poriginal;
2404    if (!name.empty() && part->Pname != name)
2405    {
2406        originaltext->copy_label(name.c_str());
2407        originalname->show();
2408        originaltext->show();
2409    }
2410    else
2411    {
2412        originalname->hide();
2413        originaltext->hide();
2414    }
2415    partgroup->show();
2416    lastkey = -1;
2417    lasteditW = 0;
2418    lastctlW = 0;
2419    end();} {}
2420  }
2421  Function {checkEngines(string instrumentName = "")} {} {
2422    code {//
2423    engine = 0;
2424    if (instrumentName == "")
2425        instrumentName = part->Pname;
2426    partname = instrumentName; // this needs improving
2427
2428    if (adsynenabledcheck->value())
2429        addbox->color(ADD_COLOUR);
2430    else
2431        addbox->color(BASE_COLOUR);
2432    ADD->damage(1);
2433    if (subsynenabledcheck->value())
2434        subbox->color(SUB_COLOUR);
2435    else
2436        subbox->color(BASE_COLOUR);
2437    SUB->damage(1);
2438    if (padsynenabledcheck->value())
2439        padbox->color(PAD_COLOUR);
2440    else
2441        padbox->color(BASE_COLOUR);
2442    PAD->damage(1);
2443    for (int i = 0; i < NUM_KIT_ITEMS; ++i)
2444    {
2445        if (partkititem[i]->enabledcheck->value())
2446        { // nested so we don't access non existent
2447            if (partkititem[i]->mutedcheck->value() == 0)
2448            {
2449                engine |= partkititem[i]->adcheck->value();
2450                engine |= (partkititem[i]->subcheck->value() << 1);
2451                engine |= (partkititem[i]->padcheck->value() << 2);
2452            }
2453        }
2454    }
2455
2456    if (engine & 1) // addsynth
2457        instrumentaddbox->color(ADD_COLOUR);
2458    else
2459        instrumentaddbox->color(BASE_COLOUR);
2460    if (engine & 2) // subynth
2461        instrumentsubbox->color(SUB_COLOUR);
2462    else
2463        instrumentsubbox->color(BASE_COLOUR);
2464    if (engine & 4) // padsynth
2465        instrumentpadbox->color(PAD_COLOUR);
2466    else
2467        instrumentpadbox->color(BASE_COLOUR);
2468
2469    instrumentaddbox->damage(1);
2470    instrumentsubbox->damage(1);
2471    instrumentpadbox->damage(1);
2472    instrumentlabel->copy_label(instrumentName.c_str());
2473
2474    if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
2475    {
2476        int num = npart % NUM_MIDI_CHANNELS;
2477        if (engine & 1)
2478            synth->getGuiMaster()->panellistitem[num]->partadd->color(ADD_COLOUR);
2479        else
2480            synth->getGuiMaster()->panellistitem[num]->partadd->color(BASE_COLOUR);
2481        if (engine & 2)
2482            synth->getGuiMaster()->panellistitem[num]->partsub->color(SUB_COLOUR);
2483        else
2484            synth->getGuiMaster()->panellistitem[num]->partsub->color(BASE_COLOUR);
2485        if (engine & 4)
2486            synth->getGuiMaster()->panellistitem[num]->partpad->color(PAD_COLOUR);
2487        else
2488            synth->getGuiMaster()->panellistitem[num]->partpad->color(BASE_COLOUR);
2489
2490        synth->getGuiMaster()->panellistitem[num]->partadd->damage(1);
2491        synth->getGuiMaster()->panellistitem[num]->partsub->damage(1);
2492        synth->getGuiMaster()->panellistitem[num]->partpad->damage(1);
2493        synth->getGuiMaster()->panellistitem[num]->partname->copy_label(instrumentName.c_str());
2494    }} {}
2495  }
2496  Function {showparameters(int kititem, int engine)} {} {
2497    code {//
2498    string tname;
2499    kitname = part->kit[kititem].Pname;
2500    if (engine == -1)
2501    {   // this is used if I want to clear the engine from the part
2502        if (kititem == lastkititem)
2503            kititem = -1;
2504        else
2505            kititem = lastkititem;
2506    }
2507    checkEngines();
2508
2509    if (kititem != lastkititem)
2510    {
2511        if (adnoteui != NULL)
2512            delete adnoteui;
2513        if (subnoteui != NULL)
2514            delete subnoteui;
2515        if (padnoteui != NULL)
2516            delete padnoteui;
2517        adnoteui = NULL;
2518        subnoteui = NULL;
2519        padnoteui = NULL;
2520        lastkititem = kititem;
2521        if (kititem >= NUM_KIT_ITEMS)
2522            return; // bad kit item
2523        if (kititem < 0)
2524            return;
2525
2526        if (part->kit[kititem].adpars)
2527            adnoteui = new ADnoteUI(part->kit[kititem].adpars, npart, lastkititem);
2528
2529        if (part->kit[kititem].subpars)
2530            subnoteui = new SUBnoteUI(part->kit[kititem].subpars, npart, lastkititem);
2531
2532        if (part->kit[kititem].padpars)
2533            padnoteui = new PADnoteUI(part->kit[kititem].padpars, npart, lastkititem);
2534    }
2535
2536    if (engine == 0 && adnoteui != NULL)
2537        adnoteui->ShowGlobal();
2538    if (engine == 1 && subnoteui != NULL)
2539        subnoteui->Showsub();
2540    if (engine == 2 && padnoteui != NULL)
2541        padnoteui->Showpad();} {}
2542  }
2543  Function {setinstrumentlabel(string text = "")} {} {
2544    code {//
2545    engine = 0;
2546
2547    for (int i = 0; i < NUM_KIT_ITEMS; ++i)
2548    {
2549        if (part->kit[i].Padenabled)
2550            engine |= 1;
2551        if (part->kit[i].Psubenabled)
2552            engine |= 2;
2553        if (part->kit[i].Ppadenabled)
2554            engine |= 4;
2555    }
2556    if (engine & 1)
2557        instrumentaddbox->color(ADD_COLOUR);
2558    else
2559        instrumentaddbox->color(BASE_COLOUR);
2560    if (engine & 2)
2561        instrumentsubbox->color(SUB_COLOUR);
2562    else
2563        instrumentsubbox->color(BASE_COLOUR);
2564
2565    if (engine & 4)
2566        instrumentpadbox->color(PAD_COLOUR);
2567    else
2568        instrumentpadbox->color(BASE_COLOUR);
2569
2570    if (part->PyoshiType)
2571        instrumentlabel->labelcolor(YOSHI_COLOUR);
2572    else
2573        instrumentlabel->labelcolor(FL_BLACK);
2574    if (text == "")
2575        text = part->Pname.c_str();
2576    partname = text;
2577    instrumentlabel->copy_label(text.c_str());} {}
2578  }
2579  Function {seteditname()} {} {
2580    code {//
2581    instrumenteditwindow->copy_label(synth->getGuiMaster()->setPartWindowTitle("Edit").c_str());} {}
2582  }
2583  Function {Showedit()} {} {
2584    code {//
2585    int fetchW, fetchH, fetchX, fetchY, fetchO;
2586    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-edit");
2587
2588    if (fetchW < editDW || fetchH < editDH)
2589    {
2590        fetchW = editDW;
2591        fetchH = editDH;
2592    }
2593    checkSane(fetchX, fetchY, fetchW, fetchH, editDW, editDH);
2594
2595    instrumenteditwindow->resize(fetchX, fetchY, fetchW, fetchH);
2596    lasteditW = 0;
2597    instrumenteditwindow->show();
2598    editSeen = true;} {}
2599  }
2600  Function {Showctl()} {} {
2601    code {//
2602    int fetchW, fetchH, fetchX, fetchY, fetchO;
2603    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-controllers");
2604
2605    if (fetchW < ctlDW || fetchH < ctlDH)
2606    {
2607        fetchW = ctlDW;
2608        fetchH = ctlDH;
2609    }
2610    checkSane(fetchX, fetchY, fetchW, fetchH, ctlDW, ctlDH);
2611
2612    ctlwindow->resize(fetchX, fetchY, fetchW, fetchH);
2613    lastctlW = 0;
2614    ctlwindow->show();
2615    ctlSeen = true;} {}
2616  }
2617  Function {ShowAT()} {} {
2618    code {//
2619    int fetchW, fetchH, fetchX, fetchY, fetchO;
2620    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-aftertouch");
2621
2622    if (fetchW < atDW || fetchH < atDH)
2623    {
2624        fetchW = atDW;
2625        fetchH = atDH;
2626    }
2627    checkSane(fetchX, fetchY, fetchW, fetchH, atDW, atDH);
2628
2629    aftertouchcontrol->resize(fetchX, fetchY, fetchW, fetchH);
2630    aftertouchcontrol->show();} {}
2631  }
2632  Function {Showctlmidi()} {} {
2633    code {//
2634    int fetchW, fetchH, fetchX, fetchY, fetchO;
2635    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-ctlmidi");
2636
2637    if (fetchW < midiDW || fetchH < midiDH)
2638    {
2639        fetchW = midiDW;
2640        fetchH = midiDH;
2641    }
2642    checkSane(fetchX, fetchY, fetchW, fetchH, midiDW, midiDH, true);
2643
2644    ctlmidi->resize(fetchX, fetchY, fetchW, fetchH);
2645    ctlmidi->show();
2646    ctlmidiSeen = true;} {}
2647  }
2648  Function {ctlmidirefresh()} {} {
2649    code {//
2650    modulation->value(part->ctl->modwheel.data);
2651    expression->value(part->ctl->expression.data);
2652    filterq->value(part->ctl->filterq.data);
2653    filtercutoff->value(part->ctl->filtercutoff.data);
2654    masterbandwidth->value(part->ctl->bandwidth.data);} {}
2655  }
2656  Function {Showefx()} {} {
2657    code {//
2658    int fetchW, fetchH, fetchX, fetchY, fetchO;
2659    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-effects");
2660
2661    if (fetchW < fxDW || fetchH < fxDH)
2662    {
2663        fetchW = fxDW;
2664        fetchH = fxDH;
2665    }
2666    checkSane(fetchX, fetchY, fetchW, fetchH, fxDW, fxDH);
2667
2668    partfx->resize(fetchX, fetchY, fetchW, fetchH);
2669    partfx->show();
2670    fxSeen = true;} {}
2671  }
2672  Function {Showkit()} {} {
2673    code {//
2674    int fetchW, fetchH, fetchX, fetchY, fetchO;
2675    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-kit");
2676
2677    if (fetchW < kitDW || fetchH < kitDH)
2678    {
2679        fetchW = kitDW;
2680        fetchH = kitDH;
2681    }
2682    checkSane(fetchX, fetchY, fetchW, fetchH, kitDW, kitDH);
2683
2684    instrumentkitlist->resize(fetchX, fetchY, fetchW, fetchH);
2685    instrumentkitlist->show();
2686    kitSeen = true;} {}
2687  }
2688  Function {wincheck()} {} {
2689    code {//
2690    if (instrumenteditwindow->visible())
2691        editRtext();
2692
2693    if (partfx->visible())
2694    {
2695    	if (insefftype->value() == 8) // dynfilter
2696    	{
2697            if(inseffectui->filterwindow != NULL)
2698            {
2699                if(inseffectui->filterwindow->visible())
2700                    inseffectui->filtRtext();
2701            }
2702        }
2703        if ( partfx->w() != lastfxW)
2704        {
2705            fxRtext();
2706            lastfxW = partfx->w();
2707        }
2708    }
2709
2710
2711    if (instrumentkitlist->visible() && instrumentkitlist->w() != lastkitW)
2712    {
2713        kitRtext();
2714        lastkitW = instrumentkitlist->w();
2715    }
2716    if (ctlwindow->visible())
2717        ctlRtext();
2718
2719    if (ctlmidi->visible() && ctlmidi->w() != lastmidiW)
2720    {
2721        ctlmidiRtext();
2722        lastmidiW = ctlmidi->w();
2723    }
2724    if (aftertouchcontrol->visible() && aftertouchcontrol->w() != lastatW)
2725    {
2726        ATRtext();
2727        lastatW = aftertouchcontrol->w();
2728    }
2729
2730    if (adnoteui)
2731        adnoteui->wincheck();
2732    if (subnoteui)
2733        subnoteui->subRtext();
2734    if (padnoteui)
2735        padnoteui->padRtext();} {}
2736  }
2737  Function {editRtext()} {} {
2738    code {//
2739    if (lasteditW == instrumenteditwindow->w())
2740        return;
2741    lasteditW = instrumenteditwindow->w();
2742
2743    float dScale = instrumenteditwindow->w() / float(editDW);
2744    if (dScale < 0.2f)
2745        dScale = 0.2f;
2746
2747    int size = int(10 * dScale);
2748    int size11 = int(11 * dScale);
2749    int size12 = int(12 * dScale);
2750    int size14 = int(14 * dScale);
2751    int boxY = int(227 * dScale);
2752    int boxWidth = int(89 * dScale);
2753    int boxHeight = int(18 * dScale);
2754
2755    ADD->labelsize(size14);
2756    addbox->resize(int(10 * dScale), boxY, boxWidth, boxHeight);
2757    adsynenabledcheck->labelsize(size11);
2758    adeditbutton->labelsize(size14);
2759
2760    SUB->labelsize(size14);
2761    subbox->resize(int(110 * dScale), boxY, boxWidth, boxHeight);
2762    subsynenabledcheck->labelsize(size11);
2763    subeditbutton->labelsize(size14);
2764
2765    PAD->labelsize(size14);
2766    padbox->resize(int(210 * dScale), boxY, boxWidth, boxHeight);
2767    padsynenabledcheck->labelsize(size11);
2768    padeditbutton->labelsize(size14);
2769
2770    kitedit->labelsize(size14);
2771    effects->labelsize(size14);
2772
2773    A_C_display->labelsize(size12);
2774    A_C_default->labelsize(size12);
2775    copyright->labelsize(size12);
2776        copyright->textsize(size14);
2777    commentField->labelsize(size12);
2778        commentField->textsize(size14);
2779    originalname->labelsize(size12);
2780    originaltext->labelsize(size12);
2781    instrumentType->labelsize(size11);
2782        instrumentType->textsize(size11);
2783
2784    humanise->labelsize(size12);
2785        humanise->textsize(size);
2786
2787    velocityhumanise->labelsize(size12);
2788        velocityhumanise->textsize(size);
2789    editAT->labelsize(size14);
2790    editClose->labelsize(size14);
2791    humanise_display->labelsize(size14);
2792
2793    instrumenteditwindow->redraw();} {}
2794  }
2795  Function {ctlRtext()} {} {
2796    code {//
2797    if (lastctlW == ctlwindow->w())
2798        return;
2799    lastctlW = ctlwindow->w();
2800
2801    float dScale =  ctlwindow->w() / float(ctlDW);
2802    if (dScale < 0.2f)
2803        dScale = 0.2f;
2804
2805    int size = int(dScale * 10);
2806    int size14 = int(dScale * 14);
2807
2808    volrng->labelsize(size);
2809    vol->labelsize(size);
2810    panwidth->labelsize(size);
2811    modwh->labelsize(size);
2812    expmwh->labelsize(size);
2813    bwdpth->labelsize(size);
2814    expbw->labelsize(size);
2815    expr->labelsize(size);
2816    fmamp->labelsize(size);
2817    sustain->labelsize(size);
2818    breath->labelsize(size);
2819    pwheelbrng->labelsize(size);
2820    pwheelbrng->textsize(size14);
2821    filtq->labelsize(size);
2822    fltcut->labelsize(size);
2823
2824    ctlresonance->labelsize(size);
2825    cfdpth->labelsize(size);
2826    rbwdpth->labelsize(size);
2827
2828    ctlportamento->labelsize(size);
2829    ctlx100->labelsize(size);
2830    prtime->labelsize(size);
2831    timedu->labelsize(size);
2832    thresh->labelsize(size);
2833    thresh->textsize(size14);
2834    thtype->labelsize(size);
2835    propta->labelsize(size);
2836    proptb->labelsize(size);
2837    rcv->labelsize(size);
2838    proprt->labelsize(size);
2839
2840    resetallctl->labelsize(size14);
2841    aftertouch->labelsize(size14);
2842    ctlclose->labelsize(size14);
2843    ctlwindow->redraw();} {}
2844  }
2845  Function {ATRtext()} {} {
2846    code {//
2847    float dScale =  aftertouchcontrol->w() / float(atDW);
2848    if (dScale < 0.2f)
2849        dScale = 0.2f;
2850
2851    int size14 = int(dScale * 14);
2852
2853    ATchan->labelsize(size14);
2854    channeloff->labelsize(size14);
2855    channelfiltercutoff->labelsize(size14);
2856    channelfilterCminus->labelsize(size14);
2857    channelfilterQ->labelsize(size14);
2858    channelfilterQminus->labelsize(size14);
2859    channelpitchbend->labelsize(size14);
2860    channelpitchBminus->labelsize(size14);
2861    channelmodulation->labelsize(size14);
2862    channelvolume->labelsize(size14);
2863
2864    ATkey->labelsize(size14);
2865    polyoff->labelsize(size14);
2866    polyfiltercutoff->labelsize(size14);
2867    polyfilterCminus->labelsize(size14);
2868    polyfilterQ->labelsize(size14);
2869    polyfilterQminus->labelsize(size14);
2870    polypitchbend->labelsize(size14);
2871    polypitchBminus->labelsize(size14);
2872    polymodulation->labelsize(size14);
2873
2874    atClose->labelsize(size14);
2875
2876    aftertouchcontrol->redraw();} {}
2877  }
2878  Function {ctlmidiRtext()} {} {
2879    code {//
2880    float dScale = ctlmidi->w() / float(midiDW);
2881    if (dScale < 0.2f)
2882        dScale = 0.2f;
2883
2884    int size = int(dScale * 10);
2885
2886    modulation->labelsize(size);
2887    expression->labelsize(size);
2888    filterq->labelsize(size);
2889    filtercutoff->labelsize(size);
2890    masterbandwidth->labelsize(size);
2891    ctlmidiclose->labelsize(int(dScale * 14)-1);
2892
2893    ctlmidi->redraw();} {}
2894  }
2895  Function {fxRtext()} {} {
2896    code {//
2897    float dScale =  partfx->w() / float(fxDW);
2898    if (dScale < 0.2f)
2899        dScale = 0.2f;
2900
2901    int size12 = int(12 * dScale);
2902    inseffnocounter->labelsize(size12);
2903        inseffnocounter->textsize(size12);
2904    insefftype->labelsize(size12);
2905        insefftype->textsize(size12);
2906    sendtochoice->labelsize(size12);
2907        sendtochoice->textsize(size12);
2908
2909    effCopy->labelsize(size12);
2910    effPaste->labelsize(size12);
2911    bypasseff->labelsize(size12);
2912    effClose->labelsize(int(14 * dScale));
2913
2914    inseffectui->effRtext(dScale, insefftype->value());
2915
2916    partfx->redraw();} {}
2917  }
2918  Function {kitRtext(bool force = false)} {} {
2919    code {//
2920    if (force)
2921    {
2922        int fetchW, fetchH, fetchX, fetchY, fetchO;
2923        loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "Part-kit");
2924        instrumentkitlist->resize(fetchX, fetchY, fetchW, fetchH);
2925        //kitSeen = true;
2926    };
2927
2928    float dW = instrumentkitlist->w() / float(kitDW);
2929    float dH = instrumentkitlist->h() / float(kitDH);
2930
2931    float dScale = dW;
2932    if (dScale < 0.2f)
2933        dScale = 0.2f;
2934
2935    int size11 = int(11 * dScale);
2936
2937    kitnum->labelsize(size11);
2938    kitmute->labelsize(size11);
2939    kitID->labelsize(size11);
2940    kitminkey->labelsize(size11);
2941    kitmaxkey->labelsize(size11);
2942    kitadd->labelsize(size11);
2943    kitsub->labelsize(size11);
2944    kitpad->labelsize(size11);
2945    kitfxnum->labelsize(size11);
2946    kitMode->labelsize(size11);
2947        kitMode->textsize(size11);
2948
2949    drumMode->labelsize(size11);
2950    kitClose->labelsize(int(12 * dScale));
2951
2952
2953   kitpack->resize(0, int(21.0f * dH), int(670.0f * dW), int(322.0f * dH));
2954
2955   for (int i = 0; i < NUM_KIT_ITEMS; ++i)
2956   {
2957       partkititem[i]->size(int(670.0f * dW), int(20.0f * dH));
2958       partkititem[i]->partkititemgroup->size(int(605.0f * dW), int(20.0f * dH));
2959       partkititem[i]->itemRtext(dScale);
2960   }
2961
2962    instrumentkitlist->redraw();} {}
2963  }
2964  Function {groupRtext(float dScale)} {} {
2965    code {//
2966    partgroup->resize(3 * dScale, 255 * dScale, 380 * dScale, 170 * dScale);
2967    //partgroupui->size(378 * dScale, 168 * dScale);
2968
2969    /* The above has to be numerically fixed as the relative size
2970     * can change when a part number is changed. The group is deleted
2971     * and re-creacted based on the *current* master window
2972    */
2973
2974    toSysEfx->size(122 * dScale, 39 * dScale);
2975
2976    for (int i = 0; i < NUM_SYS_EFX; ++ i)
2977    {
2978        psyef[i]->size(25 * dScale, 25 * dScale);
2979        psyef[i]->sysRsize(dScale);
2980    }
2981
2982    int size = int(10 * dScale);
2983    int size11 = int(11 * dScale);
2984    int size12 = int(12 * dScale);
2985    partedit->labelsize(size12);
2986    instrumentlabel->labelsize(size12);
2987    syseffname->labelsize(size);
2988    velocityoffset->labelsize(size);
2989    velocitysense->labelsize(size);
2990    partpan->labelsize(size);
2991    partvol->labelsize(size);
2992    enportamento->labelsize(size11);
2993    midich->labelsize(size11);
2994        midich->textsize(size11);
2995    keymode->textsize(size11);
2996    modepatch->labelsize(size11);
2997    partcontrollers->labelsize(size12);
2998    midiCCs->labelsize(size12);
2999    partkeyshift->labelsize(size);
3000        partkeyshift->textsize(size11);
3001    partkeylimit->labelsize(size);
3002        partkeylimit->textsize(size11);
3003    minkcounter->labelsize(size);
3004        minkcounter->textsize(size11);
3005    maxkcounter->labelsize(size);
3006        maxkcounter->textsize(size11);
3007    setmin->labelsize(size);
3008    setnorm->labelsize(size11);
3009    setmax->labelsize(size);
3010    partGroupEnable->labelsize(size11);
3011
3012    partgroup->redraw();} {}
3013  }
3014  Function {~PartUI()} {} {
3015    code {//
3016    if (adnoteui)
3017    {
3018        adnoteui->ADnoteGlobalParameters->hide();
3019        delete adnoteui;
3020    }
3021    if (subnoteui)
3022    {
3023        //subnoteui->hide();
3024        delete subnoteui;
3025    }
3026    if (padnoteui)
3027    {
3028        //padnoteui->hide();
3029        delete padnoteui;
3030    }
3031    partgroup->hide();
3032    if (atSeen > 0)
3033        saveWin(synth, aftertouchcontrol->w(), aftertouchcontrol->h(), aftertouchcontrol->x(), aftertouchcontrol->y(), true, "Part-aftertouch");
3034    aftertouchcontrol->hide();
3035    delete aftertouchcontrol;
3036
3037    if (ctlSeen)
3038        saveWin(synth, ctlwindow->w(), ctlwindow->h(), ctlwindow->x(), ctlwindow->y(), true, "Part-controllers");
3039    ctlwindow->hide();
3040    delete ctlwindow;
3041
3042    if (ctlmidiSeen)
3043        saveWin(synth, ctlmidi->w(), ctlmidi->h(), ctlmidi->x(), ctlmidi->y(), ctlmidi->visible(), "Part-ctlmidi");
3044    ctlmidi->hide();
3045    lastctlW = 0;
3046    delete ctlmidi;
3047
3048    if (kitSeen)
3049        saveWin(synth, instrumentkitlist->w(), instrumentkitlist->h(), instrumentkitlist->x(), instrumentkitlist->y(), true, "Part-kit");
3050    instrumentkitlist->hide();
3051    delete instrumentkitlist;
3052
3053    if (fxSeen)
3054        saveWin(synth,  partfx->w(), partfx->h(),  partfx->x(),  partfx->y(),  partfx->visible(), "Part-effects");
3055    partfx->hide();
3056    delete partfx;
3057
3058    if (editSeen)
3059        saveWin(synth, instrumenteditwindow->w(), instrumenteditwindow->h(), instrumenteditwindow->x(),instrumenteditwindow->y(), true, "Part-edit");
3060    instrumenteditwindow->hide();
3061    lasteditW = 0;
3062
3063    delete instrumenteditwindow;} {}
3064  }
3065  decl {Part *part;} {public local
3066  }
3067  decl {BankUI *bankui;} {private local
3068  }
3069  decl {ADnoteUI *adnoteui;} {public local
3070  }
3071  decl {SUBnoteUI *subnoteui;} {public local
3072  }
3073  decl {PADnoteUI *padnoteui;} {public local
3074  }
3075  decl {PartSysEffSend *psyef[NUM_SYS_EFX];} {private local
3076  }
3077  decl {int npart;} {public local
3078  }
3079  decl {int ninseff;} {public local
3080  }
3081  decl {int lastkititem;} {public local
3082  }
3083  decl {string partname;} {public local
3084  }
3085  decl {string kitname;} {public local
3086  }
3087  decl {PartKitItem *partkititem[NUM_KIT_ITEMS];} {public local
3088  }
3089  decl {SynthEngine *synth;} {private local
3090  }
3091  decl {int *plgroup;} {private local
3092  }
3093  decl {int engine;} {private local
3094  }
3095  decl {bool partKitOn;} {public local
3096  }
3097  decl {int lastkey;} {private local
3098  }
3099  decl {int channelATselection;} {private local
3100  }
3101  decl {int keyATselection;} {private local
3102  }
3103  decl {float midiDW;} {public local
3104  }
3105  decl {float midiDH;} {public local
3106  }
3107  decl {bool ctlmidiSeen;} {private local
3108  }
3109  decl {float atDW;} {public local
3110  }
3111  decl {float atDH;} {public local
3112  }
3113  decl {int atSeen;} {private local
3114  }
3115  decl {float ctlDW;} {public local
3116  }
3117  decl {float ctlDH;} {public local
3118  }
3119  decl {int lastctlW;} {private local
3120  }
3121  decl {bool ctlSeen;} {private local
3122  }
3123  decl {float fxDW;} {public local
3124  }
3125  decl {float fxDH;} {public local
3126  }
3127  decl {bool fxSeen;} {private local
3128  }
3129  decl {float editDW;} {public local
3130  }
3131  decl {float editDH;} {public local
3132  }
3133  decl {int lasteditW;} {private local
3134  }
3135  decl {bool editSeen;} {private local
3136  }
3137  decl {float kitDW;} {public local
3138  }
3139  decl {float kitDH;} {public local
3140  }
3141  decl {bool kitSeen;} {private local
3142  }
3143  decl {int lastfxW;} {private local
3144  }
3145  decl {int lastkitW;} {private local
3146  }
3147  decl {int lastmidiW;} {private local
3148  }
3149  decl {int lastatW;} {private local
3150  }
3151}
3152