Modifier and Type | Class and Description |
---|---|
static class |
LX.Error |
static class |
LX.Flags |
static class |
LX.InitProfiler |
static class |
LX.InstantiationException |
static interface |
LX.Listener
Listener for top-level events
|
static class |
LX.Media |
static interface |
LX.Permissions |
static interface |
LX.ProjectListener |
Modifier and Type | Field and Description |
---|---|
LXClipboard |
clipboard
Clipboard for copy/paste
|
LXCommandEngine |
command
Command engine, utilized by higher-level UIs to manage
engine state and undo operations.
|
LXEngine |
engine
The animation engine.
|
MutableParameter |
errorChanged
Parameter that is bang()-ed every time errors change
|
StringParameter |
failure
This parameter will be set if a critical, unrecoverable error occurs.
|
LX.Flags |
flags
Configuration flags
|
static double |
HALF_PI |
static float |
HALF_PIf |
static LX.InitProfiler |
initProfiler |
static boolean |
LOG_WARNINGS |
protected LXModel |
model
The pixel model.
|
protected LX.Permissions |
permissions
Permissions
|
static float |
PIf |
LXPreferences |
preferences
Global preferences stored in persistent file
|
LXRegistry |
registry
Registry for classes
|
LXScheduler |
scheduler
The project scheduler
|
LXStructure |
structure
The lighting system structure
|
static double |
TWO_PI |
static float |
TWO_PIf |
static String |
VERSION |
Modifier | Constructor and Description |
---|---|
|
LX()
Creates an LX instance with no nodes.
|
|
LX(LX.Flags flags) |
protected |
LX(LX.Flags flags,
LXModel model) |
|
LX(LXModel model)
Constructs an LX instance with the given pixel model
|
Modifier and Type | Method and Description |
---|---|
protected static void |
_error(String prefix,
Exception x,
String message) |
protected static void |
_error(String prefix,
String message) |
protected static void |
_log(PrintStream stream,
String message) |
protected static void |
_log(PrintStream stream,
Throwable throwable,
String prefix,
String message) |
protected static void |
_log(String prefix,
String message) |
LX |
addEffect(LXEffect effect)
Add an effect to the FX chain.
|
LX |
addEffects(LXEffect[] effects)
Add multiple effects to the chain
|
LX |
addListener(LX.Listener listener) |
LX |
addOutput(LXOutput output)
Adds an output driver
|
LX |
addProjectListener(LX.ProjectListener listener) |
protected static void |
bootstrapMediaPath(LX.Flags flags) |
protected static void |
bootstrapMediaPath(LX.Flags flags,
String dirName) |
protected void |
confirmChangesSaved(String message,
Runnable confirm) |
LX |
disableAutoCycle()
Stops patterns from automatically rotating
|
void |
dispose()
Shut down resources of the LX instance.
|
LX |
enableAutoCycle(int autoCycleThreshold)
Sets the patterns to rotate automatically
|
static void |
error(Exception x) |
static void |
error(String message) |
static void |
error(String prefix,
Throwable x) |
static void |
error(Throwable x,
String message) |
protected void |
fail(Exception x) |
LXComponent |
getComponent(int componentId)
Gets a component by its raw component id
|
LX.Error |
getError() |
File |
getMediaFile(LX.Media type,
String path)
Retrieves a file handle to a file that can be saved.
|
File |
getMediaFile(LX.Media type,
String path,
boolean create)
Retrieves a file handle to a file that can be saved.
|
File |
getMediaFile(String path)
Retrieves a file handle to a file that can be saved.
|
File |
getMediaFolder(LX.Media type)
Retrieves a file handle to the folder used to store the given type of media
|
File |
getMediaFolder(LX.Media type,
boolean create)
Retrieves a file handle to the folder used to store the given type of media
|
String |
getMediaPath()
Get the root media path for storage of LX-related objects and extensions
|
String |
getMediaPath(LX.Media type,
File file)
Gets the path to a file relative to a base media path.
|
LXModel |
getModel()
Returns the model in use
|
List<LXPattern> |
getPatterns()
Gets the current set of patterns on the main channel.
|
LX.Permissions |
getPermissions() |
File |
getProject() |
LXComponent |
getProjectComponent(int projectId)
Gets a component by its id from the project file (which may have been remapped)
|
LX |
goIndex(int i)
Sets the main channel to a pattern of the given index
|
LX |
goNext()
Sets the main channel to the next pattern.
|
LX |
goPattern(LXPattern pattern)
Sets the main channel to a given pattern instance.
|
LX |
goPrev()
Sets the main channel to the previous pattern.
|
static void |
headless(LX.Flags flags,
File projectFile) |
static int |
hsa(float h,
float s,
float a)
Shorthand for LXColor.hsa()
|
static int |
hsb(float h,
float s,
float b)
Shorthand for LXColor.hsb()
|
LXBlend |
instantiateBlend(Class<? extends LXBlend> cls) |
LXBlend |
instantiateBlend(String className) |
<T extends LXComponent> |
instantiateComponent(Class<? extends T> cls,
Class<T> type) |
<T extends LXComponent> |
instantiateComponent(String className,
Class<T> type) |
LXEffect |
instantiateEffect(Class<? extends LXEffect> cls) |
LXEffect |
instantiateEffect(String className) |
LXFixture |
instantiateFixture(Class<? extends LXFixture> cls) |
LXFixture |
instantiateFixture(String className) |
LXModel |
instantiateModel(String className) |
LXModulator |
instantiateModulator(Class<? extends LXModulator> cls) |
LXModulator |
instantiateModulator(String className) |
LXPattern |
instantiatePattern(Class<? extends LXPattern> cls) |
LXPattern |
instantiatePattern(String className) |
protected LXRegistry |
instantiateRegistry(LX lx)
Subclasses may override to provide an enhanced registry with support for more types
|
boolean |
isPaused()
Whether the engine is currently running.
|
static void |
log(String message) |
static void |
logInitProfiler() |
static void |
main(String[] args)
Runs a headless version of LX
|
void |
newProject() |
void |
openProject(File file) |
LX |
popError() |
LX |
pushError(Exception exception) |
LX |
pushError(Exception exception,
String message) |
LX |
pushError(LX.Error error) |
LX |
registerExternal(String key,
LXSerializable serializable) |
LX |
removeEffect(LXEffect effect)
Remove an effect from the chain
|
LX |
removeListener(LX.Listener listener) |
LX |
removeProjectListener(LX.ProjectListener listener) |
static int |
rgb(int r,
int g,
int b)
Shorthand for LXColor.rgb()
|
void |
saveProject() |
void |
saveProject(File file) |
protected static void |
setLogFile(File file) |
void |
setModelImportFlag(boolean modelImport) |
LX |
setPatterns(LXPattern[] patterns)
Specifies the set of patterns to be run.
|
LX |
setPaused(boolean paused)
Pause the engine from running
|
protected void |
setProject(File file,
LX.ProjectListener.Change change) |
void |
setScheduleLoadingFlag(boolean scheduleLoading) |
LX |
setSpeed(double speed)
Sets the speed of the entire system.
|
void |
setSystemClipboardString(String str) |
protected void |
showConfirmUnsavedProjectDialog(String message,
Runnable confirm) |
LX |
togglePaused()
Toggles the running state of the engine.
|
static String |
version()
Returns the version of the library.
|
static void |
warning(String message) |
public static final String VERSION
public static final double HALF_PI
public static final double TWO_PI
public static final float PIf
public static final float HALF_PIf
public static final float TWO_PIf
public static final LX.InitProfiler initProfiler
public final LXPreferences preferences
public final LX.Flags flags
protected LX.Permissions permissions
public final MutableParameter errorChanged
public StringParameter failure
public final LXStructure structure
protected LXModel model
public final LXClipboard clipboard
public final LXEngine engine
public final LXCommandEngine command
public final LXRegistry registry
public final LXScheduler scheduler
public static boolean LOG_WARNINGS
public LX()
public LX(LXModel model)
model
- Pixel modelpublic LX(LX.Flags flags)
public static String version()
public static void logInitProfiler()
protected void fail(Exception x)
public LX.Permissions getPermissions()
public LX popError()
public LX.Error getError()
protected LXRegistry instantiateRegistry(LX lx)
lx
- LX instancepublic LX addListener(LX.Listener listener)
public LX removeListener(LX.Listener listener)
public LX addProjectListener(LX.ProjectListener listener)
public LX removeProjectListener(LX.ProjectListener listener)
public LXComponent getComponent(int componentId)
componentId
- Component IDpublic LXComponent getProjectComponent(int projectId)
projectId
- Component ID from loaded project filepublic LXModel getModel()
public void dispose()
public static int hsb(float h, float s, float b)
h
- Hue 0-360s
- Saturation 0-100b
- Brightness 0-100public static int hsa(float h, float s, float a)
h
- Hue 0-360s
- Saturation 0-100a
- Alpha 0-1public static int rgb(int r, int g, int b)
r
- Red 0-255g
- Green 0-255b
- Blue 0-255public LX setSpeed(double speed)
speed
- Coefficient, 1 is normal speedpublic LX addEffects(LXEffect[] effects)
effects
- Array of effectspublic LX addEffect(LXEffect effect)
effect
- Effectpublic LX removeEffect(LXEffect effect)
effect
- Effectpublic LX setPaused(boolean paused)
paused
- Whether to pause the engine to pausepublic boolean isPaused()
public LX togglePaused()
public LX goPrev()
public LX goNext()
public LX goPattern(LXPattern pattern)
pattern
- The pattern instance to runpublic LX goIndex(int i)
i
- Index of the pattern to runpublic LX disableAutoCycle()
public LX enableAutoCycle(int autoCycleThreshold)
autoCycleThreshold
- Number of milliseconds after which to cyclepublic LX addOutput(LXOutput output)
output
- Outputpublic LX setPatterns(LXPattern[] patterns)
patterns
- Array of patternspublic List<LXPattern> getPatterns()
protected void setProject(File file, LX.ProjectListener.Change change)
public File getProject()
public void saveProject()
public void saveProject(File file)
public LX registerExternal(String key, LXSerializable serializable)
public void newProject()
public void openProject(File file)
public void setModelImportFlag(boolean modelImport)
public void setScheduleLoadingFlag(boolean scheduleLoading)
protected void showConfirmUnsavedProjectDialog(String message, Runnable confirm)
public String getMediaPath()
public String getMediaPath(LX.Media type, File file)
type
- Media typefile
- Filepublic File getMediaFolder(LX.Media type)
type
- Media typepublic File getMediaFolder(LX.Media type, boolean create)
type
- Media typecreate
- Create folder if truepublic File getMediaFile(LX.Media type, String path)
type
- Media typepath
- File path relative to LX media dir, or absolutepublic File getMediaFile(LX.Media type, String path, boolean create)
type
- Media typepath
- File path relative to LX media dir, or absolutecreate
- Create folder if truepublic File getMediaFile(String path)
path
- File path relative to LX media dir, or absolutepublic LXModel instantiateModel(String className) throws LX.InstantiationException
LX.InstantiationException
public <T extends LXComponent> T instantiateComponent(String className, Class<T> type) throws LX.InstantiationException
LX.InstantiationException
public <T extends LXComponent> T instantiateComponent(Class<? extends T> cls, Class<T> type) throws LX.InstantiationException
LX.InstantiationException
public LXFixture instantiateFixture(String className) throws LX.InstantiationException
LX.InstantiationException
public LXFixture instantiateFixture(Class<? extends LXFixture> cls) throws LX.InstantiationException
LX.InstantiationException
public LXModulator instantiateModulator(String className) throws LX.InstantiationException
LX.InstantiationException
public LXModulator instantiateModulator(Class<? extends LXModulator> cls) throws LX.InstantiationException
LX.InstantiationException
public LXPattern instantiatePattern(String className) throws LX.InstantiationException
LX.InstantiationException
public LXPattern instantiatePattern(Class<? extends LXPattern> cls) throws LX.InstantiationException
LX.InstantiationException
public LXEffect instantiateEffect(String className) throws LX.InstantiationException
LX.InstantiationException
public LXEffect instantiateEffect(Class<? extends LXEffect> cls) throws LX.InstantiationException
LX.InstantiationException
public LXBlend instantiateBlend(String className) throws LX.InstantiationException
LX.InstantiationException
public LXBlend instantiateBlend(Class<? extends LXBlend> cls) throws LX.InstantiationException
LX.InstantiationException
public void setSystemClipboardString(String str)
protected static void bootstrapMediaPath(LX.Flags flags)
public static void log(String message)
public static void warning(String message)
public static void error(String message)
public static void error(Exception x)
protected static void _log(PrintStream stream, String message)
protected static void _log(PrintStream stream, Throwable throwable, String prefix, String message)
protected static void setLogFile(File file)
public static void main(String[] args)
args
- Command line argumentsLX library by Mark C. Slee. © 2012-2020