Forum
    • Categories
    • Register
    • Login

    Change radio groups in the compiled plugin

    Scheduled Pinned Locked Moved Solved Scripting
    8 Posts 2 Posters 26 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Oli UllmannO
      Oli Ullmann
      last edited by

      Hi everyone :-)

      Does anyone know if it's a problem to dynamically change radio groups in the compiled plugin, or can we do that?

      I would use button.set(“radioGroup”, value); for that.

      Thanks a lot
      Oli

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @Oli Ullmann
        last edited by

        @Oli-Ullmann Try it and tell us :)

        By the way, I just posted a video about radio buttons on Patreon: https://www.patreon.com/posts/master-radio-154762289

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        Oli UllmannO 1 Reply Last reply Reply Quote 1
        • Oli UllmannO
          Oli Ullmann @David Healey
          last edited by

          @David-Healey
          Hey David,
          Thanks a lot—I watched your video. It works great in principle. However, when the buttons are saveInPreset the last button in the array is always set to 1 when I recompile. Do you have any idea how to prevent that? Here's a snippet:

          HiseSnippet 937.3ocsW0taaaCEkxNrnVacncXO.B4W1CAE9C4OJFBlWbRZM1RpQcVvJJJ5nonhIhDo.EU2LJJPez1izdCZIkTrjSsViIV0OBvk264vi48dIuYlfiIwwbAvx9hUQDf02BmuhIWNYIhx.SOFX88PAxixOJQJ4r3KHwRvQqhPwwDOfkU8mpiypwdfzu+8mOBEfXXRwR.vkbJl7azPprX0Yi+UZPvoHOxEzvRQ6NdJlylvC3IJMUG1FDgvWithbNRGVMH3Yn3k.qeDNzuGZPe+d3gD2tDDxaQ+AOwaQuNCF1aDwEiPi56hceBv5dm3QkbwbIRRhAV6cD2a07k7+hksAWRioKBHZiNf4pcNa4S4Ad5eh5UASVRC7lcygULPwxrhit5YGc+.7LpGc85EGgOL0gSAhxGfV01Td02PdcJKu1kj2VjjUIIsWljdDbNVPijEdz54afSYRhvGoxSkkRVrfZGVGNgqhfIebH5ZxoBkwZDMGzt8ANp+z5mrsU4pXoyaQBmPtGIuFw4PmWcC9qHxI7vHNSYzb+ERVm8acfsSUeUBqqYv5YFLWyf02LXCLC1PyfMZ+VuVk4r84hlKbnrxYtV1MV73XMBlTvClfBBVnZ+ZVJja4RWDXSYATFwwOggkT9FLdalv2nkCTUMAIjV1uytQERISKWpCS49vCcVCVsque8twYmykjmyZlxk86sctsKe+s5KWaADwVcquXR7eArIKIbAQT9WhNPUy2lczvp6nKegCNKiUJPNaJiJedDgU00Pf7zrp6+94pREpLs2+6x68yNPATUK98f5NPPpd0M7f6JltFfomAXbM.SeCvLv.LCM.yn0XpA98oGijH88z4IMUhLhHjTcMh0wj2pdkL6V6FviIwWK4QoY07ZdUY0WJu92qeG8OCGup3Q0yGCt6zzsRZd4tPSupn4CncgF2JoweWnoekzb8tPyfpnYbztPyvpn4eD6BMipTMIiAe9r.poP3dIAH4lilnGfK2g51sMlGP+lOKlJWUd.u+2lW4tJwGAmQk3kaWi01hFUsXeMzX9TdO.dhuOAKKD3dvS+iuNizAdAOQRYWcFRJnpjM77jv4pIiwD0tyXj.8qKpqVzPSsaqs0m.yILuTiOp9xc1Qaak6ryMNAgHrf+Fb1MZ54Hue5JJMwRm4tA7Lssy52MJNmCUi09FLdSp9LfcMEXOSA5ZJv9lBbfo.GZJvQeYf5+qieIQxCyZa.fylcR5aPVVmvPpJvzpUvm.8r0voB
          

          So far, this has been my solution. The only problem is that I can also disable the selected button, so that no button is active at all, which shouldn't happen.

          			if(value)
          			{
          			    local selectedButtonIndex = modeButtons.indexOf(component);
          			    
          			    for (i = 0; i < modeButtons.length; i++)
          			    {
          			        // Not selected
          			        if (i != selectedButtonIndex)
          			        {
          			        	modeButtons[i].setValue(0);
          			        	// more code...
          			        }
          			        
          			        // Selected
          			        if (i == selectedButtonIndex)
          			        {
          			        	// more code...
          			        }
          			    }
          			}
          
          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @Oli Ullmann
            last edited by

            @Oli-Ullmann My first thought is disable saveInPreset for all of them and instead store the value of the last clicked button in the panel that contains the buttons (or add a panel specially for it). Set the panel to saveInPreset and restore the button state from there.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            Oli UllmannO 1 Reply Last reply Reply Quote 0
            • Oli UllmannO
              Oli Ullmann @David Healey
              last edited by

              @David-Healey said in Change radio groups in the compiled plugin:

              My first thought is disable saveInPreset for all of them and instead store the value of the last clicked button

              The problem with this solution is that my plugin has two operating modes:

              Single – here I need the radioGroup functionality, which ensures that only one button is selected at a time.

              Multi – here I don’t need the radioGroup functionality, and multiple buttons can be selected.

              That's why I wrote my own script for the radioGroup functionality, which, however, leads to the problem I mentioned.

              So my idea now was to dynamically change the radioGroup attribute, but I don’t know if that will cause problems. I guess I’ll just have to try it out... :-)

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @Oli Ullmann
                last edited by

                @Oli-Ullmann said in Change radio groups in the compiled plugin:

                I guess I’ll just have to try it out.

                This is the way

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                Oli UllmannO 2 Replies Last reply Reply Quote 1
                • Oli UllmannO
                  Oli Ullmann @David Healey
                  last edited by

                  @David-Healey
                  😆

                  this_is_the_way.png

                  1 Reply Last reply Reply Quote 1
                  • Oli UllmannO
                    Oli Ullmann @David Healey
                    last edited by

                    @David-Healey
                    Okay, it works. I tested it in Cubase and Logic, and there are no issues with this snippet. :-)

                    HiseSnippet 1700.3oc4YrzaSbDd2jrIwNzpBhJ331HN3fhPwORBnpJaRbbHp4gab3QEBAi2c13Qr6LlcmMDCBodr+A5AtweidqW6sJwefJUoJwM9CT09M6t16rNqSbcf.z5CHlu46878bScWlA1yi4pnlcuNswJpmSqQGJu0psPDpxFUUTuflKxjvVwmyYTu8vdbkU5zF44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KfRYIFdSLfF0iv6Hy42YCWNrp340pS3FsRWGGKEcDR+deniQij+YZgyEDqfSnU6duel+VV7WJT7yncWzA3fYTBD9WFbFZw5nuNlhCmj4XVm52F10oZOzqSsiAGTg8bQTu1LObdYN2.6P1CB68R.sOJJjJEIfVEy8oIYcHnDXIbE0.WgDdSWoKvBx.qinIXFbNAm1hHku+6kWihfGrFXvxM2wy.bLB+rbZQceXjr6RL4sxKSXL3BxfuEx0DdCMRDzN9wsTY9QboxI+naoxOAJMkXu2Lc0wv8IVid.1FZpG8kLphsPP85tPSl5sEixZ2hQIIdn2EycI6uONQ7SpFzM4bXH6XHWrxtXaLr1SLnqTYSXjcjK3mvinuH++5uAPpuWWVKTc0E0Kz+zskx3+mtkh5DRxeptyhFrKMHxvOkSuMqSnB0bwOwGSM5HUfqSkdPkpu8xJ0vXylwgtOxx5OKmnjJ7nO9Yc.5EhLrOLgl6x74vjjagfjevQnssuSCnEpAFTPJEaK1JTcLwRLgmWPbNrgH0L3veC+htLu3rZzk46doxQqZ84QUsB+HHQ0US9gQRLN0tLlSCxy5VJ4Uu7kuobUjSaPyi.UoXw+n7cw7MApsiQ6WKW0sSevdS4fNex.fvE7yvREq.n+76tXgyZu7TcGJq2WQJvEet3yIcuQfEgdRAYf27lNLeJOw.Et3jStAUNXdbIXuh+SW4WN6SitjVrU7+iboYB8FSoE7k.CbBSG9+S95F.Rz8aSrkza4kqz6hcI62hK2OuagRIJfDrWWtKbYBBtXS1SqCBTT1sGe9wWW4Vji.UoZk9lhcOLrBZxwNe6mt4dG+rifo+w8LHWRCVjnfdvfH5eXlD4r3A6rPFNHCW1CMB+1chRYSG.AraZvehuLZaINqm+newNGXgmGZXjjUGgvBiJgEGUBKMpDt3nR3RiJgKOpDd8SlPw9n2zmybByMf8xquVvWXUUMbk7fzDk+AXOv2TI
                    
                    1 Reply Last reply Reply Quote 1
                    • Oli UllmannO Oli Ullmann has marked this topic as solved
                    • First post
                      Last post

                    22

                    Online

                    2.2k

                    Users

                    13.6k

                    Topics

                    118.0k

                    Posts