Forum

    • Register
    • Login
    • Search
    • Categories

    Making a button that selects a specific preset

    General Questions
    2
    4
    206
    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.
    • SteveRiggs
      SteveRiggs last edited by SteveRiggs

      Hi again all,

      I'm trying to make a button that selects a specific preset in the preset browser.

      Here's what I thought might work as the code but it's not working. It compiles ok but when the button is pushed, the preset doesn't change.

      Any idea where I've gone wrong?

      (My button is called Preset1Button and the preset is just called Preset1)

      Engine.getUserPresetList();
      
      Content.getComponent("Preset1Button").setControlCallback(onPreset1ButtonControl);
      
      inline function onPreset1Button(component, value)
      {
           if(value == 1)
      
           Engine.loadUserPreset("Preset1")(false);
      };
      

      www.anarchyaudioworx.com

      www.facebook.com/groups/audioworx/

      1 Reply Last reply Reply Quote 0
      • d.healey
        d.healey last edited by d.healey

        @SteveRiggs said in Making a button that selects a specific preset:

        Engine.loadUserPreset("Preset1")(false);

        I'm pretty sure this function has been broken for ages. - https://forum.hise.audio/topic/1142/engine-loaduserpreset

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        SteveRiggs 1 Reply Last reply Reply Quote 1
        • SteveRiggs
          SteveRiggs @d.healey last edited by

          @d-healey Ah, no way. I wondered what was going on. Would that code be correct if it wasn't broken? Or is there another way I wonder...

          www.anarchyaudioworx.com

          www.facebook.com/groups/audioworx/

          1 Reply Last reply Reply Quote 0
          • SteveRiggs
            SteveRiggs last edited by

            @Christoph-Hart Sorry to bug mate, is it possible to fix the Engine.loadUserPreset function at all? I've got a great idea but can do it without this function.

            www.anarchyaudioworx.com

            www.facebook.com/groups/audioworx/

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            19
            Online

            1.1k
            Users

            7.0k
            Topics

            64.6k
            Posts