X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=BenMorrow.pde;h=9314c3ce44318661de3af7095c8b0eaa48a259a3;hb=e27a8652bec75b053fbc2a10d0757f0da7ca4766;hp=9294250cda3e5740a688ccfe61724de74c28c0dd;hpb=1adfd26520e2d62cc85788624f711a86614f4c3b;p=SugarCubes.git diff --git a/BenMorrow.pde b/BenMorrow.pde old mode 100644 new mode 100755 index 9294250..9314c3c --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -135,15 +135,8 @@ class DriveableCrossSections extends CrossSections addParameter(xd); addParameter(yd); addParameter(zd); - addParameter(xr); - addParameter(yr); - addParameter(zr); - addParameter(xw); - addParameter(xl); - addParameter(yl); - addParameter(zl); - addParameter(yw); - addParameter(zw); + + super.addParams(); } public void onParameterChanged(LXParameter p) { @@ -151,13 +144,27 @@ class DriveableCrossSections extends CrossSections { if(interactive()) { - xd.setValue(x.getValue()/200); - yd.setValue(y.getValue()/200); - zd.setValue(z.getValue()/100); + copyValuesToKnobs(); + }else{ + copyKnobsToValues(); } } } + void copyValuesToKnobs() + { + xd.setValue(x.getValue()/200); + yd.setValue(y.getValue()/115); + zd.setValue(z.getValue()/100); + } + + void copyKnobsToValues() + { + x.setValue(xd.getValue()*200); + y.setValue(yd.getValue()*115); + z.setValue(zd.getValue()*100); + } + boolean interactive() { return Math.round(mode.getValuef())>0.5; @@ -168,11 +175,12 @@ class DriveableCrossSections extends CrossSections if(interactive()) { xv = xd.getValuef()*200; - yv = yd.getValuef()*200; + yv = yd.getValuef()*115; zv = zd.getValuef()*100; }else{ super.updateXYZVals(); + copyValuesToKnobs(); } } -} \ No newline at end of file +}