zynaddsubfx

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

EnvelopeUI.fl (21017B)


      1 # data file for the Fltk User Interface Designer (fluid)
      2 version 1.0302 
      3 header_name {.h} 
      4 code_name {.cc}
      5 decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {private local
      6 } 
      7 
      8 decl {//License: GNU GPL version 2 or later} {private local
      9 } 
     10 
     11 decl {\#include "Fl_Osc_Dial.H"} {public local
     12 } 
     13 
     14 decl {\#include "Fl_Osc_Check.H"} {public local
     15 } 
     16 
     17 decl {\#include "Fl_Osc_Button.H"} {public local
     18 } 
     19 
     20 decl {\#include "Fl_Osc_Counter.H"} {public local
     21 } 
     22 
     23 decl {\#include "Fl_Osc_Pane.H"} {public local
     24 }
     25 
     26 decl {\#include <stdio.h>} {public local
     27 } 
     28 
     29 decl {\#include <stdlib.h>} {public local
     30 } 
     31 
     32 decl {\#include "../globals.h"} {public local
     33 } 
     34 
     35 decl {\#include <FL/Fl_Group.H>} {public local
     36 } 
     37 
     38 decl {\#include "../Params/EnvelopeParams.h"} {public local
     39 } 
     40 
     41 decl {\#include <FL/Fl_Box.H>} {public local
     42 } 
     43 
     44 decl {\#include <FL/fl_draw.H>} {public local
     45 } 
     46 
     47 decl {\#include <FL/fl_ask.H>} {public local
     48 } 
     49 
     50 decl {\#include "PresetsUI.h"} {public local
     51 } 
     52 
     53 decl {\#include "common.H"} {public local
     54 } 
     55 
     56 decl {\#include "EnvelopeFreeEdit.h"} {public local
     57 } 
     58 
     59 class PointButton {open : {public Fl_Button, public Fl_Osc_Widget}}
     60 {
     61   Function {PointButton(int x,int y, int w, int h, const char *label=0):Fl_Button(x,y,w,h,label),Fl_Osc_Widget(this)} {open
     62   } {
     63     code {(void)label;} {}
     64   }
     65   Function {rebase(std::string new_base)} {open
     66   } {
     67     code {loc = new_base;} {}
     68   }
     69   Function {init(std::string path_)} {open
     70   } {
     71     code {ext = path_;} {}
     72   }
     73 }
     74 class EnvelopeUI {open : {public Fl_Osc_Group,PresetsUI_}
     75 } {
     76   Function {EnvelopeUI(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h)} {} {
     77     code {(void)label;
     78 freemodeeditwindow=NULL;
     79 envADSR=NULL;
     80 envASR=NULL;
     81 envADSRfilter=NULL;
     82 envASRbw=NULL;
     83 envfree=NULL;} {}
     84   }
     85   Function {~EnvelopeUI()} {} {
     86     code {envwindow->hide();
     87 hide();
     88 freemodeeditwindow->hide();
     89 delete (freemodeeditwindow);} {}
     90   }
     91   Function {make_freemode_edit_window()} {open
     92   } {
     93     Fl_Window freemodeeditwindow {
     94       label Envelope open
     95       xywh {702 801 575 180} type Double resizable
     96       class Fl_Osc_Window visible
     97     } {
     98       Fl_Button {} {
     99         label C
    100         callback {presetsui->copy(freemodeeditwindow->loc());}
    101         xywh {465 160 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    102         code0 {freemodeeditwindow->init(osc, loc());}
    103       }
    104       Fl_Button {} {
    105         label P
    106         callback {presetsui->paste(freemodeeditwindow->loc(),this);}
    107         xywh {482 160 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    108       }
    109       Fl_Button addpoint {
    110         label {Add pt}
    111         callback {
    112 if(freeedit->lastpoint >= MAX_ENVELOPE_POINTS - 1)
    113     return;
    114 o->oscWrite("addPoint", "i", freeedit->lastpoint);
    115 freeedit->lastpoint+=1;
    116 freeedit->update();
    117 envfree->redraw();
    118 sustaincounter->update();
    119 
    120 //sustaincounter->value(Penvsustain);
    121 //sustaincounter->maximum(Penvpoints-2);}
    122         xywh {90 155 80 20} box THIN_UP_BOX labelsize 11
    123         code0 {(void)o->init("addPoint");}
    124         class PointButton
    125       }
    126       Fl_Box freeedit {
    127         label Envelope
    128         callback {sustaincounter->maximum(o->Penvpoints-2);}
    129         xywh {5 5 565 145} box FLAT_BOX color 0
    130         code0 {o->init();}
    131         class EnvelopeFreeEdit
    132       }
    133       Fl_Button deletepoint {
    134         label {Delete pt}
    135         callback {o->oscWrite("delPoint", "i", freeedit->lastpoint);
    136 freeedit->lastpoint-=1;
    137 freeedit->update();
    138 envfree->redraw();
    139 sustaincounter->update();
    140 //sustaincounter->value(Penvsustain);
    141 //sustaincounter->maximum(Penvpoints-2);}
    142         xywh {175 155 85 20} box THIN_UP_BOX labelsize 11
    143         code0 {(void)o->init("delPoint");}
    144         class PointButton
    145       }
    146       Fl_Check_Button forcedreleasecheck {
    147         label frcR
    148         tooltip {Forced Release} xywh {410 165 40 15} down_box DOWN_BOX labelsize 10
    149         code0 {o->init("Pforcedrelease");}
    150         class Fl_Osc_Check
    151       }
    152       Fl_Dial envstretchdial {
    153         label {Str.}
    154         tooltip {Envelope stretch (on lower notes make the envelope longer)} xywh {380 155 25 25} box ROUND_UP_BOX labelsize 10 align 4 maximum 127 step 1
    155         code0 {o->init("Penvstretch");}
    156         class Fl_Osc_Dial
    157       }
    158       Fl_Button {} {
    159         label Close
    160         callback {freemodeeditwindow->hide();}
    161         xywh {510 155 60 20} box THIN_UP_BOX
    162       }
    163       Fl_Check_Button linearenvelopecheck {
    164         label L
    165         tooltip {Linear Envelope} xywh {410 151 30 15} down_box DOWN_BOX labelsize 10
    166         code0 {o->init("Plinearenvelope");}
    167         class Fl_Osc_Check
    168       }
    169       Fl_Counter sustaincounter {
    170         label Sust
    171         callback {freeedit->redraw();
    172 envfree->redraw();}
    173         tooltip {Sustain (0 is disabled)} xywh {305 155 40 15} type Simple labelsize 11 align 4 minimum 0 maximum 127 step 1
    174         code3 {o->init("Penvsustain");}
    175         class Fl_Osc_Counter
    176       }
    177       Fl_Check_Button freemodehack {
    178           xywh {0 0 0 0} down_box DOWN_BOX
    179           callback{refresh_display();}
    180           code0 {o->init("Pfreemode");o->hide();}
    181           class Fl_Osc_Check
    182       }
    183       Fl_Button {} {
    184         label {Cancel}
    185         tooltip {Cancel freemode editing}
    186         callback {disable_freemode();}
    187         xywh {5 155 80 20} box THIN_UP_BOX labelsize 11 labelcolor 1
    188         class Fl_Osc_Button
    189       }
    190     }
    191   }
    192   Function {make_ADSR_window()} {} {
    193     Fl_Window envADSR {open
    194       xywh {353 911 205 70} type Double color 50 labelfont 1
    195       class Fl_Osc_Group visible
    196     } {
    197       Fl_Group {} {
    198         label {Amplitude Envelope}
    199         xywh {0 0 205 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
    200         code0 {set_module_parameters(o);}
    201       } {
    202         Fl_Button {} {
    203           label C
    204           callback {presetsui->copy(envADSR->loc());}
    205           xywh {150 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    206         }
    207         Fl_Button {} {
    208           label P
    209           callback {presetsui->paste(envADSR->loc(),this);}
    210           xywh {167 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    211         }
    212         Fl_Dial e1adt {
    213           label {A.dt}
    214           callback {freeedit->redraw();}
    215           tooltip {Attack time} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    216           code0 {o->init("PA_dt");}
    217           class Fl_Osc_Dial
    218         }
    219         Fl_Dial e1ddt {
    220           label {D.dt}
    221           callback {freeedit->redraw();}
    222           tooltip {Decay time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    223           code0 {o->init("PD_dt");}
    224           class Fl_Osc_Dial
    225         }
    226         Fl_Dial e1rdt {
    227           label {R.dt}
    228           callback {freeedit->redraw();}
    229           tooltip {Release time} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    230           code0 {o->init("PR_dt");}
    231           class Fl_Osc_Dial
    232         }
    233         Fl_Dial e1sval {
    234           label {S.val}
    235           callback {freeedit->redraw();}
    236           tooltip {Sustain value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    237           code0 {o->init("PS_val");}
    238           class Fl_Osc_Dial
    239         }
    240         Fl_Check_Button e1forcedrelease {
    241           label frcR
    242           tooltip {Forced Release} xywh {180 35 20 15} down_box DOWN_BOX labelsize 10 align 6
    243           code0 {o->init("Pforcedrelease");}
    244           class Fl_Osc_Check
    245         }
    246         Fl_Dial e1envstretch {
    247           label Stretch
    248           tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {145 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    249           code0 {o->init("Penvstretch");}
    250           class Fl_Osc_Dial
    251         }
    252         Fl_Button {} {
    253           label E
    254           callback {open_as_freemode();}
    255           tooltip {Envelope window} xywh {185 5 15 15} labelfont 1 labelsize 10
    256           class Fl_Osc_Button
    257         }
    258         Fl_Check_Button e1linearenvelope {
    259           label L
    260           tooltip {The envelope is linear} xywh {180 20 15 15} down_box DOWN_BOX labelsize 10 align 4
    261           code0 {o->init("Plinearenvelope");}
    262           class Fl_Osc_Check
    263         }
    264       }
    265     }
    266   }
    267   Function {make_ASR_window()} {} {
    268     Fl_Window envASR {open
    269       xywh {1067 911 210 70} type Double
    270       class Fl_Osc_Group visible
    271     } {
    272       Fl_Group {} {
    273         label {Frequency Envelope}
    274         xywh {0 0 210 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
    275         code0 {set_module_parameters(o);}
    276       } {
    277         Fl_Button {} {
    278           label C
    279           callback {presetsui->copy(envASR->loc());}
    280           xywh {155 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    281         }
    282         Fl_Button {} {
    283           label P
    284           callback {presetsui->paste(envASR->loc(),this);}
    285           xywh {172 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    286         }
    287         Fl_Dial e2aval {
    288           label {A.val}
    289           callback {freeedit->redraw();}
    290           tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    291           code0 {o->init("PA_val");}
    292           class Fl_Osc_Dial
    293         }
    294         Fl_Dial e2adt {
    295           label {A.dt}
    296           callback {freeedit->redraw();}
    297           tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    298           code0 {o->init("PA_dt");}
    299           class Fl_Osc_Dial
    300         }
    301         Fl_Dial e2rval {
    302           label {R.val}
    303           callback {freeedit->redraw();}
    304           tooltip {Release value} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    305           code0 {o->init("PR_val");}
    306           class Fl_Osc_Dial
    307         }
    308         Fl_Dial e2rdt {
    309           label {R.dt}
    310           callback {freeedit->redraw();}
    311           tooltip {Release time} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    312           code0 {o->init("PR_dt");}
    313           class Fl_Osc_Dial
    314         }
    315         Fl_Dial e2envstretch {
    316           label Stretch
    317           tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {145 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    318           code0 {o->init("Penvstretch");}
    319           class Fl_Osc_Dial
    320         }
    321         Fl_Check_Button e2forcedrelease {
    322           label frcR
    323           tooltip {Forced release} xywh {180 25 15 25} down_box DOWN_BOX labelsize 10 align 6
    324           code0 {o->init("Pforcedrelease");}
    325           class Fl_Osc_Check
    326         }
    327       }
    328       Fl_Button {} {
    329         label E
    330         callback {open_as_freemode();}
    331         tooltip {Envelope window} xywh {190 5 15 15} labelfont 1 labelsize 10
    332         class Fl_Osc_Button
    333       }
    334     }
    335   }
    336   Function {make_ADSRfilter_window()} {} {
    337     Fl_Window envADSRfilter {open
    338       xywh {1002 911 275 70} type Double color 50 labelfont 1
    339       class Fl_Osc_Group visible
    340     } {
    341       Fl_Group {} {
    342         label {Filter Envelope}
    343         xywh {0 0 275 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
    344         code0 {set_module_parameters(o);}
    345       } {
    346         Fl_Button {} {
    347           label C
    348           callback {presetsui->copy(envADSRfilter->loc());}
    349           xywh {220 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    350         }
    351         Fl_Button {} {
    352           label P
    353           callback {presetsui->paste(envADSRfilter->loc(),this);}
    354           xywh {237 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    355         }
    356         Fl_Dial e3aval {
    357           label {A.val}
    358           callback {freeedit->redraw();}
    359           tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    360           code0 {o->init("PA_val");}
    361           class Fl_Osc_Dial
    362         }
    363         Fl_Dial e3adt {
    364           label {A.dt}
    365           callback {freeedit->redraw();}
    366           tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    367           code0 {o->init("PA_dt");}
    368           class Fl_Osc_Dial
    369         }
    370         Fl_Dial e3dval {
    371           label {D.val}
    372           callback {freeedit->redraw();}
    373           tooltip {decay value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    374           code0 {o->init("PD_val");}
    375           class Fl_Osc_Dial
    376         }
    377         Fl_Dial e3ddt {
    378           label {D.dt}
    379           callback {freeedit->redraw();}
    380           tooltip {decay time} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    381           code0 {o->init("PD_dt");}
    382           class Fl_Osc_Dial
    383         }
    384         Fl_Dial e3rdt {
    385           label {R.dt}
    386           callback {freeedit->redraw();}
    387           tooltip {Release time} xywh {145 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    388           code0 {o->init("PR_dt");}
    389           class Fl_Osc_Dial
    390         }
    391         Fl_Dial e3rval {
    392           label {R.val}
    393           callback {freeedit->redraw();}
    394           tooltip {Release value} xywh {180 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    395           code0 {o->init("PR_val");}
    396           class Fl_Osc_Dial
    397         }
    398         Fl_Dial e3envstretch {
    399           label Stretch
    400           tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {215 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    401           code0 {o->init("Penvstretch");}
    402           class Fl_Osc_Dial
    403         }
    404         Fl_Check_Button e3forcedrelease {
    405           label frcR
    406           tooltip {Forced Release} xywh {250 30 15 20} down_box DOWN_BOX labelsize 10 align 6
    407           code0 {o->init("Pforcedrelease");}
    408           class Fl_Osc_Check
    409         }
    410         Fl_Button {} {
    411           label E
    412           callback {open_as_freemode();}
    413           xywh {255 5 15 15} labelfont 1 labelsize 10
    414           class Fl_Osc_Button
    415         }
    416       }
    417     }
    418   }
    419   Function {make_ASRbw_window()} {} {
    420     Fl_Window envASRbw {open
    421       xywh {371 911 210 70} type Double
    422       code0 {set_module_parameters(o);}
    423       class Fl_Osc_Group visible
    424     } {
    425       Fl_Group {} {
    426         label {BandWidth Envelope}
    427         xywh {0 0 210 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
    428         code0 {set_module_parameters(o);}
    429       } {
    430         Fl_Button {} {
    431           label C
    432           callback {presetsui->copy(envASRbw->loc());}
    433           xywh {155 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    434         }
    435         Fl_Button {} {
    436           label P
    437           callback {presetsui->paste(envASRbw->loc(),this);}
    438           xywh {172 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    439         }
    440         Fl_Dial e4aval {
    441           label {A.val}
    442           callback {freeedit->redraw();}
    443           tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    444           code0 {o->init("PA_val");}
    445           class Fl_Osc_Dial
    446         }
    447         Fl_Dial e4adt {
    448           label {A.dt}
    449           callback {freeedit->redraw();}
    450           tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    451           code0 {o->init("PA_dt");}
    452           class Fl_Osc_Dial
    453         }
    454         Fl_Dial e4rval {
    455           label {R.val}
    456           callback {freeedit->redraw();}
    457           tooltip {Release value} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    458           code0 {o->init("PR_val");}
    459           class Fl_Osc_Dial
    460         }
    461         Fl_Dial e4rdt {
    462           label {R.dt}
    463           callback {freeedit->redraw();}
    464           tooltip {Release time} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    465           code0 {o->init("PR_dt");}
    466           class Fl_Osc_Dial
    467         }
    468         Fl_Dial e4envstretch {
    469           label Stretch
    470           tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {145 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
    471           code0 {o->init("Penvstretch");}
    472           class Fl_Osc_Dial
    473         }
    474         Fl_Check_Button e4forcedrelease {
    475           label frcR
    476           tooltip {Forced release} xywh {180 25 15 25} down_box DOWN_BOX labelsize 10 align 6
    477           code0 {o->init("Pforcedrelease");}
    478           class Fl_Osc_Check
    479         }
    480       }
    481       Fl_Button {} {
    482         label E
    483         callback {open_as_freemode();}
    484         xywh {190 5 15 15} labelfont 1 labelsize 10
    485         class Fl_Osc_Button
    486       }
    487     }
    488   }
    489   Function {make_free_window()} {} {
    490     Fl_Window envfree {open
    491       xywh {385 911 205 70} type Double color 50 labelfont 1 resizable
    492       code0 {set_module_parameters(o);}
    493       class Fl_Osc_Group visible
    494     } {
    495       Fl_Group envfreegroup {
    496         label {Amplitude Envelope}
    497         xywh {0 0 205 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17 resizable
    498         code0 {set_module_parameters(o);}
    499       } {
    500         Fl_Button {} {
    501           label E
    502           callback {open_as_freemode();}
    503           xywh {185 5 15 15} labelfont 1 labelsize 10
    504           class Fl_Osc_Button
    505         }
    506         Fl_Box freeeditsmall {
    507           label Envelope
    508           callback {envfree->redraw();}
    509           xywh {5 20 195 45} box FLAT_BOX color 0 resizable
    510           code0 {o->init();}
    511           class EnvelopeFreeEdit
    512         }
    513         Fl_Button {} {
    514           label C
    515           callback {presetsui->copy(envfree->loc());}
    516           xywh {150 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    517         }
    518         Fl_Button {} {
    519           label P
    520           callback {presetsui->paste(envfree->loc(),this);}
    521           xywh {167 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
    522         }
    523       }
    524     }
    525   }
    526   Function {open_as_freemode()} {open
    527   } {
    528      code {
    529     if (!freemodehack->value() &&
    530         fl_choice("Convert envelope to free mode data?","No","Yes",NULL)==0)
    531         return;
    532     freemodehack->oscWrite("Pfreemode", "T");
    533     freeedit->update();
    534     freemodeeditwindow->show();
    535     freemodeeditwindow->position(Fl::event_x_root()-20, Fl::event_y_root()+20);
    536     freemodeeditwindow->size_range(400,160);
    537 } {}
    538 }
    539   Function {init(int env_type, Fl_Osc_Interface *osc_, std::string base_, std::string ext_)} {open
    540   } {
    541     code {osc  = osc_;
    542     base = base_;
    543     ext  = ext_;
    544     Envmode = env_type;
    545     Penvsustain = false;
    546     Penvpoints  = 3;
    547     Penvstretch = 0;
    548     Pforcedrelease = 0;
    549     Plinearenvelope = 0;
    550     assert(osc);
    551 make_ADSR_window();
    552 make_ASR_window();
    553 make_ADSRfilter_window();
    554 make_ASRbw_window();
    555 make_free_window();
    556 
    557 make_freemode_edit_window();
    558 
    559 envwindow=NULL;
    560 if(Envmode==3) envfreegroup->label("Frequency Envelope");
    561 if(Envmode==4) envfreegroup->label("Filter Envelope");
    562 if(Envmode==5) envfreegroup->label("Bandwidth Envelope");
    563 
    564 freemodeeditwindow->label(this->label());
    565 
    566 
    567 freeeditsmall->setpair(freeedit);
    568 freeedit->setpair(freeeditsmall);
    569 
    570 
    571 refresh_display();} {}
    572   }
    573   Function {rebase(std::string new_base)} {open
    574   } {
    575     code {Fl_Osc_Group::rebase(new_base);
    576     freemodeeditwindow->rebase(new_base+ext);} {}
    577   }
    578   Function {disable_freemode()} {open
    579   } {
    580     code {if (fl_choice("Discard free mode data?","No","Yes",NULL)==0)
    581         return;
    582 
    583     hide();
    584     int winx = Fl::event_x_root()-10;
    585     int winy = Fl::event_y_root()-155;
    586     winx = winx < 1 ? 1 : winx;
    587     winy = winy < 1 ? 1 : winy;
    588     freemodeeditwindow->hide();
    589 
    590     envwindow->hide();
    591     Fl_Group *par=envwindow->parent();
    592     par->hide();
    593 
    594     freemodehack->oscWrite("Pfreemode", "F");
    595     freeedit->update();
    596     envwindow->show();
    597     par->redraw();
    598 
    599     par->show();
    600     show();
    601     freemodeeditwindow->position(winx,winy);} {}
    602   }
    603   Function {refresh()} { open }
    604   { code {
    605     freemodehack->oscWrite("Pfreemode");
    606   } {}
    607   }
    608   Function {refresh_display()} {open
    609   } {
    610     code {
    611 
    612     sustaincounter->value(Penvsustain);
    613     sustaincounter->maximum(Penvpoints-2);
    614 
    615     envstretchdial->value(Penvstretch);
    616 
    617     if (Envmode > 2)
    618       linearenvelopecheck->hide();
    619     else {
    620       linearenvelopecheck->value(Plinearenvelope);
    621       linearenvelopecheck->show();
    622     }
    623 
    624     forcedreleasecheck->value(Pforcedrelease);
    625 
    626 envADSR->hide();
    627 envASR->hide();
    628 envADSRfilter->hide();
    629 envASRbw->hide();
    630 envfree->hide();
    631 
    632 if (freemodehack->value()) {
    633    envwindow=envfree;
    634    freeedit->update();
    635 } else {
    636    freemodeeditwindow->hide();
    637    switch(Envmode){
    638          case 1:
    639          case 2:
    640            envwindow=envADSR;
    641          break;
    642          case 3:
    643            envwindow=envASR;
    644          break; 
    645          case 4:
    646            envwindow=envADSRfilter;
    647          break; 
    648          case 5:
    649           envwindow=envASRbw;
    650          break;
    651          default:
    652          break; 
    653    }
    654 }
    655 
    656 assert(envwindow);
    657 envwindow->resize(this->x(),this->y(),this->w(),this->h());
    658 
    659 envwindow->show();} {}
    660   }
    661   decl {int Envmode;} {private local
    662   }
    663   decl {int Penvsustain;} {private local
    664   }
    665   decl {int Penvpoints;} {private local
    666   }
    667   decl {int Penvstretch;} {private local
    668   }
    669   decl {int Pforcedrelease;} {private local
    670   }
    671   decl {int Plinearenvelope;} {private local
    672   }
    673   decl {Fl_Group *envwindow;} {private local
    674   }
    675 }