1# data file for the Fltk User Interface Designer (fluid)
2version 1.0110
3header_name {.h}
4code_name {.cc}
5decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {}
6
7decl {//License: GNU GPL version 2 or later} {}
8
9decl {\#include <stdlib.h>} {public
10}
11
12decl {\#include <stdio.h>} {public
13}
14
15decl {\#include <string.h>} {public
16}
17
18decl {\#include "WidgetPDial.h"} {public
19}
20
21decl {\#include "EffUI.h"} {public
22}
23
24decl {\#include "BankUI.h"} {public
25}
26
27decl {\#include "ADnoteUI.h"} {public
28}
29
30decl {\#include "SUBnoteUI.h"} {public
31}
32
33decl {\#include "PADnoteUI.h"} {public
34}
35
36decl {\#include "../Misc/Config.h"} {public
37}
38
39decl {\#include "../Misc/Master.h"} {public
40}
41
42decl {\#include "../Misc/Part.h"} {public
43}
44
45class PartSysEffSend {open : {public Fl_Group}
46} {
47  Function {make_window()} {open private
48  } {
49    Fl_Window syseffsend {
50      private xywh {589 129 100 100} type Double box FLAT_BOX
51      class Fl_Group visible
52    } {
53      Fl_Dial {} {
54        label 01
55        callback {master->setPsysefxvol(npart,neff,(int) o->value());}
56        xywh {0 0 25 25} box ROUND_UP_BOX labelfont 1 labelsize 10 align 130 maximum 127 step 1
57        code0 {o->size(25,25);}
58        code1 {o->value(master->Psysefxvol[neff][npart]);}
59        code2 {char tmp[10];snprintf(tmp,10,"%d",neff+1);o->copy_label(tmp);}
60        class WidgetPDial
61      }
62    }
63  }
64  Function {PartSysEffSend(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
65    code {master=NULL;
66neff=0;
67npart=0;} {}
68  }
69  Function {init(Master *master_,int npart_,int neff_)} {} {
70    code {npart=npart_;
71neff=neff_;
72master=master_;
73make_window();
74syseffsend->show();
75end();} {}
76  }
77  Function {~PartSysEffSend()} {} {
78    code {syseffsend->hide();
79//delete(syseffsend);} {}
80  }
81  decl {Master *master;} {}
82  decl {int neff;} {}
83  decl {int npart;} {}
84}
85
86class PartKitItem {open : {public Fl_Group}
87} {
88  Function {make_window()} {open private
89  } {
90    Fl_Window partkititem {
91      private xywh {473 406 670 100} type Double box FLAT_BOX
92      class Fl_Group visible
93    } {
94      Fl_Group partkititemgroup {
95        private xywh {55 0 605 20}
96        code0 {if (part->kit[n].Penabled==0) o->deactivate();}
97      } {
98        Fl_Counter minkcounter {
99          callback {part->kit[n].Pminkey=(int)o->value();}
100          xywh {225 0 55 15} type Simple minimum 0 maximum 128 step 1
101          code0 {o->value(part->kit[n].Pminkey);}
102        }
103        Fl_Button {} {
104          label m
105          callback {if (part->lastnote>=0) minkcounter->value(part->lastnote);
106minkcounter->do_callback();
107maxkcounter->do_callback();}
108          tooltip {set the minimum key to the last pressed key} xywh {285 3 15 12} box THIN_UP_BOX labelsize 10
109        }
110        Fl_Button {} {
111          label M
112          callback {if (part->lastnote>=0) maxkcounter->value(part->lastnote);
113maxkcounter->do_callback();
114minkcounter->do_callback();}
115          tooltip {set the maximum key to the last pressed key} xywh {315 3 15 12} box THIN_UP_BOX labelsize 10
116        }
117        Fl_Button {} {
118          label R
119          callback {minkcounter->value(0);
120minkcounter->do_callback();
121maxkcounter->value(127);
122maxkcounter->do_callback();}
123          tooltip {reset the minimum key to 0 and maximum key to 127} xywh {300 3 15 12} box THIN_UP_BOX labelfont 1 labelsize 10
124        }
125        Fl_Button adeditbutton {
126          label edit
127          callback {partui->showparameters(n,0);}
128          xywh {420 0 40 15} box THIN_UP_BOX labelsize 11
129          code0 {if (part->kit[n].Padenabled==0) o->deactivate();}
130          code1 {if (n==0) o->hide();}
131        }
132        Fl_Button subeditbutton {
133          label edit
134          callback {partui->showparameters(n,1);}
135          xywh {490 0 40 15} box THIN_UP_BOX labelsize 11
136          code0 {if (part->kit[n].Psubenabled==0) o->deactivate();}
137          code1 {if (n==0) o->hide();}
138        }
139        Fl_Check_Button mutedcheck {
140          callback {part->kit[n].Pmuted=(int)o->value();}
141          private xywh {60 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4
142          code0 {o->value(part->kit[n].Pmuted);}
143        }
144        Fl_Counter maxkcounter {
145          callback {part->kit[n].Pmaxkey=(int)o->value();}
146          xywh {335 0 55 15} type Simple minimum 0 maximum 128 step 1
147          code0 {o->value(part->kit[n].Pmaxkey);}
148        }
149        Fl_Button labelbutton {
150          label {Bass Drum}
151          callback {const char *tmp=fl_input("Kit item name:",(const char *)part->kit[n].Pname);
152if (tmp!=NULL) snprintf((char *)part->kit[n].Pname,PART_MAX_NAME_LEN,"%s",tmp);}
153          xywh {90 0 130 15} box THIN_DOWN_BOX down_box FLAT_BOX labelfont 1 labelsize 10 align 20
154          code0 {o->label((char *)part->kit[n].Pname);}
155        }
156        Fl_Check_Button adcheck {
157          callback {part->kit[n].Padenabled=(int)o->value();
158if (part->kit[n].Padenabled!=0) adeditbutton->activate();
159       else  adeditbutton->deactivate();}
160          private xywh {400 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4
161          code0 {o->value(part->kit[n].Padenabled);}
162          code1 {if (n==0) o->hide();}
163        }
164        Fl_Check_Button subcheck {
165          callback {part->kit[n].Psubenabled=(int)o->value();
166if (part->kit[n].Psubenabled!=0) subeditbutton->activate();
167       else  subeditbutton->deactivate();}
168          private xywh {470 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4
169          code0 {o->value(part->kit[n].Psubenabled);}
170          code1 {if (n==0) o->hide();}
171        }
172        Fl_Choice sendtoeffect {
173          callback {if (o->value()!=0) part->kit[n].Psendtoparteffect=(int)o->value()-1;
174    else part->kit[n].Psendtoparteffect=127;} open
175          xywh {615 0 45 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
176          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);};}
177          code1 {o->value(part->kit[n].Psendtoparteffect+1);if (part->kit[n].Psendtoparteffect==127) o->value(0);}
178        } {}
179        Fl_Button padeditbutton {
180          label edit
181          callback {partui->showparameters(n,2);}
182          xywh {560 0 40 15} box THIN_UP_BOX labelsize 11
183          code0 {if (part->kit[n].Ppadenabled==0) o->deactivate();}
184          code1 {if (n==0) o->hide();}
185        }
186        Fl_Check_Button padcheck {
187          callback {part->kit[n].Ppadenabled=(int)o->value();
188if (part->kit[n].Ppadenabled!=0) padeditbutton->activate();
189       else padeditbutton->deactivate();}
190          private xywh {540 0 20 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 4
191          code0 {o->value(part->kit[n].Ppadenabled);}
192          code1 {if (n==0) o->hide();}
193        }
194      }
195      Fl_Check_Button enabledcheck {
196        label 01
197        callback {int answer=1;
198if (o->value()==0) answer=fl_choice("Delete the item?","No","Yes",NULL);
199if (answer!=0){
200pthread_mutex_lock(&master->mutex);
201 part->setkititemstatus(n,(int) o->value());
202pthread_mutex_unlock(&master->mutex);
203
204if (o->value()==0) partkititemgroup->deactivate();
205else partkititemgroup->activate();
206o->redraw();
207partui->showparameters(n,-1);//use to delete the ui, if it is not to item 0
208} else o->value(1);}
209        private xywh {30 0 20 15} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 4
210        code0 {snprintf(label,10,"%d",n+1);o->label(label);}
211        code1 {o->value(part->kit[n].Penabled);}
212        code2 {if (n==0) o->deactivate();}
213      }
214    }
215  }
216  Function {PartKitItem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
217    code {n=0;
218part=NULL;} {}
219  }
220  Function {refresh()} {} {
221    code {enabledcheck->value(part->kit[n].Penabled);
222if (part->kit[n].Penabled==0) partkititemgroup->deactivate();
223else partkititemgroup->activate();
224
225mutedcheck->value(part->kit[n].Pmuted);
226labelbutton->label((char *)part->kit[n].Pname);
227minkcounter->value(part->kit[n].Pminkey);
228maxkcounter->value(part->kit[n].Pmaxkey);
229adcheck->value(part->kit[n].Padenabled);
230adcheck->do_callback();
231subcheck->value(part->kit[n].Psubenabled);
232subcheck->do_callback();
233
234sendtoeffect->value(part->kit[n].Psendtoparteffect+1);
235if (part->kit[n].Psendtoparteffect==127) sendtoeffect->value(0);
236
237this->redraw();} {
238      callback {int answer=1;
239if (o->value()==0) answer=fl_choice("Delete the item?","No","Yes",NULL);
240if (answer!=0){
241pthread_mutex_lock(&master->mutex);
242 part->setkititemstatus(n,(int) o->value());
243pthread_mutex_unlock(&master->mutex);
244
245if (o->value()==0) partkititemgroup->deactivate();
246else partkititemgroup->activate();
247o->redraw();
248partui->showparameters(n,-1);//use to delete the ui, if it is not to item 0
249} else o->value(1);}
250    }
251  }
252  Function {init(Part *part_,int n_,Master *master_,class PartUI *partui_)} {} {
253    code {part=part_;
254n=n_;
255partui=partui_;
256master=master_;
257make_window();
258//partkititem->show();
259end();} {}
260  }
261  Function {~PartKitItem()} {} {
262    code {partkititem->hide();
263//delete(partkititem);} {}
264  }
265  decl {Part *part;} {}
266  decl {int n;} {}
267  decl {Master *master;} {}
268  decl {char label[10];} {}
269  decl {class PartUI *partui;} {}
270}
271
272class PartUI {open : {public Fl_Group}
273} {
274  Function {make_window()} {open private
275  } {
276    Fl_Window partgroup {open
277      private xywh {688 264 385 180} type Double box FLAT_BOX
278      class Fl_Group visible
279    } {
280      Fl_Group partgroupui {open
281        xywh {0 0 385 180}
282        code0 {if (part->Penabled==0) o->deactivate();}
283      } {
284        Fl_Dial {} {
285          label Pan
286          callback {part->setPpanning((int) o->value());}
287          xywh {50 40 25 25} box ROUND_UP_BOX labelsize 11 maximum 127 step 1
288          code0 {o->value(part->Ppanning);}
289          class WidgetPDial
290        }
291        Fl_Counter {} {
292          label KeyShift
293          callback {part->Pkeyshift=(int) o->value()+64;}
294          xywh {195 45 90 20} labelsize 11 align 1 minimum -64 maximum 64 step 1
295          code0 {o->lstep(12);}
296          code1 {o->value(part->Pkeyshift-64);}
297        }
298        Fl_Scroll {} {open
299          xywh {166 91 125 49} box UP_BOX labelfont 1 labelsize 10 align 21
300        } {
301          Fl_Pack {} {open
302            xywh {171 96 115 35} type HORIZONTAL
303            code0 {o->spacing(5);}
304            code1 {for (int i=0;i<NUM_SYS_EFX;i++){psyef[i]=new PartSysEffSend(0,0,25,35,"");psyef[i]->init(master,npart,i);}}
305          } {}
306        }
307        Fl_Button {} {
308          label {Grand Piano}
309          callback {int event=Fl::event_button();
310if (event==FL_RIGHT_MOUSE){
311   const char *tmp=fl_input("Instrument name:",(const char *)part->Pname);
312   if (tmp!=NULL) snprintf((char *)part->Pname,PART_MAX_NAME_LEN,"%s",tmp);
313} else {
314  if (event==FL_LEFT_MOUSE) bankui->show();
315       else instrumenteditwindow->show();
316};}
317          tooltip {left mousebutton - to choose/save/.. from/to bank or right mousebutton to change the name or middle button to change the instrument information} xywh {195 5 185 20} box UP_FRAME down_box DOWN_FRAME labelfont 1 labelsize 11 align 84
318          code0 {o->label((char *)part->Pname);}
319        }
320        Fl_Box {} {
321          label {To Sys.Efx.}
322          xywh {166 81 95 10} labelfont 1 labelsize 10
323        }
324        Fl_Check_Button {} {
325          label NoteOn
326          callback {part->Pnoteon=(int) o->value();}
327          tooltip {set if the part receives NoteOn messages} xywh {10 155 65 20} down_box DOWN_BOX labelfont 1 labelsize 11
328          code0 {o->value(part->Pnoteon);}
329        }
330        Fl_Counter minkcounter {
331          label {Min.k}
332          callback {part->Pminkey=(int) o->value();
333if (part->Pminkey>part->Pmaxkey) o->textcolor(FL_RED);
334 else o->textcolor(FL_BLACK);}
335          tooltip {Minimum key (that the part receives NoteOn messages)} xywh {295 125 40 15} type Simple labelfont 1 labelsize 10 minimum 0 maximum 127 step 1 textsize 10
336          code0 {o->value(part->Pminkey);}
337        }
338        Fl_Counter maxkcounter {
339          label {Max.k}
340          callback {part->Pmaxkey=(int) o->value();
341
342if (part->Pminkey>part->Pmaxkey) o->textcolor(FL_RED);
343 else o->textcolor(FL_BLACK);}
344          tooltip {Maximum key (that the part receives NoteOn messages)} xywh {340 125 40 15} type Simple labelfont 1 labelsize 10 minimum 0 maximum 127 step 1 textsize 10
345          code0 {o->value(part->Pmaxkey);}
346        }
347        Fl_Dial {} {
348          label Volume
349          callback {part->setPvolume((int) o->value());}
350          tooltip {Part Volume} xywh {10 35 30 30} box ROUND_UP_BOX labelsize 11 maximum 127 step 1
351          code0 {o->value(part->Pvolume);}
352          class WidgetPDial
353        }
354        Fl_Dial {} {
355          label {Vel.Ofs.}
356          callback {part->Pveloffs=(int) o->value();}
357          tooltip {Velocity Offset} xywh {135 40 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
358          code0 {o->value(part->Pveloffs);}
359          class WidgetPDial
360        }
361        Fl_Dial {} {
362          label {Vel.Sns.}
363          callback {part->Pvelsns=(int) o->value();}
364          tooltip {Velocity Sensing Function} xywh {95 40 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
365          code0 {o->value(part->Pvelsns);}
366          class WidgetPDial
367        }
368        Fl_Button {} {
369          label Controllers
370          callback {ctlwindow->show();}
371          xywh {295 90 85 30} labelfont 1 labelsize 11
372        }
373        Fl_Check_Button {} {
374          label Portamento
375          callback {part->ctl.portamento.portamento=(int) o->value();}
376          tooltip {Enable/Disable the portamento} xywh {95 155 88 20} down_box DOWN_BOX labelfont 1 labelsize 11
377          code0 {o->value(part->ctl.portamento.portamento);}
378        }
379        Fl_Button {} {
380          label {Edit instrument}
381          callback {instrumenteditwindow->show();}
382          xywh {15 90 130 30} color 52 labelfont 1 labelsize 13
383        }
384        Fl_Button {} {
385          label m
386          callback {if (part->lastnote>=0) minkcounter->value(part->lastnote);
387minkcounter->do_callback();
388maxkcounter->do_callback();}
389          tooltip {set the minimum key to the last pressed key} xywh {315 155 15 12} box THIN_UP_BOX labelsize 10
390        }
391        Fl_Button {} {
392          label M
393          callback {if (part->lastnote>=0) maxkcounter->value(part->lastnote);
394maxkcounter->do_callback();
395minkcounter->do_callback();}
396          tooltip {set the maximum key to the last pressed key} xywh {345 155 15 12} box THIN_UP_BOX labelsize 10
397        }
398        Fl_Button {} {
399          label R
400          callback {minkcounter->value(0);
401minkcounter->do_callback();
402maxkcounter->value(127);
403maxkcounter->do_callback();}
404          tooltip {reset the minimum key to 0 and maximum key to 127} xywh {330 155 15 12} box THIN_UP_BOX labelfont 1 labelsize 10
405        }
406        Fl_Choice {} {
407          label {MIDI Chn.Rcv.}
408          callback {part->Prcvchn=(int) o->value();} open
409          tooltip {receive from Midi channel} xywh {310 45 70 20} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
410          code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Chn%d",i+1);if (i!=9) o->add(nrstr); else o->add("Drms10");};}
411          code1 {o->value(part->Prcvchn);}
412        } {}
413        Fl_Choice keylimitlist {
414          label KLmt
415          callback {int val=0;
416val=atoi(o->text());
417part->setkeylimit(val);} open
418          tooltip {Key Limit} xywh {215 155 50 20} down_box BORDER_BOX labelsize 10 align 8 textfont 1 textsize 10
419        } {}
420        Fl_Choice {} {
421          label {Mode :}
422          callback {if ((int) o->value()==0){ /* Poly (implies no legato) */
423  part->Ppolymode=1;
424  part->Plegatomode=0;
425} else {
426  if ((int) o->value()==1){ /* Mono (implies no legato) */
427    part->Ppolymode=0;
428    part->Plegatomode=0;
429  } else {
430    if ((int) o->value()==2){ /* Legato (implies mono) */
431      part->Ppolymode=0;
432      part->Plegatomode=1;
433    };
434  };
435};} open
436          tooltip {Poly, Mono or Legato mode} xywh {80 130 64 18} down_box BORDER_BOX labelfont 1 labelsize 11 textfont 1 textsize 10
437          code0 {o->add("Poly"); o->add("Mono"); o->add("Legato");}
438          code1 {if (part->Ppolymode!=0) o->value(0); else o->value(1);}
439          code2 {if (part->Ppolymode==0 && part->Plegatomode!=0) o->value(2);}
440        } {}
441      }
442      Fl_Check_Button {} {
443        label Enabled
444        callback {pthread_mutex_lock(&master->mutex);
445master->partonoff(npart,(int) o->value());
446pthread_mutex_unlock(&master->mutex);
447if (part->Penabled==0) partgroupui->deactivate();
448    else partgroupui->activate();}
449        xywh {90 5 75 20} down_box DOWN_BOX labelfont 1 labelsize 11
450        code0 {o->value(part->Penabled);}
451      }
452    }
453    Fl_Window ctlwindow {
454      label Controllers open
455      private xywh {777 261 500 130} type Double box FLAT_BOX visible
456    } {
457      Fl_Check_Button {} {
458        label Expr
459        callback {part->ctl.expression.receive=(int) o->value();}
460        tooltip {Expression enable} xywh {155 55 45 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
461        code0 {o->value(part->ctl.expression.receive);}
462      }
463      Fl_Dial {} {
464        label PanDpth
465        callback {part->ctl.panning.depth=(int) o->value();}
466        tooltip {Panning Depth} xywh {10 55 30 30} labelsize 10 maximum 127 step 1
467        code0 {o->value(part->ctl.panning.depth);}
468        class WidgetPDial
469      }
470      Fl_Dial {} {
471        label FltCut
472        callback {part->ctl.filtercutoff.depth=(int) o->value();}
473        tooltip {Filter Cutoff depth} xywh {90 55 30 30} labelsize 10 maximum 127 step 1
474        code0 {o->value(part->ctl.filtercutoff.depth);}
475        class WidgetPDial
476      }
477      Fl_Dial {} {
478        label FltQ
479        callback {part->ctl.filterq.depth=(int) o->value();}
480        tooltip {Filter Q depth} xywh {50 55 30 30} labelsize 10 maximum 127 step 1
481        code0 {o->value(part->ctl.filterq.depth);}
482        class WidgetPDial
483      }
484      Fl_Dial {} {
485        label BwDpth
486        callback {part->ctl.bandwidth.depth=(int) o->value();}
487        tooltip {BandWidth depth} xywh {125 10 30 30} labelsize 10 maximum 127 step 1
488        code0 {o->value(part->ctl.bandwidth.depth);}
489        class WidgetPDial
490      }
491      Fl_Dial {} {
492        label ModWh
493        callback {part->ctl.modwheel.depth=(int) o->value();}
494        tooltip {Modulation Wheel depth} xywh {50 10 30 30} labelsize 10 maximum 127 step 1
495        code0 {o->value(part->ctl.modwheel.depth);}
496        class WidgetPDial
497      }
498      Fl_Counter {} {
499        label {PWheelB.Rng (cents)}
500        callback {part->ctl.pitchwheel.bendrange=(int) o->value();}
501        tooltip {Pitch Wheel Bend Range (cents)} xywh {165 15 110 20} labelsize 10 align 1 minimum -6400 maximum 6400 step 1
502        code0 {o->value(part->ctl.pitchwheel.bendrange);}
503        code1 {o->lstep(100);}
504      }
505      Fl_Check_Button {} {
506        label FMamp
507        callback {part->ctl.fmamp.receive=(int) o->value();}
508        tooltip {FM amplitude enable} xywh {205 55 60 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
509        code0 {o->value(part->ctl.fmamp.receive);}
510      }
511      Fl_Check_Button {} {
512        label Vol
513        callback {part->ctl.volume.receive=(int) o->value();}
514        tooltip {Volume enable} xywh {155 80 45 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
515        code0 {o->value(part->ctl.volume.receive);}
516      }
517      Fl_Check_Button {} {
518        label Sustain
519        callback {part->ctl.sustain.receive=(int) o->value();
520if (part->ctl.sustain.receive==0) {
521  part->RelaseSustainedKeys();
522  part->ctl.setsustain(0);
523};}
524        tooltip {Sustain pedal enable} xywh {205 80 60 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
525        code0 {o->value(part->ctl.sustain.receive);}
526      }
527      Fl_Button {} {
528        label Close
529        callback {ctlwindow->hide();}
530        xywh {400 107 95 20} box THIN_UP_BOX
531      }
532      Fl_Button {} {
533        label {Reset all controllers}
534        callback {part->SetController(C_resetallcontrollers,0);}
535        xywh {5 107 210 20} box THIN_UP_BOX
536      }
537      Fl_Group {} {
538        label Portamento
539        xywh {280 15 160 90} box UP_FRAME labelsize 10
540      } {
541        Fl_Check_Button {} {
542          label Rcv
543          callback {part->ctl.portamento.receive=(int) o->value();}
544          tooltip {Receive Portamento Controllers} xywh {285 20 40 20} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
545          code0 {o->value(part->ctl.portamento.receive);}
546        }
547        Fl_Dial {} {
548          label time
549          callback {part->ctl.portamento.time=(int) o->value();}
550          tooltip {Portamento time} xywh {285 60 25 25} labelsize 10 maximum 127 step 1
551          code0 {o->value(part->ctl.portamento.time);}
552          class WidgetPDial
553        }
554        Fl_Counter {} {
555          label thresh
556          callback {part->ctl.portamento.pitchthresh=(int) o->value();}
557          tooltip {Minimum or max. difference of the notes in order to do the portamento (x 100 cents)} xywh {340 20 50 20} type Simple labelsize 10 minimum 0 maximum 127 step 1
558          code0 {o->value(part->ctl.portamento.pitchthresh);}
559        }
560        Fl_Check_Button {} {
561          label {th.type}
562          callback {part->ctl.portamento.pitchthreshtype=(int) o->value();}
563          tooltip {Threshold type (min/max)} xywh {365 70 15 15} down_box DOWN_BOX labelsize 10 align 2
564          code0 {o->value(part->ctl.portamento.pitchthreshtype);}
565        }
566        Fl_Box {} {
567          label {x100 cnt.}
568          xywh {340 50 55 15} labelsize 10 align 16
569        }
570        Fl_Dial {} {
571          label {t.dn/up}
572          callback {int x=(int) o->value();
573
574part->ctl.portamento.updowntimestretch=x;}
575          tooltip {Portamento time stretch (up/down)} xywh {315 60 25 25} labelsize 10 maximum 127 step 1
576          code0 {o->value(part->ctl.portamento.updowntimestretch);}
577          class WidgetPDial
578        }
579        Fl_Dial propta {
580          label {Prp.Rate}
581          callback {part->ctl.portamento.propRate=(int) o->value();}
582          tooltip {Distance required to double change from nonpropotinal portamento time} xywh {405 20 25 25} labelsize 9 maximum 127 step 1
583          code0 {o->value(part->ctl.portamento.propRate);}
584          class WidgetPDial
585        }
586        Fl_Dial proptb {
587          label {Prp.Dpth}
588          callback {part->ctl.portamento.propDepth=(int) o->value();}
589          tooltip {The difference from nonproportinal portamento} xywh {405 60 25 25} labelsize 9 maximum 127 step 1
590          code0 {o->value(part->ctl.portamento.propDepth);}
591          class WidgetPDial
592        }
593        Fl_Check_Button {} {
594          label {Proprt.}
595          callback {part->ctl.portamento.proportional=(int) o->value();
596if(o->value()){propta->activate();proptb->activate();}
597else {propta->deactivate();proptb->deactivate();}}
598          tooltip {Enable Proportinal Portamento (over fixed Portamento)} xywh {285 40 50 15} box THIN_UP_BOX down_box DOWN_BOX labelsize 9
599          code0 {o->value(part->ctl.portamento.proportional);}
600          code1 {if(o->value()){propta->activate();proptb->activate();}}
601          code2 {else {propta->deactivate();proptb->deactivate();}}
602        }
603      }
604      Fl_Group {} {
605        label Resonance
606        xywh {445 15 50 90} box UP_FRAME labelsize 10
607      } {
608        Fl_Dial {} {
609          label BWdpth
610          callback {part->ctl.resonancebandwidth.depth=(int) o->value();}
611          tooltip {BandWidth controller depth} xywh {455 60 25 25} labelsize 10 maximum 127 step 1
612          code0 {o->value(part->ctl.resonancebandwidth.depth);}
613          class WidgetPDial
614        }
615        Fl_Dial {} {
616          label CFdpth
617          callback {part->ctl.resonancecenter.depth=(int) o->value();}
618          tooltip {Center Frequency controller Depth} xywh {455 20 25 25} labelsize 10 maximum 127 step 1
619          code0 {o->value(part->ctl.resonancecenter.depth);}
620          class WidgetPDial
621        }
622      }
623      Fl_Check_Button {} {
624        label {Exp MWh}
625        callback {part->ctl.modwheel.exponential=(int) o->value();}
626        tooltip {Exponential modulation wheel} xywh {10 15 40 25} down_box DOWN_BOX labelsize 10 align 148
627        code0 {o->value(part->ctl.modwheel.exponential);}
628      }
629      Fl_Check_Button {} {
630        label {Exp BW}
631        callback {part->ctl.bandwidth.exponential=(int) o->value();}
632        tooltip {Exponential BandWidth Controller} xywh {85 15 35 25} down_box DOWN_BOX labelsize 10 align 148
633        code0 {o->value(part->ctl.bandwidth.exponential);}
634      }
635    }
636    Fl_Window partfx {
637      label {Part's Insert Effects} selected
638      private xywh {554 660 390 145} type Double box FLAT_BOX visible
639    } {
640      Fl_Counter inseffnocounter {
641        label {FX No.}
642        callback {ninseff=(int) o->value()-1;
643insefftype->value(part->partefx[ninseff]->geteffect());
644//insefftype->do_callback();
645inseffectui->refresh(part->partefx[ninseff]);
646int x=part->Pefxroute[ninseff];
647if (x==127) x=1;
648bypasseff->value(part->Pefxbypass[ninseff]);
649
650sendtochoice->value(x);}
651        xywh {5 110 80 20} type Simple labelfont 1 align 6 minimum 1 maximum 127 step 1 textfont 1
652        code0 {o->bounds(1,NUM_PART_EFX);}
653        code1 {o->value(ninseff+1);}
654      }
655      Fl_Choice insefftype {
656        label EffType
657        callback {pthread_mutex_lock(part->mutex);
658part->partefx[ninseff]->changeeffect((int) o->value());
659pthread_mutex_unlock(part->mutex);
660inseffectui->refresh(part->partefx[ninseff]);}
661        xywh {155 110 70 15} down_box BORDER_BOX labelsize 10 align 6
662        code0 {o->value(part->partefx[ninseff]->geteffect());}
663      } {
664        MenuItem {} {
665          label {No Effect}
666          xywh {35 35 100 20} labelfont 1 labelsize 10
667        }
668        MenuItem {} {
669          label Reverb
670          xywh {45 45 100 20} labelfont 1 labelsize 10
671        }
672        MenuItem {} {
673          label Echo
674          xywh {55 55 100 20} labelfont 1 labelsize 10
675        }
676        MenuItem {} {
677          label Chorus
678          xywh {65 65 100 20} labelfont 1 labelsize 10
679        }
680        MenuItem {} {
681          label Phaser
682          xywh {70 70 100 20} labelfont 1 labelsize 10
683        }
684        MenuItem {} {
685          label AlienWah
686          xywh {80 80 100 20} labelfont 1 labelsize 10
687        }
688        MenuItem {} {
689          label Distortion
690          xywh {90 90 100 20} labelfont 1 labelsize 10
691        }
692        MenuItem {} {
693          label EQ
694          xywh {100 100 100 20} labelfont 1 labelsize 10
695        }
696        MenuItem {} {
697          label DynFilter
698          xywh {110 110 100 20} labelfont 1 labelsize 10
699        }
700      }
701      Fl_Group inseffectuigroup {
702        xywh {5 5 380 100} box FLAT_BOX color 48
703      } {
704        Fl_Group inseffectui {
705          xywh {5 5 380 95}
706          code0 {o->init(part->partefx[ninseff]);}
707          class EffUI
708        } {}
709      }
710      Fl_Button {} {
711        label Close
712        callback {partfx->hide();}
713        xywh {325 115 60 20} box THIN_UP_BOX
714      }
715      Fl_Choice sendtochoice {
716        label {Send To.}
717        callback {int x=(int) o->value();
718part->Pefxroute[ninseff]=x;
719if (x==2) part->partefx[ninseff]->setdryonly(true);
720	else part->partefx[ninseff]->setdryonly(false);}
721        xywh {235 110 80 15} down_box BORDER_BOX labelsize 10 align 6
722        code0 {int x=part->Pefxroute[ninseff]; if (x==127) x=1;}
723        code1 {o->value(x);}
724      } {
725        MenuItem {} {
726          label {Next Effect}
727          xywh {45 45 100 20} labelfont 1 labelsize 10
728        }
729        MenuItem {} {
730          label {Part Out}
731          xywh {55 55 100 20} labelfont 1 labelsize 10
732        }
733        MenuItem {} {
734          label {Dry Out}
735          xywh {65 65 100 20} labelfont 1 labelsize 10
736        }
737      }
738      Fl_Check_Button bypasseff {
739        label bypass
740        callback {part->Pefxbypass[ninseff]=(((int)o->value())!=0);}
741        tooltip {if the effect is not used (is bypassed)} xywh {90 110 60 15} down_box DOWN_BOX labelsize 11
742        code0 {int x=part->Pefxbypass[ninseff];o->value(x);}
743      }
744      Fl_Button {} {
745        label C
746        callback {presetsui->copy(part->partefx[ninseff]);}
747        xywh {90 127 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
748      }
749      Fl_Button {} {
750        label P
751        callback {pthread_mutex_lock(&master->mutex);
752presetsui->paste(part->partefx[ninseff],inseffectui);
753pthread_mutex_unlock(&master->mutex);}
754        xywh {120 127 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
755      }
756    }
757    Fl_Window instrumentkitlist {
758      label {Instrument Kit} open
759      xywh {586 566 670 370} type Double box FLAT_BOX visible
760    } {
761      Fl_Button {} {
762        label {Close Window}
763        callback {instrumentkitlist->hide();}
764        xywh {375 350 160 20} box THIN_UP_BOX
765      }
766      Fl_Scroll kitlist {open
767        xywh {0 15 670 330} type VERTICAL box UP_FRAME
768        code0 {if (part->Pkitmode==0) o->deactivate();}
769      } {
770        Fl_Pack {} {
771          xywh {0 20 670 320}
772          code0 {for (int i=0;i<NUM_KIT_ITEMS;i++){partkititem[i]=new PartKitItem(0,0,670,20,"");partkititem[i]->init(part,i,master,this);}}
773        } {}
774      }
775      Fl_Box {} {
776        label {No.}
777        xywh {5 0 25 15} labelfont 1 labelsize 11 align 18
778      }
779      Fl_Box {} {
780        label {M.}
781        xywh {55 0 25 15} labelfont 1 labelsize 11 align 18
782      }
783      Fl_Box {} {
784        label {Min.k}
785        xywh {235 0 40 15} labelfont 1 labelsize 11 align 18
786      }
787      Fl_Box {} {
788        label {Max.k}
789        xywh {345 0 40 15} labelfont 1 labelsize 11 align 18
790      }
791      Fl_Box {} {
792        label ADsynth
793        xywh {405 0 50 15} labelfont 1 labelsize 11 align 18
794      }
795      Fl_Box {} {
796        label SUBsynth
797        xywh {470 0 60 15} labelfont 1 labelsize 11 align 18
798      }
799      Fl_Choice {} {
800        label Mode
801        callback {part->Pkitmode=(int) o->value();
802if (part->Pkitmode==0) {
803     kitlist->deactivate();
804 } else {
805 kitlist->activate();
806};}
807        xywh {35 350 70 15} down_box BORDER_BOX labelsize 11 textfont 1 textsize 11
808        code0 {o->value(part->Pkitmode);}
809      } {
810        MenuItem {} {
811          label OFF
812          xywh {0 0 100 20} labelfont 1 labelsize 11
813        }
814        MenuItem {} {
815          label MULTI
816          xywh {10 10 100 20} labelfont 1 labelsize 11
817        }
818        MenuItem {} {
819          label SINGLE
820          xywh {20 20 100 20} labelfont 1 labelsize 11
821        }
822      }
823      Fl_Check_Button {} {
824        label {Drum mode}
825        callback {part->Pdrummode=(int) o->value();}
826        xywh {285 350 70 15} down_box DOWN_BOX labelsize 10
827        code0 {o->value(part->Pdrummode);}
828      }
829      Fl_Box {} {
830        label {FX.r.}
831        xywh {620 0 30 15} labelfont 1 labelsize 11 align 18
832      }
833      Fl_Box {} {
834        label PADsynth
835        xywh {540 0 60 15} labelfont 1 labelsize 11 align 18
836      }
837    }
838    Fl_Window instrumenteditwindow {
839      label {Instrument Edit} open
840      xywh {247 621 395 360} type Double box FLAT_BOX visible
841    } {
842      Fl_Group {} {
843        xywh {0 220 395 110} box UP_FRAME
844      } {
845        Fl_Group {} {
846          label PADsynth
847          xywh {205 245 100 80} box ENGRAVED_FRAME labelfont 1
848        } {
849          Fl_Button padeditbutton {
850            label Edit
851            callback {showparameters(0,2);}
852            xywh {215 280 80 35} color 51 selection_color 51 labelfont 1 labelsize 13 align 128
853            code0 {if (part->kit[0].Ppadenabled==0) o->deactivate();}
854          }
855          Fl_Check_Button padsynenabledcheck {
856            label Enabled
857            callback {int x=(int) o->value();
858part->kit[0].Ppadenabled=x;
859if (x==0) padeditbutton->deactivate();
860     else padeditbutton->activate();}
861            tooltip {enable/disable PADsynth} xywh {215 255 80 20} box UP_BOX down_box DOWN_BOX color 51 selection_color 0 labelfont 1 labelsize 11
862            code1 {o->value(part->kit[0].Ppadenabled);}
863          }
864        }
865        Fl_Group {} {
866          label ADsynth
867          xywh {5 245 100 80} box ENGRAVED_FRAME labelfont 1
868        } {
869          Fl_Check_Button adsynenabledcheck {
870            label Enabled
871            callback {int x=(int) o->value();
872part->kit[0].Padenabled=x;
873if (x==0) adeditbutton->deactivate();
874     else adeditbutton->activate();}
875            tooltip {enable/disable ADsynth} xywh {15 255 80 20} box UP_BOX down_box DOWN_BOX color 51 selection_color 0 labelfont 1 labelsize 11
876            code1 {o->value(part->kit[0].Padenabled);}
877          }
878          Fl_Button adeditbutton {
879            label Edit
880            callback {showparameters(0,0);}
881            xywh {15 281 80 34} color 51 selection_color 51 labelfont 1 labelsize 13 align 128
882            code0 {if (part->kit[0].Padenabled==0) o->deactivate();}
883          }
884        }
885        Fl_Group {} {
886          label SUBsynth
887          xywh {105 245 100 80} box ENGRAVED_FRAME labelfont 1
888        } {
889          Fl_Check_Button subsynenabledcheck {
890            label Enabled
891            callback {int x=(int) o->value();
892part->kit[0].Psubenabled=x;
893if (x==0) subeditbutton->deactivate();
894     else subeditbutton->activate();}
895            tooltip {enable/disable SUBsynth} xywh {115 255 80 20} box UP_BOX down_box DOWN_BOX color 51 selection_color 0 labelfont 1 labelsize 11
896            code1 {o->value(part->kit[0].Psubenabled);}
897          }
898          Fl_Button subeditbutton {
899            label Edit
900            callback {showparameters(0,1);}
901            xywh {115 280 80 35} color 51 selection_color 51 labelfont 1 labelsize 13 align 128
902            code0 {if (part->kit[0].Psubenabled==0) o->deactivate();}
903          }
904        }
905        Fl_Button {} {
906          label {Kit Edit}
907          callback {instrumentkitlist->show();}
908          xywh {310 245 80 35} color 51 selection_color 51 labelfont 1 align 128
909        }
910        Fl_Button {} {
911          label Effects
912          callback {partfx->show();}
913          xywh {310 290 80 35} color 51 selection_color 51 labelfont 1 labelsize 13
914        }
915      }
916      Fl_Group {} {
917        xywh {0 5 395 215} box UP_FRAME
918      } {
919        Fl_Input {} {
920          label {Author and Copyright}
921          callback {snprintf((char *)part->info.Pauthor,MAX_INFO_TEXT_SIZE,"%s",o->value());}
922          xywh {5 60 385 50} type Multiline color 124 labelsize 10 align 5
923          code0 {o->maximum_size(MAX_INFO_TEXT_SIZE);}
924          code1 {o->value((char *) &part->info.Pauthor);}
925        }
926        Fl_Input {} {
927          label Comments
928          callback {snprintf((char *)part->info.Pcomments,MAX_INFO_TEXT_SIZE,"%s",o->value());}
929          xywh {5 125 385 90} type Multiline color 124 labelsize 11 align 5
930          code0 {o->maximum_size(MAX_INFO_TEXT_SIZE);}
931          code1 {o->value((char *) &part->info.Pcomments);}
932        }
933        Fl_Choice {} {
934          label {Type:}
935          callback {part->info.Ptype=o->value();}
936          xywh {5 25 155 20} down_box BORDER_BOX labelfont 1 labelsize 11 align 5 textsize 10
937          code0 {o->value(part->info.Ptype);}
938        } {
939          MenuItem {} {
940            label {--------------------------}
941            xywh {20 20 100 20} labelfont 1 labelsize 11
942          }
943          MenuItem {} {
944            label Piano
945            xywh {10 10 100 20} labelfont 1 labelsize 11
946          }
947          MenuItem {} {
948            label {Chromatic Percussion}
949            xywh {20 20 100 20} labelfont 1 labelsize 11
950          }
951          MenuItem {} {
952            label Organ
953            xywh {30 30 100 20} labelfont 1 labelsize 11
954          }
955          MenuItem {} {
956            label Guitar
957            xywh {40 40 100 20} labelfont 1 labelsize 11
958          }
959          MenuItem {} {
960            label Bass
961            xywh {50 50 100 20} labelfont 1 labelsize 11
962          }
963          MenuItem {} {
964            label {Solo Strings}
965            xywh {60 60 100 20} labelfont 1 labelsize 11
966          }
967          MenuItem {} {
968            label Ensemble
969            xywh {70 70 100 20} labelfont 1 labelsize 11
970          }
971          MenuItem {} {
972            label Brass
973            xywh {80 80 100 20} labelfont 1 labelsize 11
974          }
975          MenuItem {} {
976            label Reed
977            xywh {90 90 100 20} labelfont 1 labelsize 11
978          }
979          MenuItem {} {
980            label Pipe
981            xywh {100 100 100 20} labelfont 1 labelsize 11
982          }
983          MenuItem {} {
984            label {Synth Lead}
985            xywh {110 110 100 20} labelfont 1 labelsize 11
986          }
987          MenuItem {} {
988            label {Synth Pad}
989            xywh {120 120 100 20} labelfont 1 labelsize 11
990          }
991          MenuItem {} {
992            label {Synth Effects}
993            xywh {130 130 100 20} labelfont 1 labelsize 11
994          }
995          MenuItem {} {
996            label Ethnic
997            xywh {140 140 100 20} labelfont 1 labelsize 11
998          }
999          MenuItem {} {
1000            label Percussive
1001            xywh {150 150 100 20} labelfont 1 labelsize 11
1002          }
1003          MenuItem {} {
1004            label {Sound Effects}
1005            xywh {160 160 100 20} labelfont 1 labelsize 11
1006          }
1007        }
1008      }
1009      Fl_Button {} {
1010        label Close
1011        callback {instrumenteditwindow->hide();}
1012        xywh {150 335 95 25} box THIN_UP_BOX
1013      }
1014    }
1015  }
1016  Function {PartUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
1017    code {part=NULL;
1018adnoteui=NULL;
1019subnoteui=NULL;
1020padnoteui=NULL;
1021lastkititem=-1;} {}
1022  }
1023  Function {init(Part *part_,Master *master_,int npart_,BankUI *bankui_)} {} {
1024    code {bankui=bankui_;
1025part=part_;
1026npart=npart_;
1027master=master_;
1028ninseff=0;
1029
1030make_window();
1031\#ifdef NTK_GUI
1032adsynenabledcheck->selection_color(55);
1033subsynenabledcheck->selection_color(55);
1034padsynenabledcheck->selection_color(55);
1035\#endif
1036partgroup->position(this->parent()->x()+2,this->parent()->y()+2);
1037partgroup->show();
1038end();
1039
1040
1041//if (config.ui.showinstrumentinfo!=0) instrumenteditwindow->show();
1042
1043int klimits[]={1,2,3,4,5,6,7,8,9,10,15,20,30,50,100,0};
1044
1045keylimitlist->add("OFF");
1046int k=0;
1047int val=-1;
1048char tmp[10];
1049while (klimits[k]!=0){
1050	sprintf(tmp,"%d",klimits[k]);
1051	keylimitlist->add(tmp);
1052	if (val==-1){
1053		if (klimits[k]>part->Pkeylimit) val=k;
1054	};
1055	k++;
1056};
1057
1058if (val==-1) val=k;
1059keylimitlist->value(val);} {}
1060  }
1061  Function {showparameters(int kititem,int engine)} {} {
1062    code {if (engine==-1){//this is used if I want to clear the engine from the part
1063   if (kititem==lastkititem) kititem=-1;
1064         else kititem=lastkititem;
1065};
1066
1067if (kititem!=lastkititem){
1068    if (adnoteui!=NULL) delete (adnoteui);
1069    if (subnoteui!=NULL) delete (subnoteui);
1070    if (padnoteui!=NULL) delete (padnoteui);
1071    adnoteui=NULL;subnoteui=NULL;padnoteui=NULL;
1072    lastkititem=kititem;
1073
1074    if (kititem>=NUM_KIT_ITEMS) return;//bad kit item
1075    if (kititem<0) return;
1076
1077    if (part->kit[kititem].adpars!=NULL)
1078      adnoteui=new ADnoteUI(part->kit[kititem].adpars,master);
1079
1080    if (part->kit[kititem].subpars!=NULL)
1081       subnoteui=new SUBnoteUI(part->kit[kititem].subpars);
1082
1083    if (part->kit[kititem].padpars!=NULL)
1084      padnoteui=new PADnoteUI(part->kit[kititem].padpars,master);
1085
1086};
1087
1088
1089
1090if ((engine==0)&&(adnoteui!=NULL)) adnoteui->ADnoteGlobalParameters->show();
1091if ((engine==1)&&(subnoteui!=NULL)) subnoteui->SUBparameters->show();
1092if ((engine==2)&&(adnoteui!=NULL)) padnoteui->padnotewindow->show();} {}
1093  }
1094  Function {~PartUI()} {} {
1095    code {if (adnoteui!=NULL) delete (adnoteui);
1096if (subnoteui!=NULL) delete (subnoteui);
1097if (padnoteui!=NULL) delete (padnoteui);
1098
1099partgroup->hide();
1100//delete(partgroup);
1101
1102ctlwindow->hide();
1103delete(ctlwindow);
1104
1105partfx->hide();
1106delete(partfx);
1107
1108instrumentkitlist->hide();
1109delete(instrumentkitlist);
1110
1111instrumenteditwindow->hide();
1112delete(instrumenteditwindow);} {}
1113  }
1114  decl {Part *part;} {}
1115  decl {Master *master;} {}
1116  decl {BankUI *bankui;} {}
1117  decl {ADnoteUI *adnoteui;} {}
1118  decl {SUBnoteUI *subnoteui;} {}
1119  decl {PADnoteUI *padnoteui;} {}
1120  decl {PartSysEffSend *psyef[NUM_SYS_EFX];} {}
1121  decl {int npart;} {}
1122  decl {int ninseff;} {}
1123  decl {int lastkititem;} {}
1124  decl {PartKitItem *partkititem[NUM_KIT_ITEMS];} {}
1125}
1126