How Can I Make Custom User Presets Extension



  • @ulrik I should say that in the first post I forgot some code so now it's updated, sorry about that



  • @ulrik Fantastic.. πŸ™‚
    Thank you



  • @ulrik You can browse directories with the File System API.



  • @d-healey Really? Is it newly implemented?
    That is great news, I have to dive right in and explore, I realise I've been away much too long from Hise, thank you David! πŸ˜€πŸŽΆ





  • @d-healey Yeah, I see now.
    I'm trying it out at the moment and I'm not able to set absolute path to the UserPresets folder, I need that to check if there's any presets in that folder, and I mean presets with different extensions like ".mix" or other...
    is it possible? I only find "set start folder"



  • @ulrik

    FileSystem.findFiles(var directory, String wildcard, bool recursive)

    so to get to the directory use:

    FileSystem.getFolder(var locationType)

    location types :

    AudioFiles The audio file folder. In HISE it will be the repo folder, but in the compiled project it will be a sub folder in the appdata folder.

    Samples The sample folder as specified in the settings (or the subfolder of the HISE project during development).

    AppData The app data directory. This is the main directory for your project which will house the configuration files and user presets.

    UserHome The user home folder.

    Documents The user's Document folder.

    Desktop The user's desktop folder.

    Downloads The user's download folder.

    so (guessing this would work)

    var appD = FileSystem.getFolder(AppData);
    var myDir = appD + "\User Presets";
    var myList = FileSystem.findFiles(myDir, "*.mix", false);
    


  • HiseSnippet 898.3ocsV01iSaDDd2bwThoAUj3GfU9jSUHxoEnUfP.I2kpn16HBCn9kVzF6MWVcq20x65ChNc+m4e.c1cchcJADDI7WhmWdF+LyNyrYdgLgpTxBDtyqVmSQ3ezKdsPuZxJBSflcLBeauSIJMsHvoZ75bhRQSQX7Q+gQAtSaj84COcLgSDIzZUHzajrD5ewxX5Zsye1ex37ojT5qXYM799OaVhTLQxkk.eNxKBkSRtfbN8LhwsVdH7MNIkokEwZhlp.eFKSWGuR9Ngy+2vTrEbpQXDJFBjSMZxJFOc9lbUgP31yqy7ibY9c8Nkkx1putB7SVCA0HZVCvs1kRs2gRi9bTZpjmZBvmgd3Fzqsid2wKNofkqqsX31s7lIfCmkDnr2jVNeQs9mVdSjfGB8vLxEzoEfvVDgOLJZPvChh5+3t9c8ghuRGbIoHfjmeLQSrjrH3IASYbZ7ZnKHa34TsScXCkO24uIL0AIufpnZ01frSPMwwl1lnD160Jvk4N.8brgI3LAMXYoHQyjh.oXgVLtP9NE0jQERdXhLKWJfba.7A4kz9c8upqemFDag0+vcnxffkDthNHn2O2av13GtDP0Onqe.7bk6GyC7sTRNcXdASnsNMTKi0fz4g8lVx4yI5U852+wVDWa390V9uoraRzM7Lr21bnW+gJiEalLgv4Kfd8vOMIMArQM3Lol9BQXe+q763esev+2zxk60VUv3vw19LalCK9R.CEkYKLkNWcdiiPy4tc+23qq6OwUaZ3nTLSvzuHmVIWOeLZOyGnphK71qmYZpLiLU5.+xoEZlgN3ioWB6ebCPc7NlptPKys9Vchfv+f1Z81UiWiK0Zo.wRMyVaOLPuGg8vOB9dqMu7uvKZ56Az2zqxAE4R5LgqE1L.xTmJyfO.o.Pfag9zAZXshLsjSz6tqwrTsx.bDryPsYvUnX50MW59Mr.JZuKf1aA9qjt2waNSmrZ+7s0d3KbP88luUqy65cxxkzDcMYa6M8uOzc2eCT4kxRMrc3TBrjvz1bVYVLbiVBEXhPP4JSGTKSSrSNxHapLwTQpU3ivSkwQFYbkwQaLhxHIEx2l3FNMWXbSqFfSB6ckcfKsA4fQH6.KfyKZXDJCtG6sIIlRw8.tueL+xAf4WO.L2+.v7fC.yCO.L+1Af42+hXL+EhmWpkYtwDPw7Sratv3SDDnKy1Qh9OYLTpIAοΏ½
    

    Seems Lindon got there before me πŸ˜›

    Edit: Actually Lindon's method won't work, that's what I tried first. You can't pass strings you have to pass file objects.

    const var appDataFolder = FileSystem.getFolder(FileSystem.AppData);
    const var presetsFolder = appDataFolder.getChildFile("User Presets");
    
    const var fileList = FileSystem.findFiles(presetsFolder, "*.mix", true);
    
    for (f in fileList)
    {
        Console.print(f.toString("FullPath"));
    }
    


  • @d-healey @Lindon
    Thank you both, now I get it πŸ™‚



  • @d-healey Tried your Snippet but unable to load my custom User Preset Extension (*.tania) to Preset browser. What am I doing wrong?

    No PB.gif



  • @Tania-Ghosh -er its not going to load a preset is it? its going to load a JSON file - which you are going to have to read thru and apply yourself in the code - so you will need to build a custom preset panel - if i understand it correctly.



  • @Lindon Ok... Got it. πŸ™‚



  • @Tania-Ghosh After that Lindon and Healey explained the, for me, new implementation of the FileSystem I've been spending some hours on this and I wrote an example if it could help?

    HiseSnippet 2613.3ocuZs0baabEFPVHwj1Lw1woOugSmNTwxzTxxocFW6PIQpVNVRTifjS635j.BrTbsAA3.rTxLZzLY568WPeo+T7Oj9P+AzGx64A0ytKtr3FIEsUg83wXuc91y46bYWhC7bMw99tdJpkNZxHrh5s0zm3PGr8.ChiRmVJp2SS23TL5XerG5.OrOlpr0jQF99XKEU0a7mXiSszxJ7me4a2xv1vwDG2jhxKcIl3cICIz3VOn4KH116XXgOhLTZzazrioqy1t1tiALcCsFJiLLeqwI38MXCaIME0OosEg55oSMnXeE0k2x0Zh9.2ybDi+kDeROaL6k0TzgERz7Nt1VLDyZUY6ADaqCB269JvpbPrl3FBMw801iXQhZOVibGdGn3YHqOTWZZvaMY30X9gmpD7VV.u6poa5QFQi6ggsao0wgh85a.l.YXIFqxR+x8011EFgCs9Pi2h2wCdIZF09lFMVE8jFMV4oUJK9yidDB0BaZa3YPItN9H34gy3oRYvD5SQmZDxX74rmmgBE8IX51tCG45.uTqpzXpxjb5YyL8ywBDNrpBzGuJvj5S7Fx2.GX3fsKbgxLR9Zko05fzpU8Tgkr5pn9F193oI0c6MexDFW0PcOSyGMLeD0EAREY3Xgf4CRvdL1G02ycXQVjjfIZgdF5UymVb0JkQE7j+BrE0YsEaZquXS6wK1z1XAl1Kb5s1hMs0WroA6sWmhQQbHTgQhYDq9PdCnGBDvFY+qXx.IRGFNc.FUkM5pgDGfNYXaiLi4E9trgMA43RQmAwlQ8vnwNV39DGrE5rAXGjO0viRbNAAhsuqGeYAtK.OJDDuRYnsZD.aMdJhf9iRjt51XmSnCflevCVoR4yE5i39eE40LepWxvVs3sIz7JOs7Ew9CGABbGhMVehOECD+m8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4kmNatBkuL.mzphc+57pL4x+gn0T4RyTWRwa8aoEcU3EFL++ya+aF.ob2UooBEva9yYxnUtnLZ2UK0shM2GjKGhcq4SOjW8Px0YHTD+Fsf65BNsLM523RQI6Wfzcz1y0ZrsAM4GGE6KBKnCPzI9JjXeoQN9D5D4uXrqkuXp4Et2U6.B0bP93cobvK3deci2fu+rJZs62GaRiA6xZ67Wt9+XyTNzcL62maOCpGAXkZ6OdnNPxMw.Rb.hD6RTTWhQzEu2HLvmN1wh+ByuIny0XuqFz4ZgcpLzvzy8GLEWcC6Kb6l7V.L4v+P+JosG6czZJ7qyAlmVi5MTFRrH+foISU7P.64Om0Wf473EXNar.y4IKvb9lEXN+9EXN+goNG1273liothHJfAcuCZyuiKU01NrPHbFox+Cf2OwUO
    

    I should say that this will only work if there is a folder named "User Presets" in the Users AppData folder.

    @d-healey is it possible to create a folder with this File System functions? I can't find anything about that in the docs?



  • @ulrik I think it's read-only, except for JSON files.



  • @d-healey Ok, thanks!



  • @ulrik Oh My God.... Amazing.. wow.. Thank you so very much. It is a New Year gift.

    πŸ™‚



  • @Tania-Ghosh I'm glad if it could be of any help, I had to learn it and document it for my self so why not share?



  • @ulrik I updated my test with saving, loading and deleting a preset via the OS dialog.

    However when deleting via OS dialog, on Mac it will say "Open" when it actually will be deleted.
    I don't know if it's possible to change the default OS dialog window text, anybody know?

    HiseSnippet 2893.3ocyaszbabbDdWJt1BfF1RJ1UpT4xXT4AnEEEHkrSpRVRfj.LAQjhrHnXEWJx1K1c.wHtXWjcGPJXUrJU4d9EjKoJ+GQ+Pxg7CHGxEcRGX5Yl8wru.VBRVwPuHlY5o+lt+5tmY1U655Xf87bbUTKs+3gXE0ORqyXaZ+M5qSrUZ2TQ8VZczOFidlG1EsqK1CSUVe7PcOOrohp509CrwoVZdE9m+6iWW2R21.G0jhxANDC7VjADZTq613IDKqM0Mw6SFHM562nsgi8FNVNi.LcMs5JC0MNR+P7S0YCaNME0OnkIg531gpSwdJpyuti43N8cNwV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