Store values in ScriptPanel data object
-
@toxonic I'm not entirely sure of the question but I think your answer might be here - https://docs.hise.audio/scripting/scripting-api/filesystem/index.html#special-locations
-
@d-healey ahh, okay! Is there a way to embed the textfiles with the stored parameter values in the compiled binary? I mean, i don't want the end user needing to care about the correct location for the files in order to get the compiled plugin working properly.
-
@toxonic Just include them as scripts
-
@d-healey Okay, i didn't know, that this works. Actually, the files are saved in the UserPresets Directory.
- Do the files need a special filexetension, like
.js
? - Can i pass the path in the include statement? Soemthing like
include ("./UserPresets/filename");
or do the files then need to be stored in the
Scripts
subfolder in order that HISE can find them?- Can the content of the files be modified, when the the plugin is compiled, so that the user can change the "presets" ?
Sorry for all these questions, but i never used includes for anything other than external scripts...
- Do the files need a special filexetension, like
-
@toxonic They will need to be js files and they need to be in the Scripts folder. The content can't be changed because they are part of the plugin. If you want the files to be separate then you need to find a way of including in one of the appData folders.
-
@d-healey Okay,thank you for your quick response!
How will the AppData folder be created? When i compile a plugin i usually only find the compiled binary. Is there any information on that topic out there? -
@toxonic That folder is created automatically when the plugin/standalone runs the first time. If you want to put files in it then you'll need to build an installer that creates the folder and puts the files there.
-
@d-healey uhh, that sounds complicated...
-
@toxonic Yup :)
-
If these are standard HISE preset files though (.preset) then they will automatically be in the appData/User Presets folder.
-
@d-healey so, could i just change the file extension to .preset ?
-
@toxonic I doubt it
-
@d-healey Mhh, i compiled the plugin for testing purposes, but i cannot find the appData directory. Where is the place, i should search for?
I build a vst3 fxplugin and put the dll to my standard vst3 folder. It works fine so far in the DAW (except the preset issue), but i there's no appData directory created after the first launch. -
@toxonic
appdata (in windows) is atC:/Users/<your name>/AppData
-
@Lindon Well, I'm on Linux, but I'd assume, that it should be in my home directory (analogue to windows) - but there's no
AppData
directory.... do I need to check any options in the HISE settings? -
@toxonic David is your UNIX guy...
-
@toxonic
/.config/company name
-
@d-healey Ah, thank you! :-) So, on Linux there is no
AppData
directory?
The folder/.config/My Company/Plugin Name
contains (among others) aUser Presets
directory, and surprisingly, it transferred the text files which I gave the.preset
file extension, but the content of each file isnull
... -
@d-healey Okay, i just changed the preset file names, at the moment they have no file extension.
Everything works fine in HISE, but not the compiled plugin. It sets up all the needed files in the AppData Directory (or whatever I should call it on Linux... ;-) ) , but changes of parameters won't be saved to the preset files. What am I missing?
I use the following functions to store and recall values from the preset files:var PresetDir = FileSystem.getFolder(FileSystem.UserPresets); // store inline function writePreset (FILE, ARRAY) { local PresetFile = PresetDir.getChildFile(FILE); PresetFile.writeObject(ARRAY); } //recall inline function recallPresets (FILE) { local PresetFile = PresetDir.getChildFile(FILE); return PresetFile.loadAsObject(); }
-
@toxonic AppData is just the generic name, it's actually only on Windows that it's called appData