HISE Logo Forum
    • Categories
    • Register
    • Login

    Update expansion presets

    Scheduled Pinned Locked Moved General Questions
    17 Posts 5 Posters 587 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.
    • marcLabM
      marcLab
      last edited by

      Hello friends,

      When using expansions, is there a way to overwrite older presets or add new presets to the UserPresets folder when running an updated .hr file with the same name as the already installed one?
      I'm using .installExpansionFromPackage(hr,dir) function to install a .hr encrypted expansion. If the user reinstalls an updated .hr. I want to add or update the presets without the user needing to go to their AppData folder to delete the older expansion.

      Thanks!

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

        I don't think there is a way to do this with the expansion installer. If you're using the default preset browser they can install them through the More menu.

        Overwrite existing presets is not a good idea because the user might have edited them, however I think it would be useful to be able to install additional presets when providing an update via a hr file.

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

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

          @d-healey My idea was to make two folders inside the UserPresets, one called Default-Presets and the other folder called User-Presets. When the user runs the installer containing the .hr files, it only deletes or replaces the Default-presets folder. So when the user loads the updated .hr, it only adds the missing folder containing the updated presets. The problem is you cant run a .hr that has the same name as an already existing .hr. It doesn't do anything

          d.healeyD DanHD 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @marcLab
            last edited by d.healey

            @marcLab But what if the user made changes to the default presets?

            The problem is you cant run a .hr that has the same name as an already existing .hr. It doesn't do anything

            This is a job for @Christoph-Hart. When using the default sample installer (not the expansion one) the popup gives the option to update if newer, this should be the default I think for the expansion installer. It would also be good to get the option to delete the hr files automatically after installation is completed.

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

            marcLabM 2 Replies Last reply Reply Quote 1
            • DanHD
              DanH @marcLab
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • marcLabM
                marcLab @d.healey
                last edited by marcLab

                @d-healey, I would find a way to remove the save preset btn if a preset in the Default-Preset is loaded

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

                  @d-healey Yeah, that would solve a big part of the problem!

                  1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart
                    last edited by

                    Hmm, it's not entirely trivial to come up with a solution that works for most scenarios, so I think we have to divide it into multiple steps:

                    1. A new function to delete an expansion (but it will not delete the user presets).
                    2. A new parameter to installExpansionFromPackage() with a function that is executed once the installation is completed (just like anything with the server API).
                    3. A function that extracts the user presets from a .hr1 file over existing presets (I think right now the default is doing nothing if a UserPreset folder is present), but it could simply reuse the logic from the Import all presets from Collection context menu which keeps user made presets and just updates the ones from the expansion.

                    It would also be good to get the option to delete the hr files automatically after installation is completed.

                    This could be easily implemented by deleting the file in the finished callback. You could even ask the user in a modal window with Engine.showYesNoWindow()...

                    d.healeyD marcLabM 2 Replies Last reply Reply Quote 1
                    • d.healeyD
                      d.healey @Christoph Hart
                      last edited by

                      @Christoph-Hart This implementation looks good to me. Is there a way to make the "factory" preset read-only?

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

                      1 Reply Last reply Reply Quote 1
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        So Mr Freedom wants to restrict his users from modifying the factory content :)

                        d.healeyD marcLabM 2 Replies Last reply Reply Quote 3
                        • d.healeyD
                          d.healey @Christoph Hart
                          last edited by

                          @Christoph-Hart Haha not at all. They can use save as, but if they f*** up their factory presets I don't want to deal with support.

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

                          1 Reply Last reply Reply Quote 0
                          • marcLabM
                            marcLab @Christoph Hart
                            last edited by

                            @Christoph-Hart hahaha!

                            1 Reply Last reply Reply Quote 0
                            • marcLabM
                              marcLab @Christoph Hart
                              last edited by

                              @Christoph-Hart said in Update expansion presets:

                              ).
                              A function that extracts the user presets from a .hr1 file over existing presets

                              That would be much appreciated :)

                              1 Reply Last reply Reply Quote 0
                              • Christoph HartC
                                Christoph Hart
                                last edited by

                                Alrighty, it's here:

                                • https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html#setinstallcallback
                                • https://docs.hise.audio/scripting/scripting-api/expansion/index.html#rebuilduserpresets
                                Dan KorneffD 1 Reply Last reply Reply Quote 2
                                • d.healeyD
                                  d.healey
                                  last edited by

                                  The install callback also seems like a good oppertunity to activate a license on a remote server.

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

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

                                    Will this work for deleting multi-part hr archives?

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

                                    1 Reply Last reply Reply Quote 0
                                    • Dan KorneffD
                                      Dan Korneff @Christoph Hart
                                      last edited by

                                      Is it possible to call rebuildUserPresets() without using the expansion installer?
                                      I'm looking to add a button in my maintenance panel to rebuild expansion presets, but I can't quite get it to work yet.
                                      I'm using an encryped expansion, and my plug already has an expansion handler in place:

                                      const var expHandler = Engine.createExpansionHandler();
                                      

                                      Then I'm calling the following with a button:

                                      inline function onRebuild_YesControl(component, value)
                                      {
                                          if(value)
                                          {
                                      	    expHandler.rebuildUserPresets();       
                                          }
                                      
                                      };
                                      
                                      Content.getComponent("Rebuild_Yes").setControlCallback(onRebuild_YesControl);
                                      

                                      But it's doing nothing.
                                      I've tried the example in docs like this:

                                      function installCallback(obj)
                                      {
                                          if(obj.Status == 2 && isDefined(obj.Expansion))
                                          {
                                              // make sure the user presets are updated
                                              obj.Expansion.rebuildUserPresets();
                                          }
                                      };
                                      

                                      But that doesn't work either because obj is waiting for an argument (which never happens cause I'm not using the installer).

                                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                                      51

                                      Online

                                      1.7k

                                      Users

                                      11.7k

                                      Topics

                                      101.9k

                                      Posts