jean-emmanuel / open-stage-control

Libre and modular OSC / MIDI controller
https://openstagecontrol.ammd.net
GNU General Public License v3.0
695 stars 88 forks source link

remote control: Add `/SESSION/CREATE` command #852

Closed matthijskooijman closed 3 weeks ago

matthijskooijman commented 1 month ago

This allows creating a new empty session. This is useful for projects that want to dynamically create the entire session using a custom module.

Without this, you can also create an empty session json file and load that with --load, but then you would have to manage that file, and if you accidentaly press control-s, it gets overwritten to contain any dynamically created widgets.

With this commit, such a custom module can just create a new session on startup and then populate it. This takes a bit of fiddling to get the order of events correct, this commit also adds an example showing how to do this.

Note that the example added by this PR uses the reload() function introduced by #851, so best to merge that PR before this one.

jean-emmanuel commented 3 weeks ago

Merged. I added a line make it ignore unsaved changes. Thanks !

matthijskooijman commented 3 weeks ago

I added a line make it ignore unsaved changes.

Ah, good catch, I had not tested that :-) Thanks!