HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansions Folder File Ref

    Scheduled Pinned Locked Moved General Questions
    14 Posts 4 Posters 443 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.
    • DanHD
      DanH
      last edited by DanH

      If I want a reference to a specific Expansion folder, how do I go about getting it? This will be outside of a plugin, so there won't be an active expansion and no expansion wild cards. I basically want an absolute path. Can I add to the code below or can I use fromAbsolutePath (seems like this is for getting a file rather than saving which is what I want to do).

      var ex = FileSystem.getFolder(FileSystem.Expansions);
      
      var ad = FileSystem.getFolder(FileSystem.Expansions/mynewexpansion);
      

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

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

        @DanH You can use .getChildFile() to get any file or directory within another directory.

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

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @d.healey
          last edited by

          @d-healey so it would be

          var ad = FileSystem.getFolder(FileSystem.Expansions);
          
          var bd = ad.getChildFile("mynewexpansion");
          

          ?

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

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

            @DanH
            Yes that looks correct.

            Until today I didn't know FileSystem.Expansions was a valid constant :) The docs need to be updated.

            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 it's not written in the docs but it is available as an option in the script editor's autocomplete menu (along with a few others IIRC)

              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

                it's not written in the docs

                It is now :D

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

                DanHD 1 Reply Last reply Reply Quote 2
                • DanHD
                  DanH @d.healey
                  last edited by

                  @d-healey I've been testing and I can't write a file to the Expansions folder in AppData so it looks like it's not suitable for my purpose here. I've ended up doing a rather long-winded way of getting to my folder in my expansion - is there not a better way?!

                  const AD = FileSystem.getFolder(FileSystem.AppData);
                  
                  const EXP = AD.getChildFile("Expansions");
                  
                  const NE = EXP.getChildFile("New Expansion");
                  
                  const SAM = NE.getChildFile("Samples");
                  
                  const f = SAM.getChildFile("New File.txt");
                  
                  f.writeString("aaarrrggghhhh!!!");
                  

                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                  https://dhplugins.com/ | https://dcbreaks.com/
                  London, UK

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

                    @DanH What's wrong with expansion.getRootFolder().getChildFile("Samples/New File.txt"); ?

                    DanHD 1 Reply Last reply Reply Quote 0
                    • DanHD
                      DanH @Christoph Hart
                      last edited by DanH

                      @Christoph-Hart I guess because I won't be in an active expansion. I'm making an installer for an expansion and trying to write the link file into the correct folder (without using HR1 files).

                      But can I just go

                      const EXP = AD.getChildFile("Expansions/New Expansion/Samples");
                      

                      ?

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

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

                        @DanH If the expansion doesn't exist, I would prefer your solution from above:

                        var ad = FileSystem.getFolder(FileSystem.Expansions);
                        
                        var bd = ad.getChildFile("mynewexpansion");
                        

                        The expansion folder might be redirected to somewhere else, so this might not work in every use case.

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

                          Also you can drop the samples of the expansion in the Sample folder and they will be loaded just fine, this keeps them all in one place.

                          DanHD 1 Reply Last reply Reply Quote 0
                          • DanHD
                            DanH @Christoph Hart
                            last edited by DanH

                            @Christoph-Hart said in Expansions Folder File Ref:

                            Also you can drop the samples of the expansion in the Sample folder and they will be loaded just fine, this keeps them all in one place.

                            Yep, but user feedback was very much that they want full control over where they are stored 😆

                            I created the expansion folder in the AppData/Expansions folder, but I couldn't write a file using

                            var ad = FileSystem.getFolder(FileSystem.Expansions);
                            
                            var bd = ad.getChildFile("mynewexpansion");
                            

                            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                            https://dhplugins.com/ | https://dcbreaks.com/
                            London, UK

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

                              @DanH getChildFile() doesn't write files. You need to use createDirectory()

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

                              DanHD 1 Reply Last reply Reply Quote 0
                              • DanHD
                                DanH @d.healey
                                last edited by

                                @d-healey I know I meant I can't get to the right folder using that code

                                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                https://dhplugins.com/ | https://dcbreaks.com/
                                London, UK

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

                                55

                                Online

                                1.7k

                                Users

                                11.7k

                                Topics

                                101.7k

                                Posts