event.drag x, y data for multiple points
-
I am trying to implement a multi click-drag area inside a panel to control a parametric eq's frequency & gain.
There are 8 dots, each dot is XY pad itself. I painted dots & picked knobs with arrays. But I can't figure out how to get x, y data for each one individually.
this.data.x = Math.range(event.x / this.getWidth(), 0, 1); this.data.y = Math.range(event.y / this.getHeight(), -1, 1);
HiseSnippet 2513.3oc2Z0DaabbEdojWWSJqDkfDzlaKDJJnhkT2eHEEqagorjXhPhrnMUcrggQxncGRNvK2kZ2kxhUQ.1GJPaNzhhhhBilCo.E8R5kBTfhBzf3CI2JPKP6kdyW58bnGKP6a1gK2Y+gRjxMNxZAzOyaduY9du27duY1cp4XqiccscDxjc6dcvBYtnX8dVdsVsEhXIrwZBYDEWY8qKb0dcPttXCgLYl7MnckI64D7e9hqbUjIxRGGRRP3l1Dc7aSZS7BoVqxaQLMqhLvaSZywcgJanaaspsocW.FSJJKzAoeOTS70PT1lPTHy4W2f3Y6T2C4gcExbtqZazqdK66aw3+lDWxNlXZCEg5v.wHW01zfhXJUgUaQLMpEnttBfhUKT4mjo7uh3lDCx.5gFgY76PJTBd6QlIhBuIi.OEd3IyAuTfTFNHcNFjdIw55NjNdg8PwyThaX4gcZf.yNOTX7JLwtmWbUafCKuEaitGtpCzXfD4UTjkmWpXQ44tbtb4.iuqmzdHGoac6ZHiZVlReOo.oah8V0tcGaKnQ9YCXXVPvPwpgb.OkmCY20utBHq+BHpjq2nAVGDKBCyFaRQNNndXipN3cAYuycubx9nK3Rz2sRUhaywatF1NR4IPK4KKQj9tRKC+4RWZtbGjSBd3l36Pt6P0YZ+ydo7j4.byIFcdNJwn8yKVJS4htTIr7brMWEYZtCrpO+5WuZWK8Tmpij8CAaZt.2CkyZfPd2vtqGwBmuAvjGw1Jey4NHDMMWrADPthoYd49SXS1bPiDyy9i6h8vll12OPKxNLaZ1CxkkxwsBsmahfkANHql37wTbvTcSjYWb94j91RpxvizqK40h3R64cHFdsxO27RvZzXzVPghT+4ggF5uucnqHf82DSZ1xCF8ERAD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SaK6NsrsHQbz2ftMilMwQV+jpBshmGh9kFBn7JUtA1Dib4Bw9lUdaXGuHmMY6o8jXKTF6KeYp9qugHCtRzb.RO+tW3IOSuW3QO5CRAd51K90EgTwpR9tRouZ7kOKpq+rXNZizcreWc1ETgFzeAeJfda4eYyyJtIsszf6Ajnn7hxzCNSdWcc550EfpOoKi5IPFsSfLENAxT7DHyRm.YJcBjY4iTFZk5U55Y2lslGHTac123OC2t5E9ezQNaoJ
-
@harris-rosendahl I only took a fast glimpse in the code and got errors and saw this:
XFreq[i].setValue(20000*this.data.x); YQ[i].setValue(20-(20*this.data.y)); XFreq[i].changed(); YQ[i].changed();
XFreq and YQ seems to be ordinary arrays so you can't use "setValue()", and you use .changed() on components not on arrays
Try:XFreq[i] = 20000*this.data.x; YQ[i] = 20-(20*this.data.y);
You also have set to callbacks that doesn't exist in you code
so you need to declare the XYPad and EQFunc callbacksarrayedFreq[i].setControlCallback(XYPad); arrayedQ[i].setControlCallback(EQFunc);
-
@harris-rosendahl I know there is a thread somewhere regarding multi drag, I'll look for it
-
Thank you so much for the advices, my bad, I've corrected the issues, edited but still can't usable for this way.
HiseSnippet 2532.3oc2Z07aabbEeojWWSJqDkfDz1KEKDZKnhkT2OHEEqagWY8QhPBsoEUcrggQxncGRNvK2kd2kxhQQ.1GJPaNzhhh1h.TTz.DzKsWJPOz.jfnCs2BPKP5kdy+IjCs2JP6a1gK2Y2kThTowQVKf9Xdy6Myu2adeLytSUWGCrmmiqPlra2sMVHyEEq001u4pMQDagMWSHin3JqeCgq1sMxyCaJjIyjuLsqLYOmPvymckqhrP1F3HRBB2zgXfeMRKheD0p5uJwxZCjIdaRKNtKnuogi8pNVNc.XLonrPajw8PMvWCQYaBQgLmecShuiaMejO1SHy4tpiY2ZMcdfMi+aR7H6XgoMTDpACDi7FNVlTDSoJrZShkY0P00S.TrpQJ+jLk+EDqPLI8oGYDlInCoHI3sGYlHN7lLF7T3gmLG7F.jxvAoywfzyIVyvkz1OpGJdlRbS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6q+dLdRgXkTPVIElUSgY0PLq+q91+dFOovrZJLqlBypovrZHlE9n6+mX7jBypovrZJLqkByZgX9v6+e9HFOovrVJLqkByZovrVHley+X0+BimTXVKEl0hg4M1X60sQP.DKXaxQNXS4ni0YWFiFUPPvDj1UDhep4zw0.Cg511XqfvnInECXskosoPpFNHrRLy+Ed50oBscldcpD1Ie9DQV7bNw9uxT1EGp+6zLVv7U6.YcR71tNTupKdWB9A8xLDki9oUaxKxzjoDeczt3fqoTfQ4ECZW2wskzKigxjzBDJGwUd6uOpW4s1i7Ud65F9.D11EY601wCqvOxI5Skuu0v9criyNiTLtnp2Ff5ww2EzCIpxSrJxN1fAsiMRUHb6X3wWgEnTCCZi408L.kkZ638Up1wxCGbsRT3ELhrJO4WA4ZBqKFwp1N4Qc6+TNg29uyep61+8TvdphcAEyFhwZjVssvqauK1xAnPw3yC6gL3D7gTiGNUww1ocSGaRrE5snaynQCbL+mApPq36ineogPJuf9VXKLxiKD6ap+ZvNdQtUX6o8jXKTF6Kq4.Wu9ZhL3JQyAH8z6dgm7L8dgG8nOHE3o6UwupHjJVUJXoT5Km0xmD00eRLGsPFtNugA6BpPC5uP.EPusCtb5YEqPaK0+d.IJJunL8fyj2vvf5ut.T8YvxndBjQ6DHSgSfLEOAxrzIPlRm.YV9HkgVodkN9NsX97.gpqy9F+Y31Uuv+y1G9VS
-
@harris-rosendahl
Line 53, column 35: This expression is not a function!
Can you spot why?
Once this is fixed, you'll see that anywhere you click/drag, all of the 8 parameters are changing. This is because you don't know which point is being clicked/dragged.
The reason for this is that the overall approach isn't the good one.
Don't try to set any parameters at first, and just focus on the widget itself. Put your knobs aside, the parameters will come later. For the moment, you need a way to store the nodes so you can find one reliably when you click on it based on a certain area around its coordinates. Hint -> store them in an array of objects that represents their position (but not only, you need to know if the node is clicked or not).Then and only then, you can start to think a mouse CB that can detect where you have clicked, and resolve the "is there a node under the cursor?" question so the node in question can be focused and updated
Then once you have this and are able to update the coordinates and repaint the nodes, you are ready to implement the parameters you want