Closed JWahle closed 3 years ago
1) is easy but I agree it sucks. 2) isn't so bad, you just have to configure a different port for the validator-camilla. 3) is a nicer solution, but I don't think it's worth implementing because it would only be temporary. I have other ideas that I think would give a much better user experience. That little text box showing the error is better than nothing, but I wouldn't call it good!
The reason that the gui uses the camilla process for validation is just that it was an easy way to implement it. The problems are that it can only report one error (the first it finds) and everything that would prevent the config to run is an "Error". I don't want to overcomplicate the validator inside camilladsp, so the validation for the gui would have to be done separately. This is my vision:
Each gui component should validate it's own fields. That way they can give immediate feedback. Here is a mockup of how it could look in a Mixer:
pyCamillaDSP should learn to validate the config and return a list of Errors and Warnings. It should also fill out the defaults. An error would be stuff like adding a filter to a channels that doesn't exist. A warning would be for example if it can't read the FIR coefficient file. That could easily happen if the gui is running on a different machine than camilladsp, then the coeffs may not be available or at a different path.
The validation that CamillaDSP does it essentially four separate steps (but steps 1-3 are completely handled by the Serde library): 1) Check that the file is valid yaml - very easy to do in Python 2) Check that it follows the camilla format - probably best done with a json schema 3) Fill out the missing values with defaults - a bit boring but straightforward 4) Run through a series of checks of the values in the config - the existing Rust code should be translated to Python.
The gui should by default produce output that always passes 1&2. Then the internal checks of the gui should prevent most errors in step 4. This whole thing will take some time to implement. I think it's good to do something simpler for now, and your option 2 seems like a good compromise.
Sounds reasonable, I'll try that. Thank you for the detailed answer :+1:
As mentioned in https://github.com/HEnquist/camillagui-backend/pull/9#issuecomment-762517607, I would like to make the GUI work without a running CamillaDSP process.
Currently, a running CDSP process is needed to:
I see 3 solutions to make this work, if there is no running CDSP process:
I prefer solution 3, but if you want the defaults to be supplied by CDSP, I would leave the implementation of the CLI changes to you.
Do you see another way of doing this? Which solution do you prefer?