GuitarML / SmartGuitarPedal

Guitar plugin made with JUCE that uses neural network models to emulate real world hardware.
https://www.facebook.com/smartguitarml
Apache License 2.0
264 stars 24 forks source link

Add user application data directory to JSON model paths #7

Closed usdivad closed 3 years ago

usdivad commented 3 years ago

This PR adds the user application data directory to the list of paths to search for when loading JSON models as dropdown choices, with the goal of addressing #3. Specifically, the plugin will search for <userAppDataDirectory>/GuitarML/SmartPedal, based on the plugin manufacturer and plugin name set in the project .jucer.

The plugin will automatically create (and delete) a temp file in the directory if it doesn't exist yet, so that users don't have to manually create the directory -- however, users will have to reinstantiate the plugin after adding model files to the directory for those models to show up in the dropdown.

SmartPedalAudioProcessorEditor::modelSelectChanged() has also been adjusted to use selectedItemIndex instead of selectedText, in order to work with paths that aren't in the current working directory.

Potential further TODOs:

GuitarML commented 3 years ago

Thanks for the PR! Seems to fix the issue and also a good idea to have a common area for models.