Package heronarts.lx.osc
Class LXOscEngine
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.osc.LXOscEngine
- All Implemented Interfaces:
LXPath,LXSerializable,LXParameterListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enumclassclassNested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final Stringstatic final intfinal List<LXOscConnection.Input> final BooleanParameterfinal BooleanParameterfinal List<LXOscConnection.Output> final BooleanParameterfinal TriggerParameterfinal StringParameterfinal DiscreteParameterfinal EnumParameter<LXOscEngine.IOState> final BooleanParameterfinal TriggerParameterfinal StringParameterfinal DiscreteParameterfinal EnumParameter<LXOscEngine.IOState> final BooleanParameterfinal BooleanParameterFields inherited from class heronarts.lx.LXComponent
childArrays, children, internalParameters, KEY_CHILDREN, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_INTERNAL, KEY_PARAMETER_PATH, KEY_PARAMETERS, KEY_PATH, KEY_RESET, label, legacyInternalParameters, legacyParameters, lx, modulationColor, modulationControlsExpanded, modulationsExpanded, parameters, presetFileFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInput()addInput(JsonObject inputObj, int index) addInput(LXOscConnection.Input input) addInput(LXOscConnection.Input input, int index) addIOListener(LXOscEngine.IOListener listener) addListener(LXOscListener listener) addOutput(JsonObject outputObj, int index) addOutput(LXOscConnection.Output output) addOutput(LXOscConnection.Output output, int index) voiddispatch()Invoked by the main engine to dispatch OSC messages on the input queue of all the receiversvoiddispose()Invoked when a component is being removed from the system and will no longer be used at all.static final voidstatic final voidstatic StringGets the OSC address pattern for a parametervoidload(LX lx, JsonObject obj) Loads the LX component.static final voidvoidSubclasses are free to override this if desired.receiver(int port) receiver(int port, int bufferSize) receiver(int port, InetAddress address) receiver(int port, InetAddress address, int bufferSize) removeInput(LXOscConnection.Input input) removeIOListener(LXOscEngine.IOListener listener) removeListener(LXOscListener listener) removeOutput(LXOscConnection.Output output) voidsave(LX lx, JsonObject obj) Serializes the LX component.sendMessage(String path, float value) sendMessage(String path, int value) sendMessage(String path, String value) sendParameter(LXParameter parameter) transmitter(String host, int port) transmitter(InetAddress address, int port) transmitter(InetAddress address, int port, int bufferSize) Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, removeParameter, removeParameter, removeParameter, removeParameter, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
DEFAULT_RECEIVE_PORT
public static final int DEFAULT_RECEIVE_PORT- See Also:
-
DEFAULT_TRANSMIT_PORT
public static final int DEFAULT_TRANSMIT_PORT- See Also:
-
DEFAULT_RECEIVE_HOST
- See Also:
-
DEFAULT_TRANSMIT_HOST
- See Also:
-
receiveActive
-
receiveHost
-
unknownReceiveHost
-
receiveState
-
receiveActivity
-
receivePort
-
transmitActive
-
transmitHost
-
unknownTransmitHost
-
transmitState
-
transmitActivity
-
transmitPort
-
logInput
-
logOutput
-
inputs
-
outputs
-
-
Constructor Details
-
LXOscEngine
-
-
Method Details
-
addIOListener
-
removeIOListener
-
addListener
-
removeListener
-
sendMessage
-
sendMessage
-
sendMessage
-
sendParameter
-
getOscAddress
Gets the OSC address pattern for a parameter- Parameters:
p- parameter- Returns:
- OSC address
-
onParameterChanged
Description copied from class:LXComponentSubclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChangedin interfaceLXParameterListener- Overrides:
onParameterChangedin classLXComponent- Parameters:
p- Parameter that has a value change
-
receiver
public LXOscEngine.Receiver receiver(int port, String host) throws SocketException, UnknownHostException - Throws:
SocketExceptionUnknownHostException
-
receiver
- Throws:
SocketException
-
receiver
public LXOscEngine.Receiver receiver(int port, InetAddress address, int bufferSize) throws SocketException - Throws:
SocketException
-
receiver
- Throws:
SocketException
-
receiver
- Throws:
SocketException
-
transmitter
public LXOscEngine.Transmitter transmitter(String host, int port) throws SocketException, UnknownHostException - Throws:
SocketExceptionUnknownHostException
-
transmitter
- Throws:
SocketException
-
transmitter
public LXOscEngine.Transmitter transmitter(InetAddress address, int port, int bufferSize) throws SocketException - Throws:
SocketException
-
addInput
-
addInput
-
addInput
-
addInput
-
removeInput
-
addOutput
-
addOutput
-
addOutput
-
addOutput
-
removeOutput
-
dispatch
public void dispatch()Invoked by the main engine to dispatch OSC messages on the input queue of all the receivers -
save
Description copied from class:LXComponentSerializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to callsuper.save(lx, obj)at the appropriate time.- Specified by:
savein interfaceLXSerializable- Overrides:
savein classLXComponent- Parameters:
lx- LX instanceobj- Object to serialize into
-
load
Description copied from class:LXComponentLoads the LX component. Restores the ID of the component, as well as its internal and user-facing parameters. Any explicitly registered children will be automatically loaded, so long as they are direct descendants. Dynamic arrays will not be automatically loaded, this is left to subclasses to implement.- Specified by:
loadin interfaceLXSerializable- Overrides:
loadin classLXComponent- Parameters:
lx- LX instanceobj- Object to deserialize
-
dispose
public void dispose()Description copied from class:LXComponentInvoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally callsuper.dispose()at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.- Overrides:
disposein classLXComponent
-
log
-
error
-
error
-