HISE Logo Forum
    • Categories
    • Register
    • Login

    Button for "Change Sample Folder Location" out settings?

    Scheduled Pinned Locked Moved General Questions
    settingssample folder
    14 Posts 3 Posters 842 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.
    • trillbillyT
      trillbilly @d.healey
      last edited by

      @d-healey

      Awesome, thanks!

      So this part looks like what Im looking for, and it compiles correctly, but how do I add a button to test? I did the obvious dumb mistake and tried to put an inline function within another.

      	inline function createLinkFile(expansionName, target)
      	{
      		local linkFile;
      
      	//Find User OS
      		switch (Engine.getOS())
      		{
                             //Determine AppData File to locate
      			case "OSX": linkFile = "LinkOSX"; break;
      			case "LINUX": linkFile = "LinkLinux"; break;
      			case "WIN": linkFile = "LinkWindows"; break;
      		}
      
      	        //Locate AppData folder
      		local appData = FileSystem.getFolder(FileSystem.AppData);
      
              //Here is where I would want to open the folder, yes?
      		local f = appData.getChildFile(linkFile);
      
      		if (isDefined(f) && isDefined(target) && target.isDirectory())
      			f.writeString(target.toString(f.FullPath));
      	}
      
      d.healeyD 1 Reply Last reply Reply Quote 1
      • d.healeyD
        d.healey @trillbilly
        last edited by

        I just re-read your post. I misunderstood what you were trying to do.

        This should do it

        HiseSnippet 835.3ocsU81SSCDF+tAEsSkHI9AngWP5RvkMEQSHFwswLKxfEKR7cjiqWYW35cMWuhtXHwOZ9d+x32.84ZKrBrfvRrYYoO+8987bO+d5HshxRSUZD18fIILD9wNASjlwcGS3RzfdH7xNCIoFl1qPUmIIjzTVHBiW3CVEX2EQ4O+9ccHBhjxlpBgNTworc4wbyTsi19ibgnOIjc.Oth2ar8.pR1UITY.dVvoEJgPOkbBaOh0sZNH7R6DxMJcfgXXofOcTgSBFq9prv+C4o7iELqPaT.jnB0nti4hvQWTqoHDdwQSq7EJp7m4LjGxuT+zNvSyM3MMhp8.bsaCRsuGPBWARKV.oUbBnZdhYpEKddjy.IbgDQfVcUnT3Kp1uvNcUfGRSyXxor9ZP3xH72rUq08f+ZrU8504RAWx7hxjTCWI8TxNYFiR11l.sR3SUwIJIjp08NiHxXMp+85t7HO+RIWPzUnnDgWHW68Vu9bAKXBLvD27DlouRDxz9UTFPhSDrzFa4BAB+r4hm1iEA3HzGxQCu0VylqlfVtlQgd6D+FvI45Z0lBsVe.6tm6V+bnDtnRgCq6EX0e0xpX0FMSs5yqktDg3XXfx+5EIjsJMf8TF19R+7Bs9408ttonnYZqLWBnZmkY6jt91BzWlEeLSWsMacDFEt570R2s4KZQaohiJ4.I2reBqTN+pIr38aNMhJ6qvaedPOhgXGPK0A9kvzFtEN3dry.Fdw3pqSOV5oFURtukWFH7CL4VWtbXtn4i3g1.JuIPe6x0.+HZ6IWJ7yS1lmNTEC4gnA03ZLIAJWKgbWFQKsy8ojyXCjizL3t1JitIQBnvpvLAwbUdscAVoA3x3JjIKgQlxMSptf6dP1acqj86JDWwYD2PGOaLVaFXDtl9efwxUjOwYmnHfRNEfK5z+Ky69v+ww+IUlgKOYHwn4v3gydYwAvWFnL3zkRl.RtCtlcTsPtkU11ABXxvbg+.OkFaakwkFaegQTLgpUGQKnf1kvOLWCfIY92bbgO9AxdsQ4zRHNmVMaghgwuinTa4+bf8L6XdwbDyKmiX1XNh4UyQLaNGw754Hl2bqwXY9uOynhKnCfhQ6jueBi2Ie0P9TH5uCTyaB.
        

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

        trillbillyT 2 Replies Last reply Reply Quote 1
        • trillbillyT
          trillbilly @d.healey
          last edited by

          @d-healey Got it, thank you!

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

            @d-healey Is there a way you can use this and still change the sample folder location?

            Matt_SFM d.healeyD 2 Replies Last reply Reply Quote 0
            • Matt_SFM
              Matt_SF @trillbilly
              last edited by

              @trillbilly to let the user change the sample location (outside the settings) you'll have use the FileSystem API and FileSystem.browseForDirectory.

              You'll have to thank @d-healey again :) : https://www.youtube.com/watch?v=ddodaOOFXik

              Develop branch
              Win10 & VS17 / Ventura & Xcode 14. 3

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

                @trillbilly said in Button for "Change Sample Folder Location" out settings?:

                @d-healey Is there a way you can use this and still change the sample folder location?

                What do you mean exactly? My original answer give you a custom solution to changing the sample location, but I'm not sure if this is what you are asking...

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

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

                  @d-healey Yes, A button on UI that changes the sample folder location.

                  The first code you showed I thought was it but when you sent the 2nd one, I thought maybe I was looking at it wrong.

                  The 2nd Snippet you showed opens the folder location, but from what I understand, when you click the "Change Sample Folder" button in sttings within hise, it tells you something along the lines of "This can only be done in an exported plugin". So I assume it only shows the location and doesnt change the file path.

                  I think I'll have to follow your video @Matt_SF provided and start there.

                  Matt_SFM 1 Reply Last reply Reply Quote 0
                  • Matt_SFM
                    Matt_SF @trillbilly
                    last edited by

                    @trillbilly when doing that from the settings in the exported plugin, it will open a browser asking to point to the *.ch1 files your plugin is using. Then it automatically update the 'LinkOS' file.

                    If you want to do this from outside of the settings panel, you'll have to script the same process yourself, using the File / FileSystem API.

                    Develop branch
                    Win10 & VS17 / Ventura & Xcode 14. 3

                    trillbillyT 1 Reply Last reply Reply Quote 0
                    • trillbillyT
                      trillbilly @Matt_SF
                      last edited by

                      @Matt_SF got it. So maybe the better question is can I customize the "button" within the settings panel for this? Possibly by using any image?

                      Matt_SFM 1 Reply Last reply Reply Quote 0
                      • Matt_SFM
                        Matt_SF @trillbilly
                        last edited by

                        @trillbilly ah, for this you want to use global laf

                        Develop branch
                        Win10 & VS17 / Ventura & Xcode 14. 3

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

                          @Matt_SF You can use local laf I think

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

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

                            @d-healey oh? Didn't know that

                            Develop branch
                            Win10 & VS17 / Ventura & Xcode 14. 3

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

                            17

                            Online

                            1.7k

                            Users

                            11.9k

                            Topics

                            103.6k

                            Posts