@@ -63,6 +63,10 @@ public class LXPreferences implements LXSerializable, LXParameterListener {
6363 new BooleanParameter ("Suppress Live Output" , false )
6464 .setDescription ("Suppresses network output for local development" );
6565
66+ public final BooleanParameter oscQuery =
67+ new BooleanParameter ("Enable OSCQuery / Zeroconf" , false )
68+ .setDescription ("Enable OSC discovery with OSCQuery and Zeroconf" );
69+
6670 public final DiscreteParameter uiZoom =
6771 new DiscreteParameter ("UI Scale" , 100 , 50 , 201 )
6872 .setDescription ("Percentage by which the UI should be scaled" )
@@ -118,6 +122,7 @@ public LXPreferences(LX.Flags flags) {
118122 this .focusActivePattern .addListener (this );
119123 this .sendCueToOutput .addListener (this );
120124 this .suppressOutput .addListener (this );
125+ this .oscQuery .addListener (this );
121126 this .uiZoom .addListener (this );
122127 this .uiTheme .addListener (this );
123128 this .showHelpMessages .addListener (this );
@@ -141,6 +146,9 @@ public void onParameterChanged(LXParameter p) {
141146 if (this .lx == null ) {
142147 throw new IllegalStateException ("LXPreferences.onParameterChanged() invoked before LX instance was set" );
143148 }
149+ if ((p == this .oscQuery ) && !this .lx .flags .zeroconfForce ) {
150+ this .lx .flags .zeroconf = this .oscQuery .isOn ();
151+ }
144152 this .lx .flags .focusChannelOnCue = this .focusChannelOnCue .isOn ();
145153 this .lx .flags .focusActivePattern = this .focusActivePattern .isOn ();
146154 this .lx .flags .sendCueToOutput = this .sendCueToOutput .isOn ();
@@ -216,6 +224,7 @@ public void setSchedule(File schedule) {
216224 private static final String KEY_FOCUS_ACTIVE_PATTERN = "focusActivePattern" ;
217225 private static final String KEY_SEND_CUE_TO_OUTPUT = "sendCueToOutput" ;
218226 private static final String KEY_SUPPRESS_OUTPUT = "suppressOutput" ;
227+ private static final String KEY_OSC_QUERY = "oscQuery" ;
219228 private static final String KEY_SHOW_HELP_MESSAGES = "showHelpMessages" ;
220229 private static final String KEY_SCHEDULER_ENABLED = "schedulerEnabled" ;
221230 private static final String KEY_SHOW_CPU_LOAD = "showCpuLoad" ;
@@ -243,6 +252,7 @@ public void save(LX lx, JsonObject object) {
243252 object .addProperty (KEY_FOCUS_ACTIVE_PATTERN , this .focusActivePattern .isOn ());
244253 object .addProperty (KEY_SEND_CUE_TO_OUTPUT , this .sendCueToOutput .isOn ());
245254 object .addProperty (KEY_SUPPRESS_OUTPUT , this .suppressOutput .isOn ());
255+ object .addProperty (KEY_OSC_QUERY , this .oscQuery .isOn ());
246256 object .addProperty (KEY_SHOW_HELP_MESSAGES , this .showHelpMessages .isOn ());
247257 object .addProperty (KEY_SCHEDULER_ENABLED , this .schedulerEnabled .isOn ());
248258 object .addProperty (KEY_SHOW_CPU_LOAD , this .showCpuLoad .isOn ());
@@ -258,6 +268,7 @@ public void load(LX lx, JsonObject object) {
258268 LXSerializable .Utils .loadBoolean (this .focusActivePattern , object , KEY_FOCUS_ACTIVE_PATTERN );
259269 LXSerializable .Utils .loadBoolean (this .sendCueToOutput , object , KEY_SEND_CUE_TO_OUTPUT );
260270 LXSerializable .Utils .loadBoolean (this .suppressOutput , object , KEY_SUPPRESS_OUTPUT );
271+ LXSerializable .Utils .loadBoolean (this .oscQuery , object , KEY_OSC_QUERY );
261272 LXSerializable .Utils .loadBoolean (this .showHelpMessages , object , KEY_SHOW_HELP_MESSAGES );
262273 LXSerializable .Utils .loadBoolean (this .schedulerEnabled , object , KEY_SCHEDULER_ENABLED );
263274 LXSerializable .Utils .loadBoolean (this .showCpuLoad , object , KEY_SHOW_CPU_LOAD );
0 commit comments