ScintillatorSynth / Scintillator

A Video Synthesis Engine for SuperCollider
https://scintillatorsynth.org
56 stars 8 forks source link

Fix some server boot issues #97

Closed jrsurge closed 4 years ago

jrsurge commented 4 years ago

Purpose and motivation

Previously, ScinServer created the ScinServerStatusPoller during init, and created its NetAddr while booting. This meant that unless you booted immediately, the status poller would error, trying to poll nil.

Additionally, if the server failed to boot, the status poller would remain in a state of booting. This meant that it was impossible to boot after an error.

Implementation

This PR moves the creation of the NetAddr into the init method, ensuring it is available from the start.

Additionally, when the server fails to boot, the status poller is now notified that serverBooting is false.

With this PR, users can use the following style (as with SC audio server):

v = ScinServer();
v.options.width = 400;
v.options.height = 300;

v.boot;

And if it fails, options can be modified and boot called again:

v = ScinServer();
v.boot; // assume failed: no vulkan devices available
v.options.swiftshader = true;
v.boot; // ok

Types of changes

Checklist