HISE Logo Forum
    • Categories
    • Register
    • Login

    How to include the samples when building the plugin?

    Scheduled Pinned Locked Moved Newbie League
    19 Posts 4 Posters 479 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 @daniloprates
      last edited by

      @daniloprates Yes you could script a button that deletes the file, the user would still need to restart the plugin though.

      It's probably more user friendly to script a custom screen where the user can select a folder. All the functions needed for this are available in the scripting API.

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

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

        @d-healey

        Where in the scripting API is the link file in the app data folder referenced?
        If one wanted to create a button to reset the sample folder for the user if they decided to move the samples.

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

          @jeffd You can use the file and file system APIs to access the app data folder.

          You can use Settings.setSampleFolder() to update the link file.

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

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

            @d-heale
            ok let me try it.
            thanks

            J 1 Reply Last reply Reply Quote 0
            • J
              jeffd @jeffd
              last edited by

              @jeffd ```
              so I created a button to reset the sample folder for the user,
              but it doesnt retrigger a reset for the compiled plugin. I dont get any scripting errors in HISE but I am missing something.
              what could be wrong here?

              code_text

              inline function onResetBtn(control, value)
              {
                  if(value) // button is pressed
                  {
                      // This clears the sample folder setting
                      Settings.setSampleFolder("");
              
                      
                      Console.print("Sample folder has been reset. The plugin will ask for a new folder next time.");
                      
                      
                      Engine.showMessageBox("info", "Please restart the plugin or reload it to set a new sample folder.", "OK");
                  }
              }
              ResetBtn.setControlCallback(onResetBtn);
              LindonL d.healeyD 2 Replies Last reply Reply Quote 0
              • LindonL
                Lindon @jeffd
                last edited by Lindon

                @jeffd er.. doesnt that just give you an empty Link file? what you actually want in this approach is to have the link file deleted.

                You'd be way better off just asking (in the plugin) for the new folder...and replacing the current Link file value.

                HISE Development for hire.
                www.channelrobot.com

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

                  @jeffd As Lindon says, to retrigger the overlay you need to delete the link file entirely, not just change the path within it.

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

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

                    @d-healey can i delete the link file via a script?
                    not sure i understand.

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

                      @jeffd Yes, the file and filesystem API has what you need. Just be careful when deleting files.

                      6d3a983b-ae6a-4e1e-b05a-4285b5efaafe-image.png

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

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

                        @d-healey
                        isnt the link file going to be located in a different location for each operating system?

                        Is there documentation somewhere on how to get HISE to find the path in the operating system?

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

                          @jeffd

                          These should help

                          https://docs.hise.dev/scripting/scripting-api/filesystem/index.html#getfolder
                          https://docs.hise.dev/scripting/scripting-api/filesystem/index.html#special-locations

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

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

                          24

                          Online

                          1.9k

                          Users

                          12.5k

                          Topics

                          108.6k

                          Posts