sooperlooper
sooperlooper copied to clipboard
Feature Request: add "Load Default for ..." and "Save Default for ..." to right-click menu for all CheckBox and ChoiceBox and SliderBar
I propose to add "Load Default for ..." and "Save Default for ..." to right-click menu for all loop controls so looks like:

I suppose for simplicity of code and generality I will make this apply for all controls made with class CheckBox and ChoiceBox and SliderBar, so would apply for both per-loop controls as well as global top-panel controls.
This sounds like a reasonable design
I notice the current preferences files in /home/user/.sooperlooper are default_midi.slb which works in headless and GUI mode, and gui_config.xml which is only for GUI settings...
I'm thinking for my feature request I would want any new default settings to work in headless mode as well as GUI mode, so I won't put them in gui_config.xml and rather I will instead create a new preferences file (default_values?) for them, and I would probably start by copying /src/midi_bind.hpp/cpp and trim it down to just the functions load_bindings, save_bindings, save_bindings, get_bindings, add_binding (and rename from midi/bind to "default_values").
I think I would use the strings used for the add_input_control calls in command_map.cpp which map to the Event::control_t enum so every row of that file is a string of any new defaults that get assigned and their new value.
And I guess new looper would get their values set in Looper::initialize() and I think the global ones would get set in Engine::initialize() so I'll check for an entry for those corresponding private variables there and assign it then.
And then I think on gui code mianly just need to have CheckBox and ChoiceBox and SliderBar class get an additional event enums ID_LoadDefaultMenuOp and ID_SaveDefaultMenuOp which get set just like ID_BindMenuOp does with bind_request signal.