HISE Logo Forum
    • Categories
    • Register
    • Login

    Strange behavior with Presets

    Scheduled Pinned Locked Moved General Questions
    15 Posts 2 Posters 765 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.
    • d.healeyD
      d.healey @nouslou
      last edited by

      @nouslou Post a minimal project, it's no good posting a snippet in this case because I don't have your presets

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

      nouslouN 2 Replies Last reply Reply Quote 1
      • nouslouN
        nouslou @d.healey
        last edited by

        @d-healey you mean this project in .zip on any file hosting?

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

          @d-healey it's only 3 mb :)

          test_interface.zip

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

            @nouslou said in Strange behavior with Presets:

            @d-healey it's only 3 mb :)

            test_interface.zip

            That seems to be some project related to tabbed interfaces...

            I mean make a new minimal project - minimal = the project only contains the essential components required to demonstrate the problem.

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

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

              @d-healey here it is, David

              test_interface_2.zip

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

                In your changeTab2callback you are hiding/showing panels and also changing the preset.

                When changing preset through the preset browser though you haven't set anything up to hide/show the panels. The UserPresetHandler.setPostCallback() might be the way to go.

                https://docs.hise.audio/scripting/scripting-api/engine/index.html#createuserpresethandler
                https://docs.hise.audio/scripting/scripting-api/userpresethandler/index.html#setpostcallback

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

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

                  @d-healey I totally don't understand how to implement this) I wrote this code. But every time I choose preset manually or with buttons - Hise crashes. Where should I exactly put it?

                  const var presetHandler = Engine.createUserPresetHandler();
                  
                  presetHandler.setPostCallback(postPreCallback);
                  
                  inline function postPreCallback()
                  {
                  		Panel3.showControl(true);
                  		Panel4.showControl(false);	
                  }
                  
                  
                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @nouslou
                    last edited by d.healey

                    @nouslou I think you need to use a real function here (not an inline one).

                    presetHandler.setPostCallback(function()
                    {
                        // Your code here
                    });
                    

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

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

                      @d-healey and how can I declare each preset? Because for every specific preset there are different panels need to show/hide . I mean how to tell Hise for example : if I choose this preset_1 manually from preset Browser - do this, but when I manually from preset browser choose preset_2 - do that

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

                        @nouslou There are a number of ways to do that. If you are using buttons to hide/show each combination of panels you could set the buttons to saveInPreset = true, then it would happen automatically (but not if those buttons are also changing presets because that would create an infinite loop). Another way is to hardcode it in the postCallback, but this could get ugly quickly. Another way is to store the configuration in an external JSON file and read it in after the preset loads and do the hiding/showing then.

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

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

                          @d-healey Thank you so much, David, as usual!! I managed to solve this

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

                          24

                          Online

                          1.8k

                          Users

                          12.0k

                          Topics

                          104.1k

                          Posts