public class LXEngine extends LXComponent implements LXOscComponent, LXModulationContainer
Modifier and Type | Class and Description |
---|---|
static interface |
LXEngine.Dispatch |
static class |
LXEngine.Frame |
class |
LXEngine.NetworkThread |
class |
LXEngine.Output |
class |
LXEngine.Profiler |
LXComponent.Placeholder, LXComponent.Renamable
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
LXAudioEngine |
audio |
LXClipEngine |
clips |
BoundedParameter |
framesPerSecond |
BooleanParameter |
isChannelMultithreaded |
BooleanParameter |
isMultithreaded |
BooleanParameter |
isNetworkMultithreaded |
LXMappingEngine |
mapping |
LXMidiEngine |
midi |
LXMixerEngine |
mixer |
LXModulationEngine |
modulation |
LXEngine.NetworkThread |
networkThread |
long |
nowMillis
Globally accessible counter of the current millisecond clock
|
LXOscEngine |
osc |
LXEngine.Output |
output |
LXPalette |
palette |
LXEngine.Profiler |
profiler |
LXSnapshotEngine |
snapshots |
BoundedParameter |
speed |
Tempo |
tempo |
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Modifier and Type | Method and Description |
---|---|
LXEngine |
addLoopTask(LXLoopTask loopTask)
Add a task to be run on every loop of the engine thread.
|
LXEngine |
addOutput(LXOutput output)
Sets the output driver
|
LXEngine |
addTask(Runnable runnable)
Add a task to be run once on the engine thread.
|
void |
beforeP3LXDraw()
Utility method for P3LX mode, invoked from the Processing draw thread to give
a chance to change the threading state before the draw loop.
|
void |
copyFrameThreadSafe(LXEngine.Frame frame)
This should be used when in threaded mode.
|
void |
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.
|
float |
getActualFrameRate()
Gets the active frame rate of the engine when in threaded mode
|
float |
getCpuLoad()
Gets a very rough estimate of the CPU load the engine is using
before maxing out.
|
void |
getFrameNonThreadSafe(LXEngine.Frame frame)
Non-thread safe accessor of the render buffer.
|
LXModulationEngine |
getModulationEngine() |
String |
getPath()
Accessor for the path of this object.
|
boolean |
isPaused() |
boolean |
isThreaded()
Returns whether the engine is actively threaded
|
void |
load(LX lx,
JsonObject obj)
Loads the LX component.
|
void |
logProfiler() |
void |
onParameterChanged(LXParameter p)
Subclasses are free to override this if desired.
|
LXEngine |
registerComponent(String path,
LXComponent component)
Register a component with the engine.
|
LXEngine |
removeLoopTask(LXLoopTask loopTask)
Remove a task from the list run on every loop invocation
|
void |
run()
This is the core run loop of the LXEngine.
|
LXEngine |
setFixedDeltaMs(double deltaMs)
Utility for when rendering offline videos.
|
LXEngine |
setInputDispatch(LXEngine.Dispatch inputDispatch) |
LXEngine |
setPaused(boolean paused)
Pause the engine from running
|
LXEngine |
setSpeed(double speed)
Sets a global speed factor on the core animation engine.
|
LXEngine |
setThreaded(boolean threaded)
Sets the engine to threaded or non-threaded mode.
|
void |
start()
Starts the engine thread.
|
void |
stop()
Stops the engine thread.
|
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, handleOscMessage, loadParameters, removeParameter, removeParameter, save, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOscAddress, handleOscMessage
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter
public final LXPalette palette
public final Tempo tempo
public final LXClipEngine clips
public final LXMixerEngine mixer
public final LXMidiEngine midi
public final LXAudioEngine audio
public final LXMappingEngine mapping
public final LXOscEngine osc
public final LXEngine.Output output
public final BoundedParameter framesPerSecond
public final BoundedParameter speed
public final LXModulationEngine modulation
public final LXSnapshotEngine snapshots
public final LXEngine.Profiler profiler
public final BooleanParameter isMultithreaded
public final BooleanParameter isChannelMultithreaded
public final BooleanParameter isNetworkMultithreaded
public final LXEngine.NetworkThread networkThread
public long nowMillis
public void logProfiler()
public String getPath()
LXComponent
getPath
in interface LXPath
getPath
in class LXComponent
public LXEngine setInputDispatch(LXEngine.Dispatch inputDispatch)
public void onParameterChanged(LXParameter p)
LXComponent
onParameterChanged
in interface LXParameterListener
onParameterChanged
in class LXComponent
p
- Parameter that has a value changepublic float getActualFrameRate()
public float getCpuLoad()
public LXEngine setFixedDeltaMs(double deltaMs)
deltaMs
- Fixed deltaMs between rendered framespublic void start()
public void stop()
public boolean isThreaded()
public LXEngine setThreaded(boolean threaded)
threaded
- Whether engine should run on its own threadpublic void beforeP3LXDraw()
public LXEngine setSpeed(double speed)
speed
- Global speed multiplierpublic LXEngine setPaused(boolean paused)
paused
- Whether to pause the engine to pausepublic boolean isPaused()
public LXEngine registerComponent(String path, LXComponent component)
path
- Unique path key for saving and loading componentcomponent
- Componentpublic LXEngine addTask(Runnable runnable)
runnable
- Task to runpublic LXEngine addLoopTask(LXLoopTask loopTask)
loopTask
- Task to run on each engine looppublic LXEngine removeLoopTask(LXLoopTask loopTask)
loopTask
- Task to stop running on every looppublic LXEngine addOutput(LXOutput output)
output
- Output driver, or null for no outputpublic LXModulationEngine getModulationEngine()
getModulationEngine
in interface LXModulationContainer
public void run()
public void copyFrameThreadSafe(LXEngine.Frame frame)
frame
- Frame buffer to copy intopublic void getFrameNonThreadSafe(LXEngine.Frame frame)
frame
- Frame buffer to copy intopublic void load(LX lx, JsonObject obj)
LXComponent
load
in interface LXSerializable
load
in class LXComponent
lx
- LX instanceobj
- Object to deserializepublic void dispose()
LXComponent
super.dispose()
at the appropriate
time to perform the basic cleanup, which may need to happen either before or after cleaning
up other objects.dispose
in class LXComponent
LX library by Mark C. Slee. © 2012-2020