|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868 |
- # data file for the Fltk User Interface Designer (fluid)
- version 1.0110
- header_name {.h}
- code_name {.cc}
- decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {}
-
- decl {//License: GNU GPL version 2 or later} {}
-
- decl {\#include "WidgetPDial.h"} {public
- }
-
- decl {\#include <stdio.h>} {public
- }
-
- decl {\#include <stdlib.h>} {public
- }
-
- decl {\#include "../globals.h"} {public
- }
-
- decl {\#include <FL/Fl_Group.H>} {public
- }
-
- decl {\#include "../Params/EnvelopeParams.h"} {public
- }
-
- decl {\#include <FL/Fl_Box.H>} {public
- }
-
- decl {\#include <FL/fl_draw.H>} {public
- }
-
- decl {\#include <FL/fl_ask.H>} {public
- }
-
- decl {\#include "PresetsUI.h"} {public
- }
-
- decl {\#include "common.H"} {public
- }
-
- class EnvelopeFreeEdit {: {public Fl_Box}
- } {
- Function {EnvelopeFreeEdit(int x,int y, int w, int h, const char *label=0):Fl_Box(x,y,w,h,label)} {} {
- code {env=NULL;
- pair=NULL;} {}
- }
- Function {init(EnvelopeParams *env_)} {} {
- code {env=env_;
- oldx=-1;
- currentpoint=-1;
- cpx=0;
- lastpoint=-1;} {}
- }
- Function {setpair(Fl_Box *pair_)} {} {
- code {pair=pair_;} {}
- }
- Function {getpointx(int n)} {return_type int
- } {
- code {int lx=w()-10;
- int npoints=env->Penvpoints;
-
- float sum=0;
- for (int i=1;i<npoints;i++) sum+=env->getdt(i)+1;
-
- float sumbefore=0;//the sum of all points before the computed point
- for (int i=1;i<=n;i++) sumbefore+=env->getdt(i)+1;
-
- return((int) (sumbefore/(float) sum*lx));} {}
- }
- Function {getpointy(int n)} {return_type int
- } {
- code {int ly=h()-10;
-
- return((int) ((1.0-env->Penvval[n]/127.0)*ly));} {}
- }
- Function {getnearest(int x,int y)} {return_type int
- } {
- code {x-=5;y-=5;
-
- int nearestpoint=0;
- int nearestval=1000000;//a big value
- for (int i=0;i<env->Penvpoints;i++){
- int distance=abs(x-getpointx(i))+abs(y-getpointy(i));
- if (distance<nearestval) {
- nearestpoint=i;
- nearestval=distance;
- };
- };
- return(nearestpoint);} {}
- }
- Function {draw()} {private
- } {
- code {int ox=x(),oy=y(),lx=w(),ly=h();
- if (env->Pfreemode==0) env->converttofree();
- int npoints=env->Penvpoints;
-
- if (active_r()) fl_color(FL_BLACK);
- else fl_color(90,90,90);
- if (!active_r()) currentpoint=-1;
-
- fl_rectf(ox,oy,lx,ly);
-
- ox+=5;oy+=5;lx-=10;ly-=10;
-
- //draw the lines
- fl_color(FL_GRAY);
-
- fl_line_style(FL_SOLID);
- fl_line(ox+2,oy+ly/2,ox+lx-2,oy+ly/2);
-
- //draws the evelope points and lines
- Fl_Color alb=FL_WHITE;
- if (!active_r()) alb=fl_rgb_color(180,180,180);
- fl_color(alb);
- int oldxx=0,xx=0,oldyy=0,yy=getpointy(0);
- fl_rectf(ox-3,oy+yy-3,6,6);
- for (int i=1;i<npoints;i++){
- oldxx=xx;oldyy=yy;
- xx=getpointx(i);yy=getpointy(i);
- if (i==currentpoint) fl_color(FL_RED);
- else fl_color(alb);
- fl_line(ox+oldxx,oy+oldyy,ox+xx,oy+yy);
- fl_rectf(ox+xx-3,oy+yy-3,6,6);
- };
-
- //draw the last moved point point (if exists)
- if (lastpoint>=0){
- fl_color(FL_CYAN);
- fl_rectf(ox+getpointx(lastpoint)-5,oy+getpointy(lastpoint)-5,10,10);
- };
-
- //draw the sustain position
- if (env->Penvsustain>0){
- fl_color(FL_YELLOW);
- xx=getpointx(env->Penvsustain);
- fl_line(ox+xx,oy+0,ox+xx,oy+ly);
- };
-
- //Show the envelope duration and the current line duration
- fl_font(FL_HELVETICA|FL_BOLD,10);
- float time=0.0;
- if (currentpoint<=0){
- fl_color(alb);
- for (int i=1;i<npoints;i++) time+=env->getdt(i);
- } else {
- fl_color(255,0,0);
- time=env->getdt(currentpoint);
- };
- char tmpstr[20];
- if (time<1000.0) snprintf((char *)&tmpstr,20,"%.1fms",time);
- else snprintf((char *)&tmpstr,20,"%.2fs",time/1000.0);
- fl_draw(tmpstr,ox+lx-20,oy+ly-10,20,10,FL_ALIGN_RIGHT,NULL,0);} {}
- }
- Function {handle(int event)} {return_type int
- } {
- code {int x_=Fl::event_x()-x();
- int y_=Fl::event_y()-y();
-
- if (event==FL_PUSH) {
- currentpoint=getnearest(x_,y_);
- cpx=x_;
- cpdt=env->Penvdt[currentpoint];
- lastpoint=currentpoint;
- redraw();
- if (pair!=NULL) pair->redraw();
- };
-
- if (event==FL_RELEASE){
- currentpoint=-1;
- redraw();
- if (pair!=NULL) pair->redraw();
- };
-
- if ((event==FL_DRAG)&&(currentpoint>=0)){
- int ny=127-(int) (y_*127.0/h());
- if (ny<0) ny=0;if (ny>127) ny=127;
- env->Penvval[currentpoint]=ny;
-
- int dx=(int)((x_-cpx)*0.1);
- int newdt=cpdt+dx;
- if (newdt<0) newdt=0;if (newdt>127) newdt=127;
- if (currentpoint!=0) env->Penvdt[currentpoint]=newdt;
- else env->Penvdt[currentpoint]=0;
-
- redraw();
- if (pair!=NULL) pair->redraw();
- };
-
-
- return(1);} {}
- }
- decl {Fl_Box *pair;} {}
- decl {EnvelopeParams *env;} {}
- decl {int oldx,oldy;} {}
- decl {int currentpoint,cpx,cpdt;} {}
- decl {int lastpoint;} {public
- }
- }
-
- class EnvelopeUI {open : {public Fl_Group,PresetsUI_}
- } {
- Function {EnvelopeUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
- code {env=NULL;
- freemodeeditwindow=NULL;
- envADSR=NULL;
- envASR=NULL;
- envADSRfilter=NULL;
- envASRbw=NULL;
- envfree=NULL;} {}
- }
- Function {~EnvelopeUI()} {} {
- code {envwindow->hide();
- hide();
- freemodeeditwindow->hide();
- delete (freemodeeditwindow);} {}
- }
- Function {make_freemode_edit_window()} {open
- } {
- Fl_Window freemodeeditwindow {
- label Envelope
- xywh {702 269 575 180} type Double visible
- } {
- Fl_Box freeedit {
- label Envelope
- xywh {5 5 565 145} box FLAT_BOX color 0
- code0 {o->init(env);}
- class EnvelopeFreeEdit
- }
- Fl_Button addpoint {
- label {Add point}
- callback {int curpoint=freeedit->lastpoint;
- if (curpoint<0) return;
- //if (curpoint>=env->Penvpoints-1) return;
- if (env->Penvpoints>=MAX_ENVELOPE_POINTS) return;
-
- for (int i=env->Penvpoints;i>=curpoint+1;i--){
- env->Penvdt[i]=env->Penvdt[i-1];
- env->Penvval[i]=env->Penvval[i-1];
- };
-
- if (curpoint==0) {
- env->Penvdt[1]=64;
- };
-
- env->Penvpoints++;
- if (curpoint<=env->Penvsustain) env->Penvsustain++;
-
- freeedit->lastpoint+=1;
- freeedit->redraw();
- envfree->redraw();
-
- sustaincounter->value(env->Penvsustain);
- sustaincounter->maximum(env->Penvpoints-2);}
- xywh {115 155 80 20} box THIN_UP_BOX labelsize 11
- code0 {if (env->Pfreemode==0) o->hide();}
- }
- Fl_Button deletepoint {
- label {Delete point}
- callback {int curpoint=freeedit->lastpoint;
- if (curpoint<1) return;
- if (curpoint>=env->Penvpoints-1) return;
- if (env->Penvpoints<=3) return;
-
- for (int i=curpoint+1;i<env->Penvpoints;i++){
- env->Penvdt[i-1]=env->Penvdt[i];
- env->Penvval[i-1]=env->Penvval[i];
- };
-
- env->Penvpoints--;
-
- if (curpoint<=env->Penvsustain) env->Penvsustain--;
-
-
- freeedit->lastpoint-=1;
- freeedit->redraw();
- envfree->redraw();
-
- sustaincounter->value(env->Penvsustain);
- sustaincounter->maximum(env->Penvpoints-2);}
- xywh {200 155 80 20} box THIN_UP_BOX labelsize 11
- code0 {if (env->Pfreemode==0) o->hide();}
- }
- Fl_Light_Button freemodebutton {
- label FreeMode
- callback {reinit();
-
- freeedit->lastpoint=-1;
- freeedit->redraw();}
- tooltip {Enable or disable the freemode} xywh {10 155 95 20} labelsize 11
- }
- Fl_Check_Button forcedreleasecheck {
- label frcR
- callback {env->Pforcedrelease=(int)o->value();}
- tooltip {Forced Relase} xywh {410 165 40 15} down_box DOWN_BOX labelsize 10
- code0 {o->value(env->Pforcedrelease);}
- code1 {if (env->Pfreemode==0) o->hide();}
- }
- Fl_Dial envstretchdial {
- label {Str.}
- callback {env->Penvstretch=(int)o->value();}
- 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
- code0 {o->value(env->Penvstretch);}
- code1 {if (env->Pfreemode==0) o->hide();}
- class WidgetPDial
- }
- Fl_Button {} {
- label Close
- callback {freemodeeditwindow->hide();}
- xywh {510 155 60 20} box THIN_UP_BOX
- }
- Fl_Check_Button linearenvelopecheck {
- label L
- callback {env->Plinearenvelope=(int)o->value();}
- tooltip {Linear Envelope} xywh {410 151 30 15} down_box DOWN_BOX labelsize 10
- code0 {o->value(env->Plinearenvelope);}
- code1 {if ((env->Pfreemode==0)||(env->Envmode>2)) o->hide();}
- }
- Fl_Counter sustaincounter {
- label Sust
- callback {env->Penvsustain=(int) o->value();
- freeedit->redraw();
- envfree->redraw();}
- tooltip {Sustain (0 is disabled)} xywh {315 155 40 15} type Simple labelsize 11 align 4 minimum 0 maximum 127 step 1
- code0 {o->value(env->Penvsustain);}
- code1 {if (env->Pfreemode==0) o->hide();}
- code2 {o->maximum(env->Penvpoints-2);}
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(env);}
- xywh {465 160 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {presetsui->paste(env,this);}
- xywh {482 160 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- }
- }
- Function {make_ADSR_window()} {open
- } {
- Fl_Window envADSR {open
- xywh {344 788 205 70} type Double color 50 labelfont 1
- class Fl_Group visible
- } {
- Fl_Group {} {
- label {Amplitude Envelope}
- xywh {0 0 205 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
- code0 {set_module_parameters(o);}
- } {
- Fl_Dial e1adt {
- label {A.dt}
- callback {env->PA_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Attack time} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_dt);}
- class WidgetPDial
- }
- Fl_Dial e1ddt {
- label {D.dt}
- callback {env->PD_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Decay time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PD_dt);}
- class WidgetPDial
- }
- Fl_Dial e1rdt {
- label {R.dt}
- callback {env->PR_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Release time} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_dt);}
- class WidgetPDial
- }
- Fl_Dial e1sval {
- label {S.val}
- callback {env->PS_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Sustain value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PS_val);}
- class WidgetPDial
- }
- Fl_Check_Button e1forcedrelease {
- label frcR
- callback {env->Pforcedrelease=(int)o->value();}
- tooltip {Forced Relase} xywh {180 35 20 15} down_box DOWN_BOX labelsize 10 align 6
- code0 {o->value(env->Pforcedrelease);}
- }
- Fl_Dial e1envstretch {
- label Stretch
- callback {env->Penvstretch=(int)o->value();}
- 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
- code0 {o->value(env->Penvstretch);}
- class WidgetPDial
- }
- Fl_Button {} {
- label E
- callback {freemodeeditwindow->show();}
- tooltip {Envelope window} xywh {185 5 15 15} labelfont 1 labelsize 10
- }
- Fl_Check_Button e1linearenvelope {
- label L
- callback {env->Plinearenvelope=(int)o->value();}
- tooltip {The evelope is linear} xywh {180 20 15 15} down_box DOWN_BOX labelsize 10 align 4
- code0 {o->value(env->Plinearenvelope);}
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(env);}
- xywh {150 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {presetsui->paste(env,this);}
- xywh {167 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- }
- }
- }
- Function {make_ASR_window()} {open
- } {
- Fl_Window envASR {open
- xywh {648 667 210 70} type Double
- class Fl_Group visible
- } {
- Fl_Group {} {
- label {Frequency Envelope}
- xywh {0 0 210 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
- code0 {set_module_parameters(o);}
- } {
- Fl_Dial e2aval {
- label {A.val}
- callback {env->PA_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_val);}
- class WidgetPDial
- }
- Fl_Dial e2adt {
- label {A.dt}
- callback {env->PA_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_dt);}
- class WidgetPDial
- }
- Fl_Dial e2rval {
- label {R.val}
- callback {env->PR_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Release value} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_val);}
- class WidgetPDial
- }
- Fl_Dial e2rdt {
- label {R.dt}
- callback {env->PR_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Release time} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_dt);}
- class WidgetPDial
- }
- Fl_Dial e2envstretch {
- label Stretch
- callback {env->Penvstretch=(int)o->value();}
- 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
- code0 {o->value(env->Penvstretch);}
- class WidgetPDial
- }
- Fl_Check_Button e2forcedrelease {
- label frcR
- callback {env->Pforcedrelease=(int)o->value();}
- tooltip {Forced release} xywh {180 25 15 25} down_box DOWN_BOX labelsize 10 align 6
- code0 {o->value(env->Pforcedrelease);}
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(env);}
- xywh {155 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {presetsui->paste(env,this);}
- xywh {172 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- }
- Fl_Button {} {
- label E
- callback {freemodeeditwindow->show();}
- tooltip {Envelope window} xywh {190 5 15 15} labelfont 1 labelsize 10
- }
- }
- }
- Function {make_ADSRfilter_window()} {open
- } {
- Fl_Window envADSRfilter {open selected
- xywh {627 569 275 70} type Double color 50 labelfont 1
- class Fl_Group visible
- } {
- Fl_Group {} {
- label {Filter Envelope}
- xywh {0 0 275 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
- code0 {set_module_parameters(o);}
- } {
- Fl_Dial e3aval {
- label {A.val}
- callback {env->PA_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_val);}
- class WidgetPDial
- }
- Fl_Dial e3adt {
- label {A.dt}
- callback {env->PA_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_dt);}
- class WidgetPDial
- }
- Fl_Dial e3dval {
- label {D.val}
- callback {env->PD_val=(int)o->value();
- freeedit->redraw();}
- tooltip {decay value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PD_val);}
- class WidgetPDial
- }
- Fl_Dial e3ddt {
- label {D.dt}
- callback {env->PD_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {decay time} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PD_dt);}
- class WidgetPDial
- }
- Fl_Dial e3rdt {
- label {R.dt}
- callback {env->PR_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Release time} xywh {145 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_dt);}
- class WidgetPDial
- }
- Fl_Dial e3rval {
- label {R.val}
- callback {env->PR_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Release value} xywh {180 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_val);}
- class WidgetPDial
- }
- Fl_Dial e3envstretch {
- label Stretch
- callback {env->Penvstretch=(int)o->value();}
- 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
- code0 {o->value(env->Penvstretch);}
- class WidgetPDial
- }
- Fl_Check_Button e3forcedrelease {
- label frcR
- callback {env->Pforcedrelease=(int)o->value();}
- tooltip {Forced Relase} xywh {250 30 15 20} down_box DOWN_BOX labelsize 10 align 6
- code0 {o->value(env->Pforcedrelease);}
- }
- Fl_Button {} {
- label E
- callback {freemodeeditwindow->show();}
- xywh {255 5 15 15} labelfont 1 labelsize 10
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(env);}
- xywh {220 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {presetsui->paste(env,this);}
- xywh {237 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- }
- }
- }
- Function {make_ASRbw_window()} {open
- } {
- Fl_Window envASRbw {open
- xywh {362 642 210 70} type Double
- code0 {set_module_parameters(o);}
- class Fl_Group visible
- } {
- Fl_Group {} {
- label {BandWidth Envelope}
- xywh {0 0 210 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
- code0 {set_module_parameters(o);}
- } {
- Fl_Dial e4aval {
- label {A.val}
- callback {env->PA_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_val);}
- class WidgetPDial
- }
- Fl_Dial e4adt {
- label {A.dt}
- callback {env->PA_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PA_dt);}
- class WidgetPDial
- }
- Fl_Dial e4rval {
- label {R.val}
- callback {env->PR_val=(int)o->value();
- freeedit->redraw();}
- tooltip {Release value} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_val);}
- class WidgetPDial
- }
- Fl_Dial e4rdt {
- label {R.dt}
- callback {env->PR_dt=(int)o->value();
- freeedit->redraw();}
- tooltip {Release time} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(env->PR_dt);}
- class WidgetPDial
- }
- Fl_Dial e4envstretch {
- label Stretch
- callback {env->Penvstretch=(int)o->value();}
- 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
- code0 {o->value(env->Penvstretch);}
- class WidgetPDial
- }
- Fl_Check_Button e4forcedrelease {
- label frcR
- callback {env->Pforcedrelease=(int)o->value();}
- tooltip {Forced release} xywh {180 25 15 25} down_box DOWN_BOX labelsize 10 align 6
- code0 {o->value(env->Pforcedrelease);}
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(env);}
- xywh {155 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {presetsui->paste(env,this);}
- xywh {172 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- }
- Fl_Button {} {
- label E
- callback {freemodeeditwindow->show();}
- xywh {190 5 15 15} labelfont 1 labelsize 10
- }
- }
- }
- Function {make_free_window()} {open
- } {
- Fl_Window envfree {open
- xywh {376 436 205 70} type Double color 50 labelfont 1 resizable
- code0 {set_module_parameters(o);}
- class Fl_Group visible
- } {
- Fl_Group envfreegroup {
- label {Amplitude Envelope}
- xywh {0 0 205 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17 resizable
- code0 {set_module_parameters(o);}
- } {
- Fl_Box freeeditsmall {
- label Envelope
- callback {envfree->redraw();}
- xywh {5 20 195 45} box FLAT_BOX color 0 resizable
- code0 {o->init(env);}
- class EnvelopeFreeEdit
- }
- Fl_Button {} {
- label E
- callback {freemodeeditwindow->show();}
- xywh {185 5 15 15} labelfont 1 labelsize 10
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(env);}
- xywh {150 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {presetsui->paste(env,this);}
- xywh {167 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
- }
- }
- }
- }
- Function {init(EnvelopeParams *env_)} {open
- } {
- code {env=env_;
- make_ADSR_window();
- make_ASR_window();
- make_ADSRfilter_window();
- make_ASRbw_window();
- make_free_window();
-
- make_freemode_edit_window();
-
- envwindow=NULL;
- if (env->Envmode==3) envfreegroup->label("Frequency Envelope");
- if (env->Envmode==4) envfreegroup->label("Filter Envelope");
- if (env->Envmode==5) envfreegroup->label("Bandwidth Envelope");
-
- freemodeeditwindow->label(this->label());
-
-
- freeeditsmall->setpair(freeedit);
- freeedit->setpair(freeeditsmall);
-
-
- refresh();} {}
- }
- Function {reinit()} {} {
- code {if (env->Pfreemode!=0){
- int answer=fl_choice("Disable the free mode of the Envelope?","No","Yes",NULL);
- if (env->Pfreemode!=0) freemodebutton->value(1);
- else freemodebutton->value(0);
- if (answer==0) return;
- };
-
- if (env->Pfreemode==0) env->Pfreemode=1;
- else env->Pfreemode=0;
-
- hide();
- int winx=freemodeeditwindow->x();
- int winy=freemodeeditwindow->y();
-
- freemodeeditwindow->hide();
-
- envwindow->hide();
- Fl_Group *par=envwindow->parent();
- par->hide();
-
-
- refresh();
- envwindow->show();
- par->redraw();
-
- par->show();
- show();
- freemodeeditwindow->position(winx,winy);
- freemodeeditwindow->show();
-
- if (env->Pfreemode!=0) {
- freemodebutton->value(1);
- addpoint->show();
- deletepoint->show();
- forcedreleasecheck->show();
- }else{
- freemodebutton->value(0);
- addpoint->hide();
- deletepoint->hide();
- forcedreleasecheck->hide();
- };} {}
- }
- Function {refresh()} {open
- } {
- code {freemodebutton->value(env->Pfreemode);
-
- sustaincounter->value(env->Penvsustain);
- if (env->Pfreemode==0) sustaincounter->hide();
- else sustaincounter->show();
- sustaincounter->maximum(env->Penvpoints-2);
-
- envstretchdial->value(env->Penvstretch);
- if (env->Pfreemode==0) envstretchdial->hide();
- else envstretchdial->show();
-
- linearenvelopecheck->value(env->Plinearenvelope);
- if ((env->Pfreemode==0)||(env->Envmode>2)) linearenvelopecheck->hide();
- else linearenvelopecheck->show();
-
- forcedreleasecheck->value(env->Pforcedrelease);
- if (env->Pfreemode==0) forcedreleasecheck->hide();
-
- freeedit->redraw();
-
-
- if (env->Pfreemode==0){
- switch(env->Envmode){
- case(1):
- case(2):
- e1adt->value(env->PA_dt);
- e1ddt->value(env->PD_dt);
- e1sval->value(env->PS_val);
- e1rdt->value(env->PR_dt);
- e1envstretch->value(env->Penvstretch);
- e1linearenvelope->value(env->Plinearenvelope);
- e1forcedrelease->value(env->Pforcedrelease);
- break;
- case(3):
- e2aval->value(env->PA_val);
- e2adt->value(env->PA_dt);
- e2rdt->value(env->PR_dt);
- e2rval->value(env->PR_val);
- e2envstretch->value(env->Penvstretch);
- e2forcedrelease->value(env->Pforcedrelease);
- break;
- case(4):
- e3aval->value(env->PA_val);
- e3adt->value(env->PA_dt);
- e3dval->value(env->PD_val);
- e3ddt->value(env->PD_dt);
- e3rdt->value(env->PR_dt);
- e3rval->value(env->PR_val);
- e3envstretch->value(env->Penvstretch);
- e3forcedrelease->value(env->Pforcedrelease);
- break;
- case(5):
- e4aval->value(env->PA_val);
- e4adt->value(env->PA_dt);
- e4rdt->value(env->PR_dt);
- e4rval->value(env->PR_val);
- e4envstretch->value(env->Penvstretch);
- e4forcedrelease->value(env->Pforcedrelease);
- break;
- default:
- break;
- };
- }else{
- envfree->redraw();
- };
-
-
- envADSR->hide();
- envASR->hide();
- envADSRfilter->hide();
- envASRbw->hide();
- envfree->hide();
-
- if (env->Pfreemode==0){
- switch(env->Envmode){
- case(1):
- case(2):
- envwindow=envADSR;
- break;
- case(3):
- envwindow=envASR;
- break;
- case(4):
- envwindow=envADSRfilter;
- break;
- case(5):
- envwindow=envASRbw;
- break;
- default:
- break;
- };
- }else{
- envwindow=envfree;
- };
-
- envwindow->resize(this->x(),this->y(),this->w(),this->h());
-
- envwindow->show();} {}
- }
- decl {EnvelopeParams *env;} {}
- decl {Fl_Group *envwindow;} {}
- }
|