HISE Logo Forum
    • Categories
    • Register
    • Login

    Preset Browser callback?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 68 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.
    • L
      Lurch
      last edited by

      Hey all!
      I'm trying to write the name of the currently loaded preset into a label so that the user can see which preset is loaded even when the preset browser tile is hidden - i got this working on compile with the following:

      PresetNameLabel.set("text", Engine.getCurrentUserPresetName());
      

      The problem i'm having is putting this in the callback of the floating tile does absolutely nothing:

      //PresetDisplay
      const var PresetNameLabel = Content.getComponent("PresetNameLabel");
      
      inline function onPresetBrowserControl(component, value)
      {
      	PresetNameLabel.set("text", Engine.getCurrentUserPresetName());
      };
      
      Content.getComponent("PresetBrowser").setControlCallback(onPresetBrowserControl);
      

      I tried popping a 'hello world' print into the callback, nada. Is there another way I should be getting a callback from the preset browser? I've had a read around the forum and it looks like a broadcaster might do the job but i can't make heads nor tails of it.

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

        @Lurch For this you need to use the preset handler.

        Look at the setPostCallback function.

        Link Preview Image
        HISE | Scripting | UserPresetHandler

        An object for customizing the data model

        favicon

        (docs.hise.audio)

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

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

          @d-healey Ahh gotcha - thanks as always d.healey!

          For the future:

          //PresetDisplay
          const var PresetNameLabel = Content.getComponent("PresetNameLabel");
          UserPresetHandler.setPostCallback(function()
          {
          	PresetNameLabel.set("text", Engine.getCurrentUserPresetName());
          });
          
          1 Reply Last reply Reply Quote 2
          • First post
            Last post

          11

          Online

          1.8k

          Users

          11.9k

          Topics

          103.9k

          Posts