Getting Panel Value to Change Knob
-
Hey Folks,
I Have a panel, That acts as a Button, and I want to change the knob1's value according to the Panel's value.Also, we need to update Lable 1 to show that value!
Any Help is much appreciated:HiseSnippet 1673.3oc2X01aaaCDVJIZM1ctacqeXejnanPdMywtIoc.YAyINNqdMuXDm10hhhNFIZahRSJHQmXuf.reZ6mz9GrcTuXQ4XmzXzFrNEfXo63w64NduPxl9BGRPfv2vL2QC8HFletUqgbY2ZcwTtQisMLui0d3.IwGEQZqgd3f.hqgo47+hhfYtELBe96edKLCycHojLLdgf5P1k1iJSo1r5ynL1NXWxQzdZid0pMbD7ZBlnOfm4sJa3gcdGtCYerZXyYYX9Y0coRgeKIVRBLLWXKg6vVcEmxiF+KnAziYD0GULZASTD4cDLWEhUTMp0kxbalX2AFFlVMS8ByG4Etm0dTW5H5odiuLjAJUBc+g4bYg27YfWEc3UVCdS.RlZPZgHHcWqVN9TOYJGEdtsUCNr3zFCtccnDMVi413VV0DvH3xR8vuiriO7wHIrWsb4kPqTtbw0KjuPd3A7+ARzIXezy3hiqf1.kHcGhrlnmmfCeXe+Pt2u35ZBrK9XBa5RDwVIR97TNixIn184NRpfiD7v4SInufY6jH0RvDy5SJl+r74hjuT.AlKIYf79KEwa87mCS4khRkPwycMLicLDTYmUkgnB7.oViGmsGg2eplSL+rtfdCiBdC.wdc4Wt1pp+VBcYu8FklQS4oP9X0nrflPHn7PQeox0Ym36r6TrP9yJDNEcJ0Fxq1jwrKOHZMMZRT+usvGYSAbUdcDE8SnUged3CKFwLVd0ixLF.CS1kFnL4ei5J6ZWb4QlVIFg2Q1E88H554SAZxaSfzxKusO9TzVfauiunO2MkEsMxNQSuPsbZWDswFHZwQi.V4SdsSz5nBE1If4Tpr6lLutX6Q.70z2.t2ROYshESA34Exm0wl7FgEPJnqsb4xNzQPzEKwk5JNApDBPrB5AO.MF8FbWxfH7mcNNqvXKwynM8nGqaSiMUuWzGyOj05mHTutXrrBiWDNiii7i+VpdiBiOTEoPbOj3Hw7NLh8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A65WIZ32kSpO0hvcC+3efmXlUTeaFyrRByaDczC63KdqSzY0TwoKFRAradXg5bV6o9FM5PZVVkKUFpM6ReqiixE+CULLlrLOZFjYkYPlUmAYVaFj4wyfLOYFj4GuTYTMW1ruTzKJkCHzrd3gkMMG0zF1f7+BTXIpgO
-
@Natan I think you can set this up quite easily in the mouse callback:
pnlMenu.setMouseCallback(function(e) { var value = parseInt(e.x / this.getWidth() * myColours.length); if (e.mouseUp) { Console.print(value); this.setValue(value); this.repaint(); Knob1.setValue(value); Label1.set("text",value); }
Which means you can also remove your other inline function
inline function onKnob1Control(component, value) { Label1.set("text",value); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
HiseSnippet 1679.3oc2X8tSabDD+NfqA6Tm1zlOzOthVEctAYrCPRknQ0fwz3FLXgIoIJJJc4t01qx5cOc2Z.WDp8QqOR8Mnc16O91yXCAqDTSOjv2MyN67alclYmca4KbHAABeCybGNziXX94VsGxk8p0CS4FM11v7NVMwARhOJhzVC8vAADWCSy4+YEAybKXD972+zVXFl6PRIYX7BA0grKsOUlRsU0mQYrcvtjCo80F8ZUa3H30DLw..OyaU1vC67NbWxdX0vlyxv7yp6RkB+1RrjDXXtvVB2gs6INgGM9WPCnGwHpOpXzFlnHx6HXtJDqnZTqGk41JwtCLLLsZk5ElOxKbOqlTW5H5odiuLjAJUBc+g4bYg27YfWEc3UVCdS.RlZPZgHHcWq1N9TOYJGEdtsUCNr3zACtccnDMVi49iaYUS.ifKK0G+NxN9vGijvdsxkWFsZ4xE2nP9B4gGv+GHQGi8QOiKNpB5InDo6Rj0D88Db3C6kB4tTwMzDXW7QD1zkHh8RJMkJiGm0jvGLUgh4mUQ8GFEhD.h85xub80T+sL5xd6Ma.1FZJOExGqlRADYKXgVdfXfjxIH6NC3NRpfa2sXg7mUHbJ5VpCD8tIiYW9zHOWzjn9eGgOxlB3p7FHJ5GQqA+7fGTLhYr7pGkYbJLLYOZfxj+UpqrmcwUFYZkXDdWYOz2inajOEnIuM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