computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit c63403e7d0b1dd7a1ad85af233b3ea346fec3b7a
parent b34e0c2c52c666d5e72d57f7c69f28c674cfc329
Author: Adam M <aemalone@gmail.com>
Date:   Thu,  4 Jul 2019 12:24:10 -0500

Laundry Soup working with v1 API

Diffstat:
Mres/ComputerscareILoveCookiesPanel.svg | 24+++++++++++++-----------
Mres/ComputerscareLaundrySoupPanel.svg | 73+++++++++++++++++++++++++++++++++++++------------------------------------
Msrc/Computerscare.hpp | 43+++++++++++++++++++++++++++++++++++++++----
Msrc/ComputerscareDebug.cpp | 6------
Msrc/ComputerscareLaundrySoup.cpp | 66+++++++++++++++++++++---------------------------------------------
Msrc/dtpulse.cpp | 4++--
6 files changed, 112 insertions(+), 104 deletions(-)

diff --git a/res/ComputerscareILoveCookiesPanel.svg b/res/ComputerscareILoveCookiesPanel.svg @@ -34,9 +34,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="5.6568544" - inkscape:cx="134.26049" - inkscape:cy="357.21727" + inkscape:zoom="2.8284272" + inkscape:cx="158.94105" + inkscape:cy="14.056024" inkscape:document-units="mm" inkscape:current-layer="text1651" showgrid="false" @@ -142,8 +142,8 @@ id="path1723" inkscape:connector-curvature="0" /> <path - d="m 26.461145,294.55605 0.06378,0.0969 -1.229442,0.0548 q 0.152154,0.2038 0.371272,0.30486 0.21984,0.1 0.485838,0.088 0.154066,-0.007 0.279558,-0.0413 0.12691,-0.0345 0.23245,-0.0969 l 0.123335,0.18736 q -0.114079,0.0517 -0.249577,0.0821 -0.135569,0.0305 -0.291027,0.0373 -0.389751,0.0169 -0.728229,-0.1404 -0.337316,-0.15784 -0.525894,-0.44424 -0.194954,-0.29611 -0.09402,-0.47912 0.101706,-0.1841 0.467919,-0.20046 0.328404,-0.0147 0.622318,0.13404 0.294642,0.14757 0.471873,0.41677 z m -0.305714,-0.0463 q -0.110013,-0.16246 -0.294376,-0.25398 -0.18296,-0.0916 -0.380663,-0.0827 -0.22415,0.009 -0.297261,0.10974 -0.07205,0.0997 0.01965,0.2707 z" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.24368711" + d="m 28.98163,294.44578 0.146231,0.0933 -3.211735,0.14153 q 0.354442,0.19495 0.904205,0.28154 0.551859,0.0855 1.246769,0.0547 0.402502,-0.0179 0.736198,-0.0613 0.337428,-0.0437 0.624927,-0.11407 l 0.282779,0.18038 q -0.307541,0.0602 -0.666488,0.10034 -0.359153,0.0403 -0.765237,0.058 -1.018071,0.0444 -1.867062,-0.0906 -0.845857,-0.1356 -1.278238,-0.41133 -0.446995,-0.28508 -0.146836,-0.47681 0.302391,-0.19288 1.259075,-0.23507 0.85792,-0.0379 1.59265,0.0916 0.736865,0.12822 1.143222,0.38739 z m -0.786385,-0.0253 q -0.253187,-0.1562 -0.714425,-0.23561 -0.457568,-0.0796 -0.974056,-0.0567 -0.585356,0.0248 -0.79627,0.13157 -0.20794,0.10564 -0.0042,0.27174 z" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.39385325" id="path1725" inkscape:connector-curvature="0" /> <text @@ -185,20 +185,22 @@ style="font-style:normal;font-weight:normal;font-size:3.52777767px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.07000434" id="text892"> <path - d="m -21.637912,192.23885 q -0.254937,0 -0.403076,0.19981 -0.148139,0.1981 -0.148139,0.54433 0,0.34623 0.146417,0.54605 0.148139,0.19809 0.404798,0.19809 0.253215,0 0.401354,-0.19982 0.148139,-0.19981 0.148139,-0.54432 0,-0.34279 -0.148139,-0.5426 -0.148139,-0.20154 -0.401354,-0.20154 z m 0,-0.26872 q 0.413412,0 0.649401,0.26872 0.235989,0.26872 0.235989,0.74414 0,0.4737 -0.235989,0.74414 -0.235989,0.26872 -0.649401,0.26872 -0.415134,0 -0.651123,-0.26872 -0.234266,-0.27044 -0.234266,-0.74414 0,-0.47542 0.234266,-0.74414 0.235989,-0.26872 0.651123,-0.26872 z" + d="m -19.32925,192.26626 q -0.275053,-0.0699 -0.43942,0.0736 -0.164328,0.14187 -0.172193,0.46078 -0.0079,0.31891 0.145566,0.5431 0.155328,0.22306 0.432239,0.2934 0.273195,0.0694 0.437562,-0.074 0.164367,-0.14344 0.172193,-0.46077 0.0078,-0.31574 -0.147502,-0.54039 -0.15525,-0.22624 -0.428445,-0.29564 z m 0.0061,-0.24751 q 0.446032,0.1133 0.694537,0.4255 0.248506,0.31219 0.237706,0.7501 -0.01076,0.43632 -0.271514,0.62075 -0.260714,0.18283 -0.706747,0.0695 -0.44789,-0.11378 -0.696395,-0.42598 -0.246608,-0.3133 -0.235847,-0.74963 0.0108,-0.4379 0.269655,-0.62121 0.260714,-0.18284 0.708605,-0.0691 z" style="stroke-width:0.07000434" id="path894" inkscape:connector-curvature="0" /> <path - d="m -18.657729,192.65297 0.191769,1.13213 -0.317087,0.0526 -0.190066,-1.12207 q -0.04511,-0.26629 -0.174362,-0.38088 -0.129256,-0.11459 -0.342945,-0.0791 -0.256773,0.0426 -0.378027,0.22625 -0.121254,0.18367 -0.07473,0.45833 l 0.179571,1.06012 -0.318811,0.0529 -0.317724,-1.87572 0.318811,-0.0529 0.04936,0.2914 q 0.08508,-0.18801 0.224276,-0.29717 0.140918,-0.10943 0.342544,-0.14286 0.332598,-0.0552 0.537247,0.11753 0.204365,0.171 0.270179,0.55954 z" + d="m -17.557657,192.6174 1.207346,0.68445 -0.22743,0.0947 -0.78188,-0.40011 c -0.212025,-0.11354 -0.34982,-0.15667 -0.413385,-0.1294 -0.06357,0.0273 -0.05354,0.12461 0.03007,0.29202 0.100429,0.20114 0.231252,0.35304 0.415864,0.53695 0.184629,0.18392 0.283787,0.239 0.502477,0.35611 l 0.597443,0.15057 0.152883,0.3428 -0.807194,-0.2758 c -0.883426,-0.78295 -0.797926,-0.78987 -0.9137,-0.89235 -0.127303,-0.15717 -0.230376,-0.31473 -0.309218,-0.47266 -0.130103,-0.26054 -0.148483,-0.41477 -0.05514,-0.46269 0.09196,-0.0487 0.292627,0.01 0.60199,0.17552 z" style="stroke-width:0.07000434" id="path896" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccccccc" /> <path - d="m -16.339355,192.90203 v 0.15503 h -1.457275 q 0.02067,0.32728 0.19637,0.49954 0.177423,0.17053 0.492649,0.17053 0.18259,0 0.353122,-0.0448 0.172255,-0.0448 0.341065,-0.13436 v 0.29973 q -0.170533,0.0723 -0.349678,0.11024 -0.179144,0.0379 -0.363457,0.0379 -0.461643,0 -0.732083,-0.26872 -0.268717,-0.26872 -0.268717,-0.72692 0,-0.4737 0.254937,-0.75103 0.256659,-0.27905 0.690741,-0.27905 0.389296,0 0.61495,0.25149 0.227376,0.24977 0.227376,0.68041 z m -0.316949,-0.093 q -0.0034,-0.2601 -0.146416,-0.41513 -0.141249,-0.15503 -0.375516,-0.15503 -0.265272,0 -0.425469,0.14986 -0.158474,0.14986 -0.18259,0.42202 z" + d="m -20.624266,192.86347 -0.02968,0.048 -0.113824,0.0492 -1.506176,-0.43705 c -0.01563,0.19082 0.03381,0.35425 0.148306,0.49029 0.115947,0.13543 0.291279,0.2372 0.525997,0.30531 0.135957,0.0395 0.180157,-0.072 0.311384,-0.0607 0.132507,0.0117 0.265854,0.0104 0.40004,-0.004 l 0.04678,0.39276 c -0.133832,0.004 -0.269242,-0.002 -0.40623,-0.0192 -0.136984,-0.0171 -0.274096,-0.0455 -0.411335,-0.0854 -0.343741,-0.0998 -0.603562,-0.25535 -0.779463,-0.46678 -0.174618,-0.21106 -0.240213,-0.44704 -0.196784,-0.70793 0.04489,-0.26971 0.175398,-0.45599 0.391515,-0.55882 0.217558,-0.10343 0.487946,-0.10826 0.811165,-0.0145 0.289871,0.0841 0.5069,0.22211 0.651086,0.41409 0.145631,0.19134 0.198038,0.40961 0.157222,0.65482 z m -0.34078,-0.18215 c 0.02212,-0.14883 -0.01272,-0.28283 -0.104513,-0.402 -0.09048,-0.11879 -0.222939,-0.2035 -0.397375,-0.25412 -0.197523,-0.0573 -0.363027,-0.0606 -0.496514,-0.01 -0.132204,0.0511 -0.220182,0.15149 -0.263934,0.30127 z" style="stroke-width:0.07000434" id="path898" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccccccccccccccc" /> </g> <g aria-label="I Love Cookies" @@ -310,7 +312,7 @@ id="text1057" /> <g id="g8072" - transform="matrix(0.26889251,-0.01002392,-0.03200614,0.19788514,41.90235,292.24297)"> + transform="matrix(0.47536021,-0.01002392,-0.05658189,0.19788514,36.062466,292.24297)"> <g style="display:inline" inkscape:label="Layer 1" diff --git a/res/ComputerscareLaundrySoupPanel.svg b/res/ComputerscareLaundrySoupPanel.svg @@ -34,11 +34,11 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="4.0000001" - inkscape:cx="57.159121" - inkscape:cy="365.51563" + inkscape:zoom="8.0000002" + inkscape:cx="131.75174" + inkscape:cy="351.54654" inkscape:document-units="mm" - inkscape:current-layer="text1651" + inkscape:current-layer="text984" showgrid="false" units="px" inkscape:snap-bbox="true" @@ -71,11 +71,6 @@ id="g1669" inkscape:groupmode="layer" inkscape:label="Layer 1 copy"> - <path - inkscape:connector-curvature="0" - id="path1647" - d="M 0,196.45832 H 52.916667 V 297 H 0 Z" - style="opacity:1;vector-effect:none;fill:#f9f9f9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.72459143;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> <g aria-label="computerscare" transform="matrix(0.98656289,0.0441007,-0.12576361,1.0079983,50.102321,-2.779225)" @@ -162,8 +157,8 @@ id="path921" inkscape:connector-curvature="0" /> <path - d="m -36.944252,205.30129 0.03032,-2.71906 0.527487,7.3e-4 -0.03001,2.69101 q -0.0071,0.63764 0.167055,0.95858 0.174209,0.3169 0.529695,0.3171 0.427157,2.7e-4 0.677951,-0.38066 0.253663,-0.38088 0.260998,-1.03858 l 0.02839,-2.54664 0.527487,7.3e-4 -0.05009,4.49172 -0.527487,-7.3e-4 0.0076,-0.68981 q -0.196638,0.409 -0.454022,0.60938 -0.254471,0.19638 -0.58989,0.19623 -0.553299,-2e-5 -0.834611,-0.48169 -0.281315,-0.4814 -0.270984,-1.40781 z" - style="stroke-width:0.04593363" + d="m -36.944252,205.60455 0.03032,-2.28277 0.527487,6.2e-4 -0.03001,2.25922 q -0.0071,0.53532 0.167055,0.80477 0.174209,0.26605 0.529695,0.26622 0.427157,2.2e-4 0.677951,-0.31959 0.253663,-0.31976 0.260998,-0.87193 l 0.02839,-2.13801 0.527487,6.1e-4 -0.05009,3.77099 -0.527487,-6.1e-4 0.0076,-0.57912 q -0.196638,0.34337 -0.454022,0.5116 -0.254471,0.16487 -0.58989,0.16474 -0.553299,-2e-5 -0.834611,-0.4044 -0.281315,-0.40416 -0.270984,-1.18192 z" + style="stroke-width:0.04208743" id="path923" inkscape:connector-curvature="0" /> <path @@ -177,25 +172,28 @@ id="path927" inkscape:connector-curvature="0" /> <path - d="m -24.631518,201.77574 q -0.08303,-0.0845 -0.182127,-0.12194 -0.09642,-0.0421 -0.214269,-0.0421 -0.417822,0 -0.642804,0.47833 -0.222303,0.47365 -0.222303,1.36462 v 2.7668 h -0.495494 v -5.2522 h 0.495494 v 0.81597 q 0.155345,-0.47832 0.404432,-0.70811 0.249085,-0.23447 0.605306,-0.23447 0.05089,0 0.112491,0.0146 0.0616,0.009 0.136596,0.0328 z" - style="stroke-width:0.04800957" + d="m -23.920049,202.6936 q -0.07646,-0.0535 -0.172648,-0.0772 -0.09315,-0.0267 -0.210996,-0.0267 -0.417822,0 -0.679988,0.30295 -0.259124,0.29999 -0.328385,0.86429 l -0.215085,1.75235 h -0.495494 l 0.408294,-3.32648 h 0.495494 l -0.06343,0.51679 q 0.192529,-0.30294 0.459479,-0.44848 0.267312,-0.1485 0.623533,-0.1485 0.05089,0 0.111356,0.009 0.0609,0.006 0.134046,0.0208 z" + style="stroke-width:0.0382076" id="path929" inkscape:connector-curvature="0" /> <path - d="m -21.592765,204.59163 q -0.331323,0.57897 -0.637453,0.75551 -0.30613,0.17654 -0.812591,0.17641 l -0.600404,-1.1e-4 0.0098,-0.44588 0.441103,5.2e-4 q 0.310411,1.8e-4 0.484251,-0.10418 0.173836,-0.10407 0.390676,-0.49209 l 0.140143,-0.24317 -1.780003,-3.19111 0.796453,1e-4 1.373713,2.53667 1.485344,-2.53593 0.796454,1e-4 z" + d="m -21.439933,204.59163 c -0.250887,0.38598 -0.482948,0.63782 -0.696184,0.75551 -0.213236,0.11769 -0.488671,0.1765 -0.826305,0.17641 l -0.600396,-1.1e-4 0.04446,-0.44588 0.441063,5.2e-4 c 0.206931,1.2e-4 0.371047,-0.0346 0.492349,-0.10418 0.121286,-0.0694 0.264261,-0.23341 0.42893,-0.49209 l 0.159047,-0.24317 -1.531933,-3.19111 0.796445,1e-4 0.875692,2.37232 1.983307,-2.37158 0.796446,1e-4 z" style="stroke-width:0.04658474" id="path931" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="csccccccccccccc" /> <path - d="m -16.106914,200.37344 v 0.87742 q -0.30801,-0.24496 -0.581201,-0.36522 -0.273192,-0.12027 -0.527636,-0.12027 -0.441927,0 -0.682979,0.28506 -0.238372,0.28505 -0.238372,0.81062 0,0.44093 0.158022,0.66808 0.160701,0.22269 0.605307,0.36076 l 0.326759,0.11137 q 0.605306,0.19151 0.89189,0.677 0.289261,0.481 0.289261,1.29163 0,0.96649 -0.391038,1.46532 -0.388361,0.49885 -1.140977,0.49885 -0.283905,0 -0.605308,-0.10677 -0.318723,-0.10678 -0.661552,-0.31623 v -0.92641 q 0.329437,0.30732 0.645483,0.46321 0.316045,0.15588 0.621377,0.15588 0.463354,0 0.715119,-0.30286 0.251764,-0.30287 0.251764,-0.86406 0,-0.48994 -0.182127,-0.76608 -0.179449,-0.27614 -0.591915,-0.41419 l -0.329437,-0.10678 q -0.605307,-0.20043 -0.87582,-0.62801 -0.270514,-0.42758 -0.270514,-1.18919 0,-0.88189 0.372291,-1.38964 0.374969,-0.50773 1.031165,-0.50773 0.281226,0 0.573166,0.0845 0.29194,0.0845 0.597272,0.25386 z" + d="m -16.106914,200.37344 -0.235202,0.38438 c -0.20534,-0.1633 -0.163872,0.20799 -0.345999,0.12782 -0.182128,-0.0802 -0.358007,-0.12027 -0.527636,-0.12027 -0.294618,0 -0.522278,0.095 -0.682979,0.28506 -0.158915,0.19003 -0.238372,0.46024 -0.238372,0.81062 0,0.29395 0.05267,0.51665 0.158022,0.66808 0.107134,0.14846 0.308903,0.26871 0.605307,0.36076 l 0.326759,0.11137 c 0.403537,0.12767 0.700834,0.35334 0.89189,0.677 0.192841,0.32067 0.289261,0.75121 0.289261,1.29163 0,0.64433 -0.130346,1.13277 -0.391038,1.46532 -0.258907,0.33257 -0.639233,0.49885 -1.140977,0.49885 -0.18927,0 -0.391039,-0.0356 -0.605308,-0.10677 -0.212482,-0.0712 -0.432999,-0.1766 -0.661552,-0.31623 v -0.92641 c 0.219625,0.20488 0.434786,0.35928 0.645483,0.46321 0.210697,0.10392 0.417822,0.15588 0.621377,0.15588 0.308903,0 0.547276,-0.10095 0.715119,-0.30286 0.167843,-0.20191 0.251764,-0.48993 0.251764,-0.86406 0,-0.32663 -0.06071,-0.58199 -0.182127,-0.76608 -0.119633,-0.18409 -0.316938,-0.32216 -0.591915,-0.41419 l -0.329437,-0.10678 c -0.403538,-0.13362 -0.695478,-0.34296 -0.87582,-0.62801 -0.180343,-0.28505 -0.270514,-0.68145 -0.270514,-1.18919 0,-0.58793 0.124097,-1.05114 0.372291,-1.38964 0.249979,-0.33849 0.593701,-0.50773 1.031165,-0.50773 0.187484,0 0.378539,0.0282 0.573166,0.0845 0.194627,0.0563 0.393717,0.14095 0.597272,0.25386 z" style="stroke-width:0.04678828" id="path933" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccscsccccscsccccscsccccscsscc" /> <path - d="m -13.861952,201.8379 q -0.396442,-2.5e-4 -0.631653,0.56197 -0.235171,0.55738 -0.24357,1.53181 -0.0084,0.97444 0.214439,1.53696 0.225559,0.55767 0.624679,0.55792 0.393764,1.8e-4 0.628976,-0.56196 0.235213,-0.56221 0.24357,-1.53181 0.0084,-0.96472 -0.217202,-1.52725 -0.225476,-0.56738 -0.619239,-0.56764 z m 0.0065,-0.75626 q 0.642883,-8e-5 1.003336,0.75693 0.360458,0.75653 0.348924,2.09457 -0.01149,1.33318 -0.385028,2.09407 -0.373495,0.75605 -1.016374,0.75561 -0.645561,0 -1.006014,-0.75692 -0.357738,-0.76137 -0.346246,-2.09458 0.01153,-1.33803 0.38235,-2.09406 0.373494,-0.75603 1.019052,-0.75562 z" + d="m -13.861952,201.8379 c -0.264295,-1.7e-4 -0.55269,0.76262 -0.710054,1.13718 -0.156224,0.37184 -0.15957,0.30698 -0.165169,0.9566 -0.0056,0.64963 0.06588,1.16195 0.214439,1.53696 0.150373,0.37178 0.358599,0.55775 0.624679,0.55792 0.262509,1.2e-4 0.472168,-0.1872 0.628976,-0.56196 0.156809,-0.37481 0.159598,-0.3102 0.165169,-0.9566 0.0056,-0.64315 -0.0668,-1.15223 -0.217202,-1.52725 -0.150317,-0.37826 -0.278329,-1.14268 -0.540838,-1.14285 z m 0.0065,-0.75626 c 0.428589,-5e-5 0.763034,0.25226 1.003336,0.75693 0.240305,0.50435 0.356613,1.20254 0.348924,2.09457 -0.0077,0.88879 -0.136003,1.58681 -0.385028,2.09407 -0.248997,0.50403 -0.587788,0.7559 -1.016374,0.75561 -0.430374,0 -0.765712,-0.25231 -1.006014,-0.75692 -0.238492,-0.50758 -0.353907,-1.20577 -0.346246,-2.09458 0.0077,-0.89202 0.135137,-1.59004 0.38235,-2.09406 0.248996,-0.50402 0.58868,-0.75589 1.019052,-0.75562 z" style="stroke-width:0.04881711" id="path935" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cssccccccscccccccs" /> <path d="m -11.933519,202.89764 v -2.26061 h 0.489436 v 2.23727 q 0,0.53015 0.164918,0.79689 0.164919,0.2634 0.494756,0.2634 0.396336,0 0.625094,-0.31675 0.2314181,-0.31675 0.2314181,-0.86357 v -2.11724 h 0.4894356 v 3.73435 h -0.4894356 v -0.5735 q -0.1782181,0.3401 -0.4149561,0.50681 -0.234078,0.16338 -0.545295,0.16338 -0.513376,0 -0.779373,-0.40011 -0.265998,-0.4001 -0.265998,-1.17032 z" style="stroke-width:0.04034315" @@ -241,25 +239,28 @@ inkscape:connector-curvature="0" /> </g> <g - aria-label="one" - transform="matrix(0.96137546,-0.34508222,-0.14753322,1.1131988,58.668157,-16.406918)" - style="font-style:normal;font-weight:normal;font-size:3.52777767px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.07000434" - id="text892"> + aria-label="EOC" + transform="matrix(0.92850116,-0.04062264,0.07072241,0.55478753,21.059925,105.24758)" + style="font-style:normal;font-weight:normal;font-size:4.51245451px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.029848" + id="text984"> <path - d="m -21.637912,192.23885 q -0.254937,0 -0.403076,0.19981 -0.148139,0.1981 -0.148139,0.54433 0,0.34623 0.146417,0.54605 0.148139,0.19809 0.404798,0.19809 0.253215,0 0.401354,-0.19982 0.148139,-0.19981 0.148139,-0.54432 0,-0.34279 -0.148139,-0.5426 -0.148139,-0.20154 -0.401354,-0.20154 z m 0,-0.26872 q 0.413412,0 0.649401,0.26872 0.235989,0.26872 0.235989,0.74414 0,0.4737 -0.235989,0.74414 -0.235989,0.26872 -0.649401,0.26872 -0.415134,0 -0.651123,-0.26872 -0.234266,-0.27044 -0.234266,-0.74414 0,-0.47542 0.234266,-0.74414 0.235989,-0.26872 0.651123,-0.26872 z" - style="stroke-width:0.07000434" - id="path894" - inkscape:connector-curvature="0" /> + d="m -27.470714,176.45352 1.520041,0.0298 0.06553,0.6033 -1.09868,-0.0615 0.09506,0.81721 1.261873,-0.0214 0.01859,0.37334 -1.308601,0.17481 0.05915,1.18807 0.802684,-0.34312 0.596104,0.15624 0.01859,0.37332 -1.77057,0.23654 z" + style="stroke-width:0.02732515" + id="path986" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccccc" /> <path - d="m -18.657729,192.65297 0.191769,1.13213 -0.317087,0.0526 -0.190066,-1.12207 q -0.04511,-0.26629 -0.174362,-0.38088 -0.129256,-0.11459 -0.342945,-0.0791 -0.256773,0.0426 -0.378027,0.22625 -0.121254,0.18367 -0.07473,0.45833 l 0.179571,1.06012 -0.318811,0.0529 -0.317724,-1.87572 0.318811,-0.0529 0.04936,0.2914 q 0.08508,-0.18801 0.224276,-0.29717 0.140918,-0.10943 0.342544,-0.14286 0.332598,-0.0552 0.537247,0.11753 0.204365,0.171 0.270179,0.55954 z" - style="stroke-width:0.07000434" - id="path896" - inkscape:connector-curvature="0" /> + d="m -24.039054,174.92144 c -0.25267,-0.0244 -0.450128,0.095 -0.592375,0.35824 -0.141099,0.26338 -0.205558,0.63469 -0.193376,1.11392 0.01214,0.47753 0.09582,0.86232 0.251027,1.15437 0.156365,0.29215 0.360881,0.45045 0.613549,0.4749 0.25267,0.0244 0.44898,-0.0951 0.588929,-0.35859 0.141099,-0.26337 0.05325,-0.63383 0.04111,-1.11137 -0.01218,-0.47923 0.05645,-0.86487 -0.09876,-1.15691 -0.154066,-0.29194 -0.357434,-0.45013 -0.610104,-0.47457 z m -0.01059,-0.41657 c 0.360629,0.0349 0.653443,0.2414 0.878442,0.6196 0.224956,0.3765 0.192723,0.73972 0.207963,1.33917 0.01519,0.59777 0.0717,1.18962 -0.135134,1.52605 -0.206881,0.33473 -0.490637,0.48463 -0.851269,0.44972 -0.361777,-0.035 -0.655717,-0.2408 -0.88182,-0.61739 -0.224958,-0.37649 -0.345053,-0.86447 -0.360284,-1.46394 -0.01523,-0.59946 0.08059,-1.06655 0.287464,-1.40128 0.207985,-0.33631 0.492868,-0.48695 0.854649,-0.45192 z" + style="stroke-width:0.028303" + id="path988" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccccccccccc" /> <path - d="m -16.339355,192.90203 v 0.15503 h -1.457275 q 0.02067,0.32728 0.19637,0.49954 0.177423,0.17053 0.492649,0.17053 0.18259,0 0.353122,-0.0448 0.172255,-0.0448 0.341065,-0.13436 v 0.29973 q -0.170533,0.0723 -0.349678,0.11024 -0.179144,0.0379 -0.363457,0.0379 -0.461643,0 -0.732083,-0.26872 -0.268717,-0.26872 -0.268717,-0.72692 0,-0.4737 0.254937,-0.75103 0.256659,-0.27905 0.690741,-0.27905 0.389296,0 0.61495,0.25149 0.227376,0.24977 0.227376,0.68041 z m -0.316949,-0.093 q -0.0034,-0.2601 -0.146416,-0.41513 -0.141249,-0.15503 -0.375516,-0.15503 -0.265272,0 -0.425469,0.14986 -0.158474,0.14986 -0.18259,0.42202 z" - style="stroke-width:0.07000434" - id="path898" - inkscape:connector-curvature="0" /> + d="m -20.699289,174.39827 0.07068,0.50696 c -0.121464,-0.0822 -0.244513,-0.12167 -0.369145,-0.11832 -0.123648,0.003 -0.249483,0.048 -0.377504,0.135 -0.252105,0.17197 -0.257734,0.24015 -0.356934,0.58061 -0.09942,0.33889 -0.286415,0.93119 -0.220936,1.40085 0.06526,0.46808 0.18222,0.78099 0.350882,0.93873 0.168443,0.15618 0.378715,0.14827 0.63082,-0.0237 0.128023,-0.0874 0.24346,-0.20691 0.346312,-0.35873 0.103838,-0.1525 0.195473,-0.33837 0.274905,-0.55763 l 0.07002,0.50219 c -0.08846,0.18544 -0.187303,0.34669 -0.296529,0.48375 -0.108242,0.13638 -0.22736,0.2489 -0.357352,0.33757 -0.333841,0.22772 -0.917214,0.28988 -1.15504,0.0925 -0.238046,-0.19904 -0.09924,-0.63039 -0.178655,-1.2 -0.07963,-0.5712 -0.04633,-1.08652 0.0999,-1.54596 0.146021,-0.46102 0.385952,-0.80539 0.719793,-1.03311 0.131962,-0.09 0.260027,-0.1461 0.384193,-0.16825 0.124929,-0.0244 0.246457,-0.0153 0.364583,0.0276 z" + style="stroke-width:0.02658074" + id="path990" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccccccccccc" /> </g> </g> <text @@ -280,7 +281,7 @@ id="text1057" /> <g id="g8072" - transform="matrix(0.26458333,0,0,0.26458333,9.1781916,289.45955)"> + transform="matrix(0.3595681,0,0,0.26458333,6.2653251,289.45955)"> <g style="display:inline" inkscape:label="Layer 1" diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp @@ -119,8 +119,29 @@ struct ComputerscareClockButton : app::SvgSwitch { struct ComputerscareInvisibleButton : app::SvgSwitch { ComputerscareInvisibleButton() { momentary = true; + + + fb = new widget::FramebufferWidget; + addChild(fb); + addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-invisible-button.svg"))); addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-invisible-button-frame2.svg"))); + + + + sw = new widget::SvgWidget; + fb->addChild(sw); + + + } + void addFrame(std::shared_ptr<Svg> svg) { + frames.push_back(svg); + // If this is our first frame, automatically set SVG and size + if (!sw->svg) { + sw->setSvg(svg); + box.size = sw->box.size; + fb->box.size = sw->box.size; + } } }; @@ -264,6 +285,8 @@ struct ComputerscareTextField : ui::TextField { std::shared_ptr<Font> font; math::Vec textOffset; NVGcolor color = COLOR_COMPUTERSCARE_LIGHT_GREEN; + int fontSize = 16; + bool inError = false; ComputerscareTextField() { font = APP->window->loadFont(asset::system("res/fonts/ShareTechMono-Regular.ttf")); @@ -272,13 +295,18 @@ struct ComputerscareTextField : ui::TextField { } - void draw(const DrawArgs &args) { + void draw(const DrawArgs &args) override { nvgScissor(args.vg, RECT_ARGS(args.clipBox)); // Background nvgBeginPath(args.vg); nvgRoundedRect(args.vg, 0, 0, box.size.x, box.size.y, 5.0); - nvgFillColor(args.vg, nvgRGB(0x00, 0x00, 0x00)); + if (inError) { + nvgFillColor(args.vg, COLOR_COMPUTERSCARE_PINK); + } + else { + nvgFillColor(args.vg, nvgRGB(0x00, 0x00, 0x00)); + } nvgFill(args.vg); // Text @@ -291,14 +319,21 @@ struct ComputerscareTextField : ui::TextField { int end = (this == APP->event->selectedWidget) ? std::max(cursor, selection) : -1; bndIconLabelCaret(args.vg, textOffset.x, textOffset.y, box.size.x - 2 * textOffset.x, box.size.y - 2 * textOffset.y, - -1, color, 18, text.c_str(), highlightColor, begin, end); + -1, color, fontSize, text.c_str(), highlightColor, begin, end); bndSetFont(APP->window->uiFont->handle); } nvgResetScissor(args.vg); } - //int getTextPosition(math::Vec mousePos) override; + int getTextPosition(Vec mousePos) override { + bndSetFont(font->handle); + int textPos = bndIconLabelTextPosition(APP->window->vg, textOffset.x, textOffset.y, + box.size.x - 2 * textOffset.x, box.size.y - 2 * textOffset.y, + -1, fontSize, text.c_str(), mousePos.x, mousePos.y); + bndSetFont(APP->window->uiFont->handle); + return textPos; + } }; //////////////////////////////////// struct SmallLetterDisplay : Widget { diff --git a/src/ComputerscareDebug.cpp b/src/ComputerscareDebug.cpp @@ -59,7 +59,6 @@ struct ComputerscareDebug : Module { INTERNAL_MODE, POLY_MODE }; - //StringDisplayWidget3* textDisplay; ComputerscareDebug() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); @@ -115,10 +114,6 @@ void ComputerscareDebug::process(const ProcessArgs &args) { logLines[i] = random::uniform(); } } - //thisVal = std::to_string(logLines[0]).substr(0,10); - //outputs[POLY_OUTPUT].setVoltage(logLines[0],0); - - } } else if (clockMode == INTERNAL_MODE) { @@ -192,7 +187,6 @@ struct HidableSmallSnapKnob : SmallSnapKnob { HidableSmallSnapKnob() { SmallSnapKnob(); - } void draw(const DrawArgs &args) { if (module ? (hackIndex == 0 ? module->clockMode == 0 : module->inputMode == 0) : true) { diff --git a/src/ComputerscareLaundrySoup.cpp b/src/ComputerscareLaundrySoup.cpp @@ -12,7 +12,7 @@ struct ComputerscareLaundrySoup; struct LaundryTextField; struct LaundryTF2; struct LaundrySmallDisplay; - +struct ComputerscareLaundrySoupWidget; const int numFields = 6; @@ -88,6 +88,7 @@ struct ComputerscareLaundrySoup : Module { LaundrySmallDisplay* smallLetterDisplays[numFields]; std::string currentFormula[numFields]; + std::string lastValue[numFields]; rack::dsp::SchmittTrigger manualResetTriggers[numFields]; @@ -97,11 +98,13 @@ struct ComputerscareLaundrySoup : Module { bool shouldChange[numFields] = {false}; bool changeImminent[numFields] = {false}; + bool manualSet[numFields] = {false}; ComputerscareLaundrySoup() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); for (int i = 0; i < numFields; i++) { currentFormula[i] = ""; + lastValue[i] = ""; setNextAbsoluteSequence(i); checkIfShouldChange(i); resetOneOfThem(i); @@ -123,13 +126,15 @@ struct ComputerscareLaundrySoup : Module { int length = 0; for (int i = 0; i < numFields; i++) { - length = rand() % 12 + 1; + length = floor(random::uniform() * 12) + 1; string = ""; for (int j = 0; j < length; j++) { - randchar = mainlookup[rand() % mainlookup.size()]; + randchar = mainlookup[floor(random::uniform() * mainlookup.size())]; string = string + randchar; } + printf("new sequence:%s\n", string.c_str()); currentFormula[i] = string; + manualSet[i] = true; setNextAbsoluteSequence(i); } @@ -143,6 +148,7 @@ struct ComputerscareLaundrySoup : Module { laundrySequences[index] = lss; if (!lss.inError) { laundrySequences[index] = lss; + printf("not in error channel %i\n", index); laundrySequences[index].print(); } else { @@ -155,23 +161,8 @@ struct ComputerscareLaundrySoup : Module { if (shouldChange[index]) { setAbsoluteSequenceFromQueue(index); shouldChange[index] = false; - updateDisplayBlink(index); } } - void updateDisplayBlink(int index) { - // smallLetterDisplays[index]->blink = shouldChange[index]; - } - void onCreate () - { - printf("onCreate\n"); - - } - - void onReset () override - { - printf("onReset\n"); - onCreate(); - } /* lets say the sequence "332" is entered in the 0th (first) @@ -284,9 +275,8 @@ void ComputerscareLaundrySoup::process(const ProcessArgs &args) { struct LaundryTF2 : ComputerscareTextField { ComputerscareLaundrySoup *module; - int fontSize = 16; + //int fontSize = 16; int rowIndex = 0; - bool inError = false; LaundryTF2(int i) { @@ -297,23 +287,23 @@ struct LaundryTF2 : ComputerscareTextField { if (module) { + if (module->manualSet[rowIndex]) { + text = module->currentFormula[rowIndex]; + module->manualSet[rowIndex] = false; + } std::string value = text.c_str(); - if (value != module->currentFormula[rowIndex]) + if (value != module->lastValue[rowIndex]) { - printf("diff %i, %s\n", rowIndex, text.c_str()); LaundrySoupSequence lss = LaundrySoupSequence(value); - + module->lastValue[rowIndex] = value; if (!lss.inError && matchParens(value)) { inError = false; module->currentFormula[rowIndex] = value; module->setNextAbsoluteSequence(this->rowIndex); - //module->updateDisplayBlink(rowIndex); } else { - printf("in error %i\n", index); inError = true; } - //module->setQuant(); } } ComputerscareTextField::draw(args); @@ -361,9 +351,7 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { //global reset input addInput(createInput<InPort>(mm2px(Vec(12 , 0)), module, ComputerscareLaundrySoup::GLOBAL_RESET_INPUT)); - - // addParam(createParam<ComputerscareClockButton>(Vec(2, 321), module, ComputerscareDebug::MANUAL_TRIGGER)); - + //momentary clock and reset buttons addParam(createParam<ComputerscareClockButton>(mm2px(Vec(2 , 8)), module, ComputerscareLaundrySoup::MANUAL_CLOCK_PARAM)); addParam(createParam<ComputerscareResetButton>(mm2px(Vec(12 , 8)), module, ComputerscareLaundrySoup::MANUAL_RESET_PARAM)); @@ -380,17 +368,6 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { //individual reset input addInput(createInput<InPort>(mm2px(Vec(12, verticalStart + verticalSpacing * i - 10)), module, ComputerscareLaundrySoup::RESET_INPUT + i)); - - /* textFieldTemp = createWidget<LaundryTF2>(mm2px(Vec(1, verticalStart + verticalSpacing * i))); - textFieldTemp->module = module; - textFieldTemp->box.size = mm2px(Vec(44, 7)); - textFieldTemp->multiline = false; - textFieldTemp->color = nvgRGB(0xC0, 0xE7, 0xDE); - textFieldTemp->text = ""; - textFieldTemp->rowIndex = i; - module->textFields[i] = textFieldTemp; - textFieldTemp->module = module; - addChild(textFieldTemp);*/ textFieldTemp = new LaundryTF2(i); textFieldTemp->box.pos = mm2px(Vec(1, verticalStart + verticalSpacing * i)); textFieldTemp->module = module; @@ -412,14 +389,11 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { smallLetterDisplay->module = module; addChild(smallLetterDisplay); laundrySmallDisplays[i] = smallLetterDisplay; - //module->smallLetterDisplays[i] = smallLetterDisplay; addParam(createParam<ComputerscareInvisibleButton>(mm2px(Vec(20, verticalStart - 9.2 + verticalSpacing * i)), module, ComputerscareLaundrySoup::INDIVIDUAL_RESET_PARAM + i)); } - laundry = module; - module->onCreate(); } json_t *toJson() override { @@ -437,7 +411,7 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { void fromJson(json_t *rootJ) override { - + std::string val; ModuleWidget::fromJson(rootJ); json_t *sequencesJ = json_object_get(rootJ, "sequences"); if (sequencesJ) { @@ -445,7 +419,9 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { json_t *sequenceJ = json_array_get(sequencesJ, i); if (sequenceJ) - laundryTextFields[i]->text = json_string_value(sequenceJ); + val = json_string_value(sequenceJ); + laundryTextFields[i]->text = val; + laundry->currentFormula[i] = val; } } } diff --git a/src/dtpulse.cpp b/src/dtpulse.cpp @@ -423,8 +423,8 @@ LaundrySoupSequence::LaundrySoupSequence(std::string expr) { void LaundrySoupSequence::print() { printf(" Laundry tokenStack:\n"); printTokenVector(tokenStack); - printf(" Laundry pulseSequence:\n"); - printVector(pulseSequence); + //printf(" Laundry pulseSequence:\n"); + //printVector(pulseSequence); } std::vector<int> LaundrySoupSequence::makePulseSequence(std::vector<Token> tokens) { std::vector<int> output = {};