computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit ccb3c4916b9532081247fc06e9bde7dd8878b870
parent 9691562e426182ff5038b1123c1738e80dfb89a7
Author: Adam M <aemalone@gmail.com>
Date:   Sat, 27 Oct 2018 13:17:11 -0500

UI updates to ILoveCookies

Diffstat:
Mres/ComputerscareILoveCookiesPanel.svg | 118++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Mres/computerscare-medium-knob-effed.svg | 20++++++++++----------
Msrc/Computerscare.hpp | 48++++++++++++++++++++++++++++++++++++++++++++++--
Msrc/ComputerscareILoveCookies.cpp | 96++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Msrc/ComputerscarePatchSequencer.cpp | 4++--
5 files changed, 213 insertions(+), 73 deletions(-)

diff --git a/res/ComputerscareILoveCookiesPanel.svg b/res/ComputerscareILoveCookiesPanel.svg @@ -34,11 +34,11 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.4142136" - inkscape:cx="26.10989" - inkscape:cy="139.24147" + inkscape:zoom="16" + inkscape:cx="23.567673" + inkscape:cy="361.95901" inkscape:document-units="mm" - inkscape:current-layer="text1651" + inkscape:current-layer="g1669" showgrid="false" units="px" inkscape:snap-bbox="true" @@ -61,7 +61,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -122,33 +122,33 @@ id="path1715" inkscape:connector-curvature="0" /> <path - d="m 20.020774,294.70537 0.163841,0.15458 q -0.169368,-0.0451 -0.330051,-0.0731 -0.160718,-0.0281 -0.312717,-0.0391 -0.231342,-0.0167 -0.308256,0.0123 -0.07522,0.0291 0.0038,0.10366 0.06024,0.0569 0.177817,0.0957 0.116672,0.038 0.397635,0.0853 l 0.119486,0.0201 q 0.370505,0.0612 0.581467,0.13959 0.21171,0.0776 0.340721,0.19936 0.146886,0.13858 0.02317,0.2043 -0.122019,0.0658 -0.486704,0.0396 -0.151904,-0.0109 -0.334439,-0.0389 -0.179827,-0.027 -0.395147,-0.0712 l -0.178909,-0.1688 q 0.222156,0.0595 0.414732,0.0956 0.191703,0.0352 0.355387,0.0469 0.219567,0.0159 0.29632,-0.0147 0.07583,-0.0314 -4.15e-4,-0.1034 -0.07064,-0.0666 -0.194414,-0.10839 -0.122062,-0.0416 -0.445674,-0.0953 l -0.122185,-0.0211 q -0.322573,-0.0528 -0.520655,-0.12782 -0.198958,-0.0759 -0.321363,-0.19139 -0.148765,-0.14036 -0.04062,-0.20312 0.108159,-0.0628 0.456066,-0.0376 0.172254,0.0125 0.338359,0.0367 0.166102,0.0243 0.322671,0.0602 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.22598772" + d="m 20.202252,294.56561 0.05561,0.18117 q -0.134233,-0.0538 -0.271475,-0.0875 -0.137211,-0.0339 -0.277399,-0.0478 -0.213395,-0.0211 -0.307461,0.0121 -0.09249,0.0334 -0.06567,0.12071 0.0204,0.0667 0.108576,0.1127 0.08783,0.0451 0.328918,0.1022 l 0.102538,0.0243 q 0.318708,0.0739 0.471041,0.16671 0.153587,0.0919 0.197348,0.23457 0.04985,0.16242 -0.114212,0.23805 -0.162476,0.0757 -0.498952,0.0427 -0.140163,-0.0137 -0.298619,-0.0477 -0.156496,-0.0327 -0.335937,-0.0858 l -0.06073,-0.19783 q 0.17584,0.0709 0.338622,0.11428 0.162537,0.0423 0.3136,0.0572 0.202502,0.0201 0.297484,-0.0149 0.09462,-0.036 0.06879,-0.1204 -0.024,-0.0781 -0.116196,-0.1276 -0.09065,-0.0493 -0.368857,-0.11411 l -0.10449,-0.0255 q -0.277799,-0.0638 -0.419883,-0.15257 -0.142346,-0.0897 -0.18389,-0.22515 -0.05049,-0.1645 0.09648,-0.23679 0.147014,-0.0723 0.467874,-0.0405 0.158847,0.0158 0.303897,0.0452 0.144979,0.0294 0.272943,0.0724 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.24076694" id="path1717" inkscape:connector-curvature="0" /> <path - d="m 21.07703,294.34744 0.202525,0.15424 q -0.170334,-0.038 -0.316101,-0.056 -0.145478,-0.019 -0.2681,-0.0182 -0.275278,10e-4 -0.292155,0.10462 -0.0188,0.10219 0.222524,0.28601 0.241357,0.18381 0.527353,0.28518 0.284858,0.10046 0.559379,0.0989 0.122248,-10e-4 0.217613,-0.0202 0.09529,-0.0204 0.164278,-0.0596 l 0.200173,0.15242 q -0.07566,0.0329 -0.181797,0.0498 -0.104608,0.0168 -0.247111,0.0177 -0.387915,0.002 -0.803708,-0.1391 -0.415675,-0.14127 -0.733518,-0.38337 -0.322586,-0.2457 -0.277333,-0.38778 0.04677,-0.14208 0.448589,-0.14434 0.12975,-10e-4 0.275701,0.0146 0.144236,0.0145 0.302094,0.0454 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.22598772" + d="m 21.467089,294.15645 0.09339,0.18105 q -0.13992,-0.0455 -0.269375,-0.0675 -0.128506,-0.0232 -0.248073,-0.0231 -0.267889,-8.2e-4 -0.353607,0.11971 -0.08663,0.11885 0.02463,0.33462 0.111298,0.21575 0.321091,0.33583 0.209298,0.11902 0.476827,0.11919 0.119338,-2.9e-4 0.224758,-0.0219 0.106151,-0.0231 0.199349,-0.0682 l 0.09232,0.17891 q -0.09546,0.0378 -0.209797,0.0567 -0.112787,0.0188 -0.251721,0.0188 -0.377888,5e-5 -0.687103,-0.16775 -0.308977,-0.16746 -0.455519,-0.45164 -0.148736,-0.2884 -0.0097,-0.45351 0.140472,-0.16509 0.53204,-0.16483 0.126621,-2.3e-4 0.25786,0.019 0.130311,0.0179 0.262873,0.0551 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.24076694" id="path1719" inkscape:connector-curvature="0" /> <path - d="m 22.852612,294.8592 q -0.323826,0.0145 -0.379334,0.0668 -0.0554,0.0523 0.112069,0.165 0.133534,0.0898 0.305426,0.13883 0.172032,0.048 0.333192,0.0408 0.222208,-0.01 0.208762,-0.11484 -0.01338,-0.1059 -0.258531,-0.27084 l -0.05591,-0.0376 z m 0.429558,-0.0934 0.87031,0.58557 -0.266295,0.0125 -0.231538,-0.15579 q 0.04741,0.0975 -0.02238,0.14854 -0.07123,0.05 -0.268633,0.0589 -0.249863,0.0111 -0.528734,-0.0703 -0.278814,-0.0823 -0.499448,-0.23079 -0.25748,-0.17321 -0.205161,-0.26933 0.05373,-0.0962 0.418283,-0.11244 l 0.374754,-0.0167 -0.02447,-0.0164 q -0.172958,-0.11637 -0.388957,-0.17416 -0.215912,-0.0588 -0.435279,-0.049 -0.139718,0.006 -0.24028,0.0332 -0.100886,0.027 -0.160131,0.0747 l -0.231519,-0.15578 q 0.09362,-0.0423 0.20567,-0.0658 0.110747,-0.0245 0.241429,-0.0303 0.353293,-0.0155 0.698876,0.092 0.345914,0.1077 0.69458,0.34229 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.22872864" + d="m 22.848255,294.76509 q -0.324049,0.0145 -0.412927,0.075 -0.08878,0.0605 -0.0016,0.19293 0.06954,0.10555 0.203589,0.16385 0.134877,0.0572 0.296138,0.0499 0.222393,-0.01 0.279493,-0.13222 0.05788,-0.12339 -0.06973,-0.31721 l -0.02911,-0.0442 z m 0.47948,-0.10562 0.453008,0.68806 -0.266864,0.0126 -0.120515,-0.18306 q -0.01921,0.11387 -0.121119,0.1728 -0.102601,0.0577 -0.300181,0.0666 -0.249975,0.0111 -0.466214,-0.0857 -0.215582,-0.0978 -0.330397,-0.27232 -0.134042,-0.20353 -0.01894,-0.31506 0.116528,-0.11161 0.481275,-0.12792 l 0.374957,-0.0167 -0.01278,-0.0192 q -0.09003,-0.13675 -0.261034,-0.20558 -0.170245,-0.07 -0.389748,-0.0601 -0.139642,0.006 -0.255461,0.037 -0.115999,0.0307 -0.205427,0.0858 l -0.120504,-0.18305 q 0.119183,-0.0485 0.243677,-0.0751 0.123899,-0.0277 0.254636,-0.0335 0.353322,-0.0155 0.616856,0.11216 0.263723,0.12788 0.44521,0.40354 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" id="path1721" inkscape:connector-curvature="0" /> <path - d="m 24.273091,294.36188 q -0.07114,-0.0156 -0.13655,-0.021 -0.06558,-0.006 -0.129387,-0.003 -0.226834,0.01 -0.201179,0.11456 0.02574,0.10364 0.301345,0.28875 l 0.85584,0.57481 -0.269621,0.0113 -1.624583,-1.09115 0.269623,-0.0113 0.252401,0.16951 q -0.06357,-0.10305 6.35e-4,-0.15667 0.06271,-0.0546 0.25629,-0.063 0.0278,-10e-4 0.06512,-2e-5 0.03622,3.3e-4 0.08513,0.005 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.23585747" + d="m 24.559922,294.19624 q -0.05862,-0.0187 -0.118501,-0.0254 -0.05964,-0.007 -0.123586,-0.004 -0.226885,0.01 -0.271945,0.13195 -0.04437,0.12085 0.09931,0.33836 l 0.44616,0.67545 -0.269288,0.0112 -0.8469,-1.28215 0.269291,-0.0112 0.131588,0.19918 q 0.0073,-0.12044 0.105449,-0.18241 0.09741,-0.0632 0.290941,-0.0716 0.02765,-9.6e-4 0.06323,4.5e-4 0.03494,6.5e-4 0.07928,0.006 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.25128216" id="path1723" inkscape:connector-curvature="0" /> <path - d="m 26.435459,294.65755 0.122579,0.0825 -1.228813,0.0547 q 0.276221,0.17333 0.560566,0.25837 0.284441,0.0841 0.550258,0.0722 0.153887,-0.007 0.262416,-0.0371 0.109851,-0.0303 0.181351,-0.0843 l 0.236966,0.15945 q -0.0865,0.045 -0.207612,0.0718 -0.121116,0.0269 -0.276504,0.0338 -0.389855,0.0169 -0.829772,-0.11545 -0.43907,-0.13286 -0.801349,-0.3766 -0.37454,-0.252 -0.378879,-0.40914 -0.0042,-0.15809 0.361815,-0.1744 0.328175,-0.0147 0.717379,0.11068 0.389237,0.12434 0.729734,0.35344 z m -0.340851,-0.0376 q -0.208621,-0.13824 -0.451691,-0.21534 -0.241692,-0.0772 -0.439223,-0.0683 -0.224707,0.009 -0.240259,0.0957 -0.01515,0.0857 0.17973,0.23137 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.22872864" + 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" id="path1725" inkscape:connector-curvature="0" /> <g aria-label="rst" - transform="matrix(1.9119826,-0.34464307,0.50786191,1.8921039,-31.034445,-146.38064)" + transform="matrix(1.9119826,-0.34464307,0.50786191,1.8921039,-31.234095,-147.94682)" style="font-style:normal;font-weight:normal;font-size:1.90312397px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.01258837" id="text864"> <path @@ -171,7 +171,7 @@ </g> <g aria-label="clk" - transform="matrix(2.3525877,-0.10292753,0.2449229,1.9213172,45.198743,-143.34561)" + transform="matrix(2.3525877,-0.10292753,0.2449229,1.9213172,44.999093,-144.91179)" style="font-style:normal;font-weight:normal;font-size:1.90312397px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.01258837" id="text868"> <path @@ -206,7 +206,7 @@ style="stroke-width:0.07000434" /></text> <g aria-label="out" - transform="matrix(1.0468606,0.36920082,-0.20179075,0.85789222,80.50944,88.545352)" + transform="matrix(1.0468606,0.36920082,-0.20179075,0.85789222,80.30979,86.979184)" 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="text888"> <path @@ -227,7 +227,7 @@ </g> <g aria-label="one" - transform="matrix(0.96137546,-0.34508222,-0.14753322,1.1131988,64.524557,29.534027)" + transform="matrix(0.96137546,-0.34508222,-0.14753322,1.1131988,64.324907,27.967859)" 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 @@ -252,32 +252,31 @@ style="font-style:normal;font-weight:normal;font-size:4.94244957px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.03269225" id="text901"> <path - d="m -42.578917,200.47688 h 0.487488 v 3.60306 h -0.487488 z" - style="stroke-width:0.03269225" - id="path904" /> - <path - d="m -39.667469,199.86261 0.551459,-0.0397 0.216288,4.14763 1.984706,-0.1428 0.02779,0.53296 -2.536165,0.18247 z" - style="stroke-width:0.03970517" + d="m -40.322279,199.62443 0.644232,-0.0354 0.120382,3.43097 2.450886,0.13734 0.03245,0.47487 -2.962824,0.16259 z" + style="stroke-width:0.04050894" id="path906" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccc" /> <path - d="m -35.357614,201.29188 q -0.404796,0 -0.640016,0.37017 -0.23522,0.36697 -0.23522,1.00838 0,0.64142 0.232485,1.01158 0.235219,0.36697 0.642751,0.36697 0.402062,0 0.637281,-0.37017 0.23522,-0.37016 0.23522,-1.00838 0,-0.63502 -0.23522,-1.0052 -0.235219,-0.37335 -0.637281,-0.37335 z m 0,-0.49782 q 0.656427,0 1.031137,0.49782 0.374711,0.49781 0.374711,1.37855 0,0.87755 -0.374711,1.37855 -0.37471,0.49782 -1.031137,0.49782 -0.659162,0 -1.033873,-0.49782 -0.371974,-0.501 -0.371974,-1.37855 0,-0.88074 0.371974,-1.37855 0.374711,-0.49782 1.033873,-0.49782 z" + d="m -35.357614,200.76271 q -0.404796,0 -0.640016,0.37017 -0.23522,0.36697 -0.23522,1.00838 0,0.64142 0.232485,1.01158 0.235219,0.36697 0.642751,0.36697 0.402062,0 0.637281,-0.37017 0.23522,-0.37016 0.23522,-1.00838 0,-0.63502 -0.23522,-1.0052 -0.235219,-0.37335 -0.637281,-0.37335 z m 0,-0.49782 q 0.656427,0 1.031137,0.49782 0.374711,0.49781 0.374711,1.37855 0,0.87755 -0.374711,1.37855 -0.37471,0.49782 -1.031137,0.49782 -0.659162,0 -1.033873,-0.49782 -0.371974,-0.501 -0.371974,-1.37855 0,-0.88074 0.371974,-1.37855 0.374711,-0.49782 1.033873,-0.49782 z" style="stroke-width:0.04002121" id="path908" inkscape:connector-curvature="0" /> <path - d="m -33.475857,200.88022 h 0.533347 l 0.957289,2.99964 0.957289,-2.99964 h 0.533347 l -1.148747,3.57404 h -0.683778 z" - style="stroke-width:0.04002121" + d="m -33.475857,200.50604 h 0.683962 l 0.929968,3.18139 1.525279,-3.18139 h 0.683962 l -1.539294,3.73325 -0.810729,0.21497 z" + style="stroke-width:0.04763455" id="path910" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" /> <path - d="m -27.17963,202.84877 v 0.24067 h -2.313905 q 0.03282,0.50806 0.311803,0.77547 0.281717,0.26473 0.782243,0.26473 0.289921,0 0.560697,-0.0695 0.273512,-0.0695 0.541553,-0.20858 v 0.46528 q -0.270777,0.11231 -0.555228,0.17114 -0.284452,0.0588 -0.577109,0.0588 -0.73301,0 -1.162423,-0.41715 -0.426677,-0.41715 -0.426677,-1.12845 0,-0.73537 0.404797,-1.1659 0.407531,-0.43319 1.096779,-0.43319 0.618135,0 0.976435,0.39041 0.361035,0.38774 0.361035,1.05625 z m -0.50326,-0.1444 q -0.0054,-0.40378 -0.232485,-0.64445 -0.224279,-0.24066 -0.596254,-0.24066 -0.421208,0 -0.675573,0.23263 -0.251631,0.23265 -0.289922,0.65515 z" - style="stroke-width:0.0366358" + d="m -27.17963,202.47284 v 0.25834 l -2.313905,0.4092 c 0.02188,0.3597 0.125814,0.61879 0.311803,0.77726 0.187811,0.15623 0.448559,0.20484 0.782243,0.14583 0.193281,-0.0342 0.38018,-0.0921 0.560697,-0.17376 0.182341,-0.082 0.362859,-0.18854 0.541553,-0.31967 v 0.49944 c -0.180518,0.11229 -0.365594,0.20626 -0.555228,0.2819 -0.189635,0.0756 -0.382004,0.13067 -0.577109,0.16517 -0.488673,0.0864 -0.876148,0.006 -1.162423,-0.24221 -0.284451,-0.24821 -0.426677,-0.62683 -0.426677,-1.13584 0,-0.52624 0.134932,-0.96727 0.404797,-1.32308 0.271687,-0.35805 0.63728,-0.5777 1.096779,-0.65895 0.41209,-0.0729 0.737568,0.009 0.976435,0.2464 0.24069,0.23491 0.361035,0.59156 0.361035,1.06995 z m -0.602479,-0.13215 c -0.0036,-0.2883 -0.09763,-0.47211 -0.249021,-0.61757 -0.14952,-0.14578 -0.232516,-0.16366 -0.480499,-0.11981 -0.280805,0.0497 -0.505996,0.17273 -0.675573,0.36918 -0.167754,0.19615 -0.363613,0.5138 -0.389141,0.82066 z" + style="stroke-width:0.03795681" id="path912" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccscccsccccccc" /> <path - d="m -23.085996,200.92591 v 0.77129 q -0.246157,-0.344 -0.526101,-0.5142 -0.27753,-0.17018 -0.59126,-0.17018 -0.617806,0 -0.946015,0.5685 -0.32821,0.5649 -0.32821,1.63675 0,1.06822 0.32821,1.63673 0.328209,0.5649 0.946015,0.5649 0.31373,0 0.59126,-0.1702 0.279944,-0.17018 0.526101,-0.5142 v 0.76406 q -0.255811,0.26072 -0.542994,0.39109 -0.28477,0.13039 -0.603326,0.13039 -0.818111,0 -1.288705,-0.74958 -0.470595,-0.7532 -0.470595,-2.05316 0,-1.3036 0.470595,-2.05318 0.470594,-0.75318 1.288705,-0.75318 0.323383,0 0.608153,0.13039 0.287183,0.12679 0.538167,0.38384 z" - style="stroke-width:0.04004603" + d="m -22.945679,200.82302 v 0.61693 q -0.325406,-0.27515 -0.695476,-0.41129 -0.366879,-0.13612 -0.781611,-0.13612 -0.816705,0 -1.250579,0.45473 -0.433875,0.45184 -0.433875,1.30918 0,0.85445 0.433875,1.30918 0.433874,0.45185 1.250579,0.45185 0.414732,0 0.781611,-0.13614 0.37007,-0.13612 0.695476,-0.4113 v 0.61115 q -0.338168,0.20855 -0.717807,0.31282 -0.37645,0.10427 -0.797563,0.10427 -1.081496,0 -1.703594,-0.59957 -0.6221,-0.60246 -0.6221,-1.64227 0,-1.04271 0.6221,-1.64228 0.622098,-0.60245 1.703594,-0.60245 0.427494,0 0.803944,0.10427 0.379639,0.10143 0.711426,0.30703 z" + style="stroke-width:0.04117904" id="path914" inkscape:connector-curvature="0" /> <path @@ -286,30 +285,57 @@ id="path916" inkscape:connector-curvature="0" /> <path - d="m -18.44527,202.53026 q -0.357169,0 -0.487259,0.27994 -0.130756,0.27753 0.0035,0.7626 0.134213,0.48508 0.416798,0.76502 0.284331,0.27753 0.643913,0.27753 0.354756,0 0.484847,-0.27994 0.130087,-0.27995 -0.0035,-0.76261 -0.132874,-0.48024 -0.417875,-0.76019 -0.285666,-0.28235 -0.640422,-0.28235 z m -0.104166,-0.37648 q 0.579194,0 1.013983,0.37648 0.434784,0.37647 0.619074,1.04254 0.183622,0.66366 -0.04217,1.04255 -0.226457,0.37648 -0.805651,0.37648 -0.581606,0 -1.016395,-0.37648 -0.433042,-0.37889 -0.616664,-1.04255 -0.18429,-0.66607 0.03976,-1.04254 0.226457,-0.37648 0.808063,-0.37648 z" - style="stroke-width:0.03269225" + d="m -18.929377,200.90397 q -0.464482,0 -0.633659,0.34453 -0.170042,0.34157 0.0046,0.93855 0.174538,0.597 0.542027,0.94153 0.36976,0.34157 0.83738,0.34157 0.461344,0 0.630522,-0.34453 0.169172,-0.34454 -0.0046,-0.93857 -0.172796,-0.59104 -0.543427,-0.93558 -0.371496,-0.3475 -0.83284,-0.3475 z m -0.135463,-0.46334 q 0.753216,0 1.318639,0.46334 0.565417,0.46333 0.805078,1.28308 0.238792,0.81679 -0.05484,1.2831 -0.294497,0.46334 -1.047713,0.46334 -0.756353,0 -1.321776,-0.46334 -0.563152,-0.46631 -0.801944,-1.2831 -0.239661,-0.81975 0.05171,-1.28308 0.294497,-0.46334 1.05085,-0.46334 z" + style="stroke-width:0.04135929" id="path918" inkscape:connector-curvature="0" /> <path - d="m -16.865342,201.16674 h 0.446462 l 0.613634,2.21783 1.002396,-1.16563 h 0.567126 l -1.083619,1.26457 1.891796,1.43833 h -0.579193 l -1.738414,-1.32008 0.365243,1.32008 h -0.446462 z" + d="m -16.865342,201.16674 h 0.446462 l 0.613634,2.21783 1.002396,-1.16563 0.368688,0.19844 -0.885181,1.06613 1.891796,1.43833 h -0.579193 l -1.738414,-1.32008 0.365243,1.32008 h -0.446462 z" style="stroke-width:0.03269225" id="path920" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccc" /> <path - d="m -13.4376,201.37704 h 0.582962 v 2.7029 H -13.4376 Z m 0,-1.0522 h 0.582962 v 0.5623 H -13.4376 Z" + d="m -13.4376,201.37704 h 0.582962 l 0,2.7029 H -13.4376 Z m 0,-1.0522 h 0.582962 l 0.132292,0.59537 -0.715254,-0.0331 z" style="stroke-width:0.03745848" id="path922" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccc" /> <path - d="m -8.6028135,202.61748 v 0.2172 h -2.6803615 q 0.03802,0.45852 0.361184,0.69985 0.326331,0.23892 0.906126,0.23892 0.335838,0 0.649497,-0.0627 0.3168268,-0.0627 0.6273175,-0.18824 v 0.41991 q -0.3136586,0.10136 -0.6431595,0.15445 -0.3294997,0.0531 -0.668506,0.0531 -0.849098,0 -1.346517,-0.37648 -0.494251,-0.37647 -0.494251,-1.01841 0,-0.66366 0.468906,-1.05221 0.472072,-0.39095 1.270477,-0.39095 0.7160305,0 1.1310746,0.35234 0.4182129,0.34993 0.4182129,0.95326 z m -0.5829634,-0.13032 q -0.0063,-0.36441 -0.2693034,-0.58161 -0.2597986,-0.21719 -0.6906837,-0.21719 -0.487914,0 -0.782564,0.20995 -0.291482,0.20996 -0.335837,0.59126 z" + d="m -8.6028135,202.61748 0,0.2172 h -2.6803615 c 0.02535,0.30568 0.145741,0.53896 0.361184,0.69985 0.217554,0.15928 0.519596,0.23892 0.906126,0.23892 0.223892,0 0.440391,-0.0209 0.649497,-0.0627 0.2112179,-0.0418 0.4203237,-0.10455 0.6273175,-0.18824 v 0.41991 c -0.2091057,0.0676 -0.4234922,0.11906 -0.6431595,0.15445 -0.2196665,0.0354 -0.4425018,0.0531 -0.668506,0.0531 -0.566065,0 -1.014904,-0.12549 -1.346517,-0.37648 -0.329501,-0.25098 -0.494251,-0.59045 -0.494251,-1.01841 0,-0.44244 0.156302,-0.79318 0.468906,-1.05221 0.314715,-0.26063 0.738207,-0.39095 1.270477,-0.39095 0.4773537,0 0.8543785,0.11745 1.1310746,0.35234 0.2788086,0.23329 0.4182129,0.55104 0.4182129,0.95326 z m -0.8310103,-0.24608 c -0.0042,-0.24294 0.1540791,-0.32105 -0.021256,-0.46585 -0.1731991,-0.14479 -0.403427,-0.21719 -0.6906837,-0.21719 -0.325276,0 -0.586131,0.07 -0.782564,0.20995 -0.194321,0.13997 0.0079,0.2213 -0.02164,0.4755 z" style="stroke-width:0.03745848" id="path924" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccsccccscscscccccsccc" /> <path - d="m -5.3838476,201.45668 v 0.41991 q -0.2471254,-0.0965 -0.5132606,-0.1448 -0.2661352,-0.0483 -0.55128,-0.0483 -0.4340537,0 -0.6526647,0.10136 -0.2154427,0.10136 -0.2154427,0.30407 0,0.15446 0.1552454,0.24375 0.1552456,0.0869 0.6241503,0.16652 l 0.1996013,0.0338 q 0.6209821,0.10136 0.8807807,0.28719 0.2629668,0.18341 0.2629668,0.51403 0,0.37648 -0.3928662,0.59609 -0.3896977,0.21961 -1.0740453,0.21961 -0.2851448,0 -0.5956357,-0.0434 -0.3073228,-0.041 -0.6494966,-0.12549 v -0.45853 q 0.3231642,0.1279 0.6368234,0.19306 0.3136593,0.0627 0.620982,0.0627 0.4118758,0 0.6336551,-0.10619 0.2217793,-0.1086 0.2217793,-0.30407 0,-0.181 -0.1615821,-0.27753 -0.1584138,-0.0965 -0.7001888,-0.18583 l -0.2027697,-0.0362 q -0.5417751,-0.0869 -0.782564,-0.26546 -0.2407889,-0.181 -0.2407889,-0.49473 0,-0.3813 0.3548468,-0.58885 0.3548468,-0.20754 1.0075115,-0.20754 0.3231642,0 0.608309,0.0362 0.2851448,0.0362 0.5259337,0.1086 z" - style="stroke-width:0.03745848" + d="m -5.1228851,200.82694 v 0.53064 c -0.1817981,-0.0927 -0.3705884,-0.16546 -0.5663711,-0.21839 -0.1957826,-0.0529 -0.3985574,-0.0859 -0.6083245,-0.099 -0.3193121,-0.0199 -0.5593788,0.008 -0.7202002,0.0831 -0.1584907,0.0755 -0.1219808,0.19862 -0.1219808,0.36939 0,0.13013 -0.058652,0.23637 0.055554,0.31873 0.1142066,0.0804 0.343785,0.16484 0.6887353,0.25348 l 0.2202553,0.0565 c 0.4568261,0.11395 0.7807998,0.25518 0.9719209,0.42368 0.1934518,0.16661 0.2901777,0.38918 0.2901777,0.66771 0,0.31717 -0.1445062,0.55922 -0.4335186,0.72617 -0.2866815,0.16709 -0.6817428,0.28451 -1.1851839,0.25304 -0.2097671,-0.0131 -0.1146644,0.0546 -0.4919054,-0.0132 -0.4245198,-0.0652 -0.6138119,-6.7e-4 -0.8820689,-0.33567 l 0.3141927,-0.46368 c 0.2377361,0.12261 0.1577833,0.10281 0.388527,0.17214 0.2307438,0.0672 0.4591568,0.1079 0.6852391,0.12203 0.3029969,0.0189 0.5360714,-0.0112 0.6992236,-0.0905 0.1631521,-0.0813 0.2447282,-0.20428 0.2447282,-0.36895 0,-0.15249 -0.059434,-0.27311 -0.178302,-0.36186 -0.1165373,-0.0886 -0.3740847,-0.18296 -0.772642,-0.28313 l -0.2237516,-0.0597 c -0.3985574,-0.0981 -0.6864044,-0.22794 -0.863541,-0.38945 -0.1771366,-0.16355 -0.2657049,-0.37748 -0.2657049,-0.64179 0,-0.32123 0.1305217,-0.56111 0.3915651,-0.71964 0.2610434,-0.15852 0.6316318,-0.22277 1.1117653,-0.19275 0.2377361,0.0149 0.4614877,0.0441 0.6712548,0.0877 0.2097671,0.0436 0.4032189,0.10144 0.5803555,0.17352 z" + style="stroke-width:0.04423349" id="path926" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccsccccsccccccccsccccsccscc" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333397px;line-height:1.25;font-family:'.Damascus PUA';-inkscape-font-specification:'.Damascus PUA';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.00864983" + x="-42.478462" + y="196.64659" + id="text1439"><tspan + sodipodi:role="line" + id="tspan1437" + x="-42.478462" + y="204.10867" + style="stroke-width:0.00864983" /></text> + <g + aria-label="I" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333397px;line-height:1.25;font-family:'.Damascus PUA';-inkscape-font-specification:'.Damascus PUA';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.00864983" + id="text1443" + transform="matrix(0.95613575,-0.12921776,0.08046973,0.8264771,-20.759577,36.918454)"> + <path + d="m -39.130096,191.22162 0,5.17798 h 1.488281 c 0.103353,0 0.177422,0.0207 0.222209,0.062 0.04479,0.0379 0.06718,0.0895 0.06718,0.15503 0,0.062 -0.02239,0.11368 -0.06718,0.15503 -0.04479,0.0413 -0.118856,0.062 -0.222209,0.062 h -3.410645 c -0.103353,0 -0.177422,-0.0207 -0.222208,-0.062 -0.04479,-0.0413 -0.06718,-0.093 -0.06718,-0.15503 0,-0.0655 0.02239,-0.11714 0.06718,-0.15503 0.04479,-0.0413 0.118856,-0.062 0.222208,-0.062 l 1.315915,-0.007 0.172367,-5.17104 h -1.488282 c -0.103353,0 -0.177422,-0.0189 -0.222208,-0.0568 -0.04479,-0.0413 -0.06718,-0.0947 -0.06718,-0.16019 0,-0.0655 0.02239,-0.11714 0.06718,-0.15503 0.04479,-0.0413 0.118856,-0.062 0.222208,-0.062 l 3.410645,0 c 0.103353,0 0.177422,0.0207 0.222209,0.062 0.04479,0.0379 0.06718,0.0895 0.06718,0.15503 0,0.0655 -0.02239,0.11886 -0.06718,0.16019 -0.04479,0.0379 -0.118856,0.0568 -0.222209,0.0568 z" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333397px;font-family:'Courier New';-inkscape-font-specification:'Courier New, 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.00864983" + id="path1445" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccscscsscscsccscscsscscsc" /> + </g> </g> </g> <text diff --git a/res/computerscare-medium-knob-effed.svg b/res/computerscare-medium-knob-effed.svg @@ -9,12 +9,12 @@ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" id="Layer_1" data-name="Layer 1" - viewBox="0 0 24 24" + viewBox="0 0 28 28" version="1.1" sodipodi:docname="computerscare-medium-knob-effed.svg" inkscape:version="0.92.2 5c3e80d, 2017-08-06" - width="24" - height="24"> + width="28" + height="28"> <metadata id="metadata1289"> <rdf:RDF> @@ -40,7 +40,7 @@ inkscape:window-height="834" id="namedview1287" showgrid="false" - inkscape:zoom="22.250293" + inkscape:zoom="15.733333" inkscape:cx="10.260513" inkscape:cy="14.442801" inkscape:window-x="0" @@ -57,18 +57,18 @@ <g id="Big_Knob" data-name="Big Knob" - transform="translate(0,-36)"> + transform="translate(0,-32)"> <path - style="fill:#245559;stroke:#000000;stroke-width:0.3851625;stroke-opacity:1" - d="M 23.416981,47.848118 C 24.134733,56.365445 18.59649,60.042484 12.241802,59.457236 6.3983829,58.919073 -0.89315225,53.976492 0.68692657,47.90236 2.8094213,39.743075 7.5372676,35.870447 12.241802,36.347485 c 3.525053,0.357439 6.496545,2.763659 7.494736,5.154063 0.983156,2.354404 3.480798,3.977445 3.680443,6.34657 z" + style="fill:#245559;stroke:#000000;stroke-width:0.44949234;stroke-opacity:1" + d="M 27.281965,45.86697 C 28.119596,55.806861 21.656355,60.098038 14.240308,59.415042 7.4209214,58.786996 -1.0884456,53.018905 0.75553789,45.930272 3.2325316,36.408223 8.7500225,31.88879 14.240308,32.445502 c 4.113807,0.417138 6.056174,1.699822 10.081252,4.298793 2.501437,1.615165 2.727415,6.357859 2.960405,9.122675 z" id="Big_Button_Circle" inkscape:connector-curvature="0" sodipodi:nodetypes="ssssss" /> <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#24c9a6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.93513405px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="m 12.524313,36.829044 c -0.503283,0.534885 -0.431943,2.884655 -0.431943,2.884655 l -0.0077,0.935591 -0.537576,0.621476 -0.02277,0.96511 0.46243,0.731793 -0.236187,0.843001 -0.320995,2.667997 c 0.859456,-0.265652 0.867606,-0.826487 2.34407,-0.62543 l -0.515241,-1.53632 -0.515162,-1.041486 0.226864,-1.451923 0.665221,-0.534283 -0.470396,-0.66595 -0.143814,-3.966556 c -0.409498,-0.055 -0.465018,-0.06908 -0.468402,0.01766 -0.0023,0.05751 0,0 -0.02833,0.154664 0,0 -0.04294,0.05198 -0.05424,0.0339 -0.01135,-0.01807 0.05419,-0.0339 0.05419,-0.0339 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#24c9a6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.27979493;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 14.045118,33.007491 c -0.901212,0.624222 -0.773465,3.36645 -0.773465,3.36645 l -0.45534,0.901175 -0.521089,0.915953 -0.04079,1.126303 0.828056,0.854017 -0.422931,0.983799 -0.574795,3.113605 c 1.538999,-0.310021 1.553591,-0.964526 4.197441,-0.729889 l -0.92262,-1.792916 -0.477568,-1.469672 -0.03868,-1.440186 0.304744,-0.623519 0.04412,-0.777177 -0.257525,-4.62905 c -0.733272,-0.06419 -0.832689,-0.08062 -0.838748,0.02061 -0.0042,0.06712 0,0 -0.05072,0.180496 0,0 -0.07689,0.06066 -0.09712,0.03956 -0.02032,-0.02109 0.09704,-0.03956 0.09704,-0.03956 z" id="Button_Pointer" inkscape:connector-curvature="0" - sodipodi:nodetypes="cccccccccccccccscac" /> + sodipodi:nodetypes="cccccccccccccccscacc" /> </g> </svg> diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp @@ -21,8 +21,15 @@ extern Plugin *plugin; static const NVGcolor COLOR_COMPUTERSCARE_LIGHT_GREEN = nvgRGB(0xC0, 0xE7, 0xDE); - static const NVGcolor COLOR_COMPUTERSCARE_GREEN = nvgRGB(0x24, 0xc9, 0xa6); +static const NVGcolor COLOR_COMPUTERSCARE_RED = nvgRGB(0xC4, 0x34, 0x21); +static const NVGcolor COLOR_COMPUTERSCARE_YELLOW = nvgRGB(0xE4, 0xC4, 0x21); +static const NVGcolor COLOR_COMPUTERSCARE_BLUE = nvgRGB(0x24, 0x44, 0xC1); + + +static const NVGcolor COLOR_COMPUTERSCARE_TRANSPARENT = nvgRGBA(0x00, 0x00,0x00,0x00); + + //36 201 166 @@ -38,12 +45,50 @@ struct ComputerscareGreenLight : GrayModuleLightWidget { } }; + +struct ComputerscareRedLight : ModuleLightWidget { + ComputerscareRedLight() { + bgColor = nvgRGBA(0x5a, 0x5a, 0x5a, 0x00); + borderColor = nvgRGBA(0, 0, 0, 0x00); + addBaseColor(COLOR_COMPUTERSCARE_RED); + } +}; +struct ComputerscareYellowLight : ModuleLightWidget { + ComputerscareYellowLight() { + bgColor = nvgRGBA(0x5a, 0x5a, 0x5a, 0x00); + borderColor = nvgRGBA(0, 0, 0, 0x00); + addBaseColor(COLOR_COMPUTERSCARE_YELLOW); + } +}; +struct ComputerscareBlueLight : ModuleLightWidget { + ComputerscareBlueLight() { + bgColor = nvgRGBA(0x5a, 0x5a, 0x5a, 0x00); + borderColor = nvgRGBA(0, 0, 0, 0x00); + addBaseColor(COLOR_COMPUTERSCARE_BLUE); + } +}; + + + template <typename BASE> struct ComputerscareHugeLight : BASE { ComputerscareHugeLight() { this->box.size = mm2px(Vec(8.179, 8.179)); } }; +template <typename BASE> +struct ComputerscareMediumLight : BASE { + ComputerscareMediumLight() { + this->box.size = mm2px(Vec(6,6)); + } +}; +template <typename BASE> +struct ComputerscareSmallLight : BASE { + ComputerscareSmallLight() { + this->box.size = mm2px(Vec(3,3)); + } +}; + struct OutPort : SVGPort { OutPort() { @@ -83,6 +128,5 @@ struct LrgKnob : RoundBlackSnapKnob { struct SmoothKnob : RoundBlackKnob { SmoothKnob() { setSVG(SVG::load(assetPlugin(plugin, "res/computerscare-medium-knob-effed.svg"))); - box.size = Vec(20,20); } }; diff --git a/src/ComputerscareILoveCookies.cpp b/src/ComputerscareILoveCookies.cpp @@ -14,6 +14,7 @@ const int numFields = 3; const int numKnobRows = 5; const int numKnobColumns = 5; const std::string knoblookup = "abcdefghijklmnopqrstuvwxy"; +const std::vector<NVGcolor> outlineColorMap = {COLOR_COMPUTERSCARE_RED,COLOR_COMPUTERSCARE_YELLOW,COLOR_COMPUTERSCARE_BLUE}; class MyTextFieldCookie : public LedDisplayTextField { @@ -84,7 +85,7 @@ struct ComputerscareILoveCookies : Module { }; enum LightIds { SWITCH_LIGHTS, - NUM_LIGHTS + NUM_LIGHTS = SWITCH_LIGHTS + numKnobRows * numKnobColumns * numFields }; SchmittTrigger globalClockTrigger; @@ -141,7 +142,7 @@ ComputerscareILoveCookies() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LI int length = 0; for (int i = 0; i < numFields; i++) { - length = rand() % 12 + 1; + length = rand() % 12 + 2; string = ""; for(int j = 0; j < length; j++) { randchar = mainlookup[rand() % mainlookup.size()]; @@ -166,7 +167,12 @@ ComputerscareILoveCookies() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LI numSteps[index] = absoluteSequence.size(); absoluteSequences[index] = absoluteSequence; } - + int getAbsoluteStep(int index) { + return this->absoluteStep[index]; + } + int getCurrentStep(int index) { + return absoluteSequences[index][getAbsoluteStep(index)]; + } void onCreate () override { for(int i = 0; i < numFields; i++) { @@ -241,6 +247,9 @@ void ComputerscareILoveCookies::step() { //printf("%i, %f",i,activeKnob); atFirstStep = (this->absoluteStep[i] == 0); + for(int k = 0; k < numKnobRows * numKnobColumns; k++) { + lights[SWITCH_LIGHTS + i*numKnobRows*numKnobColumns + k].value = (k==activeKnob) ? 1.0 : 0.0; + } } if(inputs[CLOCK_INPUT + i].active) { outputs[TRG_OUTPUT + i].value = params[KNOB_PARAM + activeKnob].value; @@ -255,12 +264,13 @@ void ComputerscareILoveCookies::step() { } ///////////////////////////////////////////////// -struct NumberDisplayWidget3 : TransparentWidget { +struct NumberDisplayWidget3cookie : TransparentWidget { int *value; std::shared_ptr<Font> font; + NVGcolor outlineColor; - NumberDisplayWidget3() { + NumberDisplayWidget3cookie() { font = Font::load(assetPlugin(plugin, "res/digital-7.ttf")); }; @@ -270,6 +280,11 @@ struct NumberDisplayWidget3 : TransparentWidget { NVGcolor backgroundColor = nvgRGB(0x00, 0x00, 0x00); nvgBeginPath(vg); + nvgRoundedRect(vg, -2, -4, box.size.x+4, box.size.y+8, 4.0); + nvgFillColor(vg, outlineColor); + nvgFill(vg); + + nvgBeginPath(vg); nvgRoundedRect(vg, 0.0, 0.0, box.size.x, box.size.y, 4.0); nvgFillColor(vg, backgroundColor); nvgFill(vg); @@ -288,7 +303,41 @@ struct NumberDisplayWidget3 : TransparentWidget { nvgText(vg, textPos.x, textPos.y, to_display.str().c_str(), NULL); } }; +//////////////////////////////////// +struct SmallLetterDisplay : TransparentWidget { + + std::string value; + std::shared_ptr<Font> font; + bool active = false; + + SmallLetterDisplay() { + font = Font::load(assetPlugin(plugin, "res/Oswald-Regular.ttf")); + }; + + void draw(NVGcontext *vg) override + { + // Background + NVGcolor backgroundColor = nvgRGB(0xC0, 0xE7, 0xDE); + + if(active) { + nvgBeginPath(vg); + nvgRoundedRect(vg, -1.0, -1.0, box.size.x-3, box.size.y-3, 8.0); + nvgFillColor(vg, backgroundColor); + nvgFill(vg); + } + + // text + nvgFontSize(vg, 19); + nvgFontFaceId(vg, font->handle); + nvgTextLetterSpacing(vg, 2.5); + + Vec textPos = Vec(6.0f, 12.0f); + NVGcolor textColor = nvgRGB(0x10, 0x10, 0x00); + nvgFillColor(vg, textColor); + nvgTextBox(vg, textPos.x, textPos.y,80,value.c_str(), NULL); + } +}; void MyTextFieldCookie::onTextChange() { module->onCreate(); } @@ -297,27 +346,47 @@ struct ComputerscareILoveCookiesWidget : ModuleWidget { double verticalSpacing = 18.4; int verticalStart = 80; - - double knobXStart = 6; + int index; + double knobPosX; + double knobPosY; + double knobXStart = 2; double knobYStart = 8; - double knobRowWidth = 12; - double knobColumnHeight = 9; + double knobRowWidth = 13; + double knobColumnHeight = 10; ComputerscareILoveCookiesWidget(ComputerscareILoveCookies *module) : ModuleWidget(module) { setPanel(SVG::load(assetPlugin(plugin, "res/ComputerscareILoveCookiesPanel.svg"))); for(int i = 0; i < numKnobRows; i++) { for(int j = 0; j < numKnobColumns; j++) { - ParamWidget* knob = ParamWidget::create<SmoothKnob>(mm2px(Vec(knobXStart + j*knobRowWidth,knobYStart + i*knobColumnHeight)), module, ComputerscareILoveCookies::KNOB_PARAM +numKnobColumns*i + j, -10.0f, 10.0f, 0.0f); + knobPosX = knobXStart + j*knobRowWidth; + knobPosY = knobYStart + i*knobColumnHeight; + index = numKnobColumns*i + j; + + addChild(ModuleLightWidget::create<ComputerscareMediumLight<ComputerscareRedLight>>(mm2px(Vec(knobPosX-3, knobPosY - 2)), module, ComputerscareILoveCookies::SWITCH_LIGHTS + index)); + addChild(ModuleLightWidget::create<ComputerscareMediumLight<ComputerscareYellowLight>>(mm2px(Vec(knobPosX-3, knobPosY )), module, ComputerscareILoveCookies::SWITCH_LIGHTS + index + numKnobColumns*numKnobRows)); + addChild(ModuleLightWidget::create<ComputerscareMediumLight<ComputerscareBlueLight>>(mm2px(Vec(knobPosX-3, knobPosY +2)), module, ComputerscareILoveCookies::SWITCH_LIGHTS + index + numKnobColumns*numKnobRows*2)); + + SmallLetterDisplay *letterDisplay = new SmallLetterDisplay(); + letterDisplay->box.pos = mm2px(Vec(knobPosX-3,knobPosY-2)); + letterDisplay->box.size = Vec(20, 20); + letterDisplay->value = knoblookup[index]; + //letterDisplay->active = (module->absoluteSequences[i][module->absoluteStep[i]]==index); + addChild(letterDisplay); + + + + ParamWidget* knob = ParamWidget::create<SmoothKnob>(mm2px(Vec(knobPosX,knobPosY)), module, ComputerscareILoveCookies::KNOB_PARAM +index, -10.0f, 10.0f, 0.0f); addParam(knob); + } } //global clock input - addInput(Port::create<InPort>(mm2px(Vec(2 , 59)), Port::INPUT, module, ComputerscareILoveCookies::GLOBAL_CLOCK_INPUT)); + addInput(Port::create<InPort>(mm2px(Vec(2 , 57)), Port::INPUT, module, ComputerscareILoveCookies::GLOBAL_CLOCK_INPUT)); //global reset input - addInput(Port::create<InPort>(mm2px(Vec(12 , 59)), Port::INPUT, module, ComputerscareILoveCookies::GLOBAL_RESET_INPUT)); + addInput(Port::create<InPort>(mm2px(Vec(12 , 57)), Port::INPUT, module, ComputerscareILoveCookies::GLOBAL_RESET_INPUT)); for(int i = 0; i < numFields; i++) { //first-step output @@ -342,9 +411,10 @@ struct ComputerscareILoveCookiesWidget : ModuleWidget { module->textFields[i] = textField; //active step display - NumberDisplayWidget3 *display = new NumberDisplayWidget3(); + NumberDisplayWidget3cookie *display = new NumberDisplayWidget3cookie(); display->box.pos = mm2px(Vec(24,verticalStart - 9.2 +verticalSpacing*i)); display->box.size = Vec(50, 20); + display->outlineColor = outlineColorMap[i]; if(&module->numSteps[i]) { display->value = &module->absoluteStep[i]; } diff --git a/src/ComputerscarePatchSequencer.cpp b/src/ComputerscarePatchSequencer.cpp @@ -382,8 +382,8 @@ struct ComputerscarePatchSequencerWidget : ModuleWidget { double xpos = 35 + column_spacing * j + 6.3 + rand()%8-4; double ypos = top_row + row_spacing * i + 8.3 + rand()%8-4; // red light indicates the state of the matrix that is the active step - addChild(ModuleLightWidget::create<MediumLight<RedLight>>(Vec(xpos, ypos), module, ComputerscarePatchSequencer::SWITCH_LIGHTS + i + j * 10+100)); - addChild(ModuleLightWidget::create<MediumLight<RedLight>>(Vec(xpos+rdx, ypos+rdy), module, ComputerscarePatchSequencer::SWITCH_LIGHTS + i + j * 10+100)); + addChild(ModuleLightWidget::create<ComputerscareSmallLight<ComputerscareRedLight>>(Vec(xpos, ypos), module, ComputerscarePatchSequencer::SWITCH_LIGHTS + i + j * 10+100)); + addChild(ModuleLightWidget::create<ComputerscareSmallLight<ComputerscareRedLight>>(Vec(xpos+rdx, ypos+rdy), module, ComputerscarePatchSequencer::SWITCH_LIGHTS + i + j * 10+100)); } addInput(Port::create<InPort>(Vec(3, i * row_spacing + top_row), Port::INPUT, module, ComputerscarePatchSequencer::INPUT_JACKS + i));