HISE Logo Forum
    • Categories
    • Register
    • Login

    Feature Request:Data Folder

    Scheduled Pinned Locked Moved Feature Requests
    44 Posts 4 Posters 2.3k 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.
    • Christoph HartC
      Christoph Hart @d.healey
      last edited by

      @d-healey No you need to implement this yourself.

      const var dataFile = FileSystem.getFolder(FileSystem.AppData).getChildFile("MyData.json");
      
      const var initialData = { "Something": true };
      
      if(!dataFile.existsAsFile())
      {
          dataFile.writeObject(initialData);
      }
      
      LindonL d.healeyD 2 Replies Last reply Reply Quote 0
      • LindonL
        Lindon @Christoph Hart
        last edited by Lindon

        @d-healey -yeah its a right pain to have to do every time you want some data shipping with you product ...

        @Christoph-Hart - whats this?

        .existsAsFile()
        

        HISE Development for hire.
        www.channelrobot.com

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

          @Christoph-Hart If I put data files in the UserPresets folder I can access them with Engine.loadFromJSON() can't I? This has been here long before the File/FileSystem APIs.

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

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

            @Lindon sorry, meant isFile().

            If I put data files in the UserPresets folder I can access them with Engine.loadDataFile() can't I?

            Yes, but that's ancient and useless. :)

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

              @Christoph-Hart lol How about redirecting the ancient and useless function to the additionalSourceCode folder so it works the same as it does for expansions? :) Then I don't have to mess about with post install scripts and the file/filesystem api.

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

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

                @d-healey no. AdditionalSourceCode is additional source code that gets compiled. Why would I include that folder into the binary?

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

                  @Christoph-Hart said in Feature Request:Data Folder:

                  @d-healey no. AdditionalSourceCode is additional source code that gets compiled. Why would I include that folder into the binary?

                  Hmm I'm thinking of how it works for expansions where we can put any files and access them with the .loadDataFile function. We don't have anything similar when not using expansions.

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

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

                    @d-healey yes but this is because expansions can‘t contain scripts so it‘s a fallback solution.

                    LindonL 1 Reply Last reply Reply Quote 1
                    • LindonL
                      Lindon @Christoph Hart
                      last edited by

                      @Christoph-Hart -- but it would be a convenience and nice to have -

                      HISE Development for hire.
                      www.channelrobot.com

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

                        @Lindon I think it's one of the cases where there's not one single use case and then you'll end up nagging me with feature additions or changes to a system that I don't use myself so it gets broken regularly. Especially since the File API gives you full flexibility with a little more housekeeping that you have to do for yourself.

                        LindonL 1 Reply Last reply Reply Quote 1
                        • LindonL
                          Lindon @Christoph Hart
                          last edited by

                          @Christoph-Hart said in Feature Request:Data Folder:

                          @Lindon I think it's one of the cases where there's not one single use case and then you'll end up nagging me with feature additions or changes to a system that I don't use myself so it gets broken regularly. Especially since the File API gives you full flexibility with a little more housekeeping that you have to do for yourself.

                          well yeh I get that, and in passing if you thing we will all stop nagging you about something for ever, then who are you and what did you do with Christoph?

                          But still I'd have thought it a simple (and all encompasing) requirement/feature/use case:

                          All files in ../DataFiles will be included in the plugin in exactly the same way as samplemaps...

                          HISE Development for hire.
                          www.channelrobot.com

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

                            @Lindon But what is the benefit over including it as script?

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

                              @Christoph-Hart In my case I have "theme" files. Each one is list of every component on my UI with various properties/values. Depending on which one the user selects that gets loaded and the values are applied to the components. I could include these in the script but since they are not doing anything logicy it would just be adding bulk - does this have any impact on performance?

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

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

                                @d-healey Parsing kilobytes of JSON data takes a few milliseconds so unless you let the user define every pixel on your interface, you should be fine.

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

                                  @Christoph-Hart Ok you've convinced me, I'll just include them as scripts. :)

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

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

                                    @Christoph-Hart said in Feature Request:Data Folder:

                                    @Lindon But what is the benefit over including it as script?

                                    simplicity only.

                                    HISE Development for hire.
                                    www.channelrobot.com

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

                                      @Lindon said in Feature Request:Data Folder:

                                      @Christoph-Hart - whats this?

                                      .existsAsFile()
                                      

                                      That's a JUCE/C++ function to check if a file exists. https://docs.juce.com/master/classFile.html#a2d79c296f148b00041aeeac0013716d9

                                      The HISE script version is File.isFile(); and File.isDirectory()

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

                                      LindonL 1 Reply Last reply Reply Quote 0
                                      • LindonL
                                        Lindon @d.healey
                                        last edited by

                                        @d-healey said in Feature Request:Data Folder:

                                        @Lindon said in Feature Request:Data Folder:

                                        @Christoph-Hart - whats this?

                                        .existsAsFile()
                                        

                                        That's a JUCE/C++ function to check if a file exists. https://docs.juce.com/master/classFile.html#a2d79c296f148b00041aeeac0013716d9

                                        The HISE script version is File.isFile(); and File.isDirectory()

                                        yeah thanks. those Hise commands I already know..

                                        HISE Development for hire.
                                        www.channelrobot.com

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

                                        22

                                        Online

                                        1.8k

                                        Users

                                        12.0k

                                        Topics

                                        104.8k

                                        Posts