From: Ben Morrow Date: Mon, 19 Aug 2013 04:22:28 +0000 (-0700) Subject: Update DriveableCrossSections to show knob values live X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=efa0f27b8b4f6fbf16b2dc7aadf8164a7a0e3e97;p=SugarCubes.git Update DriveableCrossSections to show knob values live --- diff --git a/BenMorrow.pde b/BenMorrow.pde index 9294250..c632b8d 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -151,13 +151,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,10 +182,11 @@ 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(); } }