xiphonics/picoTracker

Replace config.xml with a device settings screen

Opened this issue · 5 comments

maks commented

We want to move away from using config.xml to make all device settings configurable via UI on device.

To do this we would want to have a device settings screen.

Based on comments in discord, it would be good to also be accessible without needing to first open a project.

💯 Agree with this, I keep wanting to have a general Settings page for those settings that reach over the app vs. project.

I don't think we need to get rid of config.xml however xml reading/writing is quite processor heavy and I think there are probably better formats.

I do prefer to keep the settings file on the SD Card, because that makes more sense, also allows users to back them up or share their settings instead of keeping them in flash.

Also would prefer to keep as much out of flash due to the limitations we currently have.

I might mock up some ideas for Settings here (including location, accessibility, etc)

maks commented

@shockdesign Well for me the pro to having config.xml is its human readable/editable but otherwise theres lots of cons like the code it takes to support reading/writing xml and ram usage (even using SAX) and really once you have a UI and say store in a binary format you can still export to a simple binary format for backups/sharing without needing to keep a "heavy" format like xml.

The question of where to store flash vs sdcard is an interesting one! To me it makes sense to store on flash but I'm not strongly opposed to being on sdcard either as currently its not possible to use a device without a sdcard installed.

I think before mocking up a UI, the more important thing is to decide on a implementation for device settings, the question of where its stored, data format, etc. TBH for me the UI layout is the easiest & last piece to work on for this task.

@maks I love the idea of a human readable/editable config... but I think there are better options for text parsers than XML.

A binary file could work, but yes, becomes very propriety and harder to decipher.

Just realised that the project save files are XML too, so if we want to go through to the process of implementing a lightweight parser, we might want to the change and convert the save files (whether thats another simple Python parser).

If we're going to have to support XML as a format going forward tho, then we might as well keep that.

@democloid Thoughts? Should we try and remove the XML parser and change the format of the save files to streamline things better for the Pico?

I can't find a compeling reason to remove the parser or change the format. I'm no XML lover, but it works and it's open, which is important. The way it's implemented is also pretty nice in that each component saves it's own configuration and appends it to the final file, so it should be pretty easy to support saving and loading instrument settings for example. Memory wise I don't think that it's a bit offender, should be pretty efficient.

On the down side, a malformed file may crash the device, but that's a problem of the implementation, not the format.

In terms of config save I strongly believe it should go into the flash. But I could see a reason to want to at least export it if the config gets more complex.

To the mention that the device requires an SD card anyway, what if it didn't? not super high pri, but would be nice to me to be able to turn on a cardless device into a new project and be able to use factory samples and whatnot for an ephemeral experience 😀

maks commented

Yes good points all round. I keep forgetting about project files being in xml, so yes, no sense to replace it and Ive got lots more interesting things I'd like to work on so no real motivation to replace the xml support with anything else, so I take back by suggestion for a alt binary format for storing config either.

That perhaps points to a first iteration of the device settings: as just exposing existing editing & saving config.xml settings.

Finally its a great suggestion to be able to run without the sdcard, it would be handy especially once there is synth support, but I dont think its essential to work on straight away so my suggestion is to initially keep config.xml on the sdcard with a new device settings screen to edit it and its then trivial to later move to saving it into flash instead.
Any thoughts on something I may have missed with this plan?