public class LXMidiEngine extends LXComponent implements LXOscComponent
Modifier and Type | Class and Description |
---|---|
static class |
LXMidiEngine.Channel |
static interface |
LXMidiEngine.DeviceListener |
static interface |
LXMidiEngine.MappingListener |
LXComponent.Placeholder, LXComponent.Renamable
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
BooleanParameter |
computerKeyboardEnabled |
List<LXMidiInput> |
inputs |
List<LXMidiMapping> |
mappings |
List<LXMidiOutput> |
outputs |
List<LXMidiSurface> |
surfaces |
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Constructor and Description |
---|
LXMidiEngine(LX lx) |
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, loadParameters, onParameterChanged, removeParameter, removeParameter, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOscAddress
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter
public final List<LXMidiInput> inputs
public final List<LXMidiOutput> outputs
public final List<LXMidiSurface> surfaces
public final List<LXMidiMapping> mappings
public final BooleanParameter computerKeyboardEnabled
public LXMidiEngine(LX lx)
public LXMidiEngine registerSurface(String deviceName, Class<? extends LXMidiSurface> surfaceClass)
public void initialize()
public 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
public static String getDeviceName(MidiDevice.Info deviceInfo)
public void whenReady(Runnable runnable)
runnable
- Code to run when MIDI engine is readypublic List<LXMidiInput> getInputs()
public List<LXMidiOutput> getOutputs()
public LXMidiInput matchInput(String name)
public LXMidiInput matchInput(String[] names)
public LXMidiOutput matchOutput(String name)
public LXMidiOutput matchOutput(String[] names)
public LXMidiSurface findSurface(LXMidiInput input)
public LXMidiSurface findSurface(String name)
public LXMidiOutput findOutput(String name)
public LXMidiInput findInput(String name)
public LXMidiEngine addListener(LXMidiListener listener)
public LXMidiEngine removeListener(LXMidiListener listener)
public LXMidiEngine addDeviceListener(LXMidiEngine.DeviceListener listener)
public LXMidiEngine removeDeviceListener(LXMidiEngine.DeviceListener listener)
public LXMidiEngine addMappingListener(LXMidiEngine.MappingListener listener)
public LXMidiEngine removeMappingListener(LXMidiEngine.MappingListener listener)
public boolean handleOscMessage(OscMessage message, String[] parts, int index)
LXComponent
handleOscMessage
in interface LXOscComponent
handleOscMessage
in class LXComponent
message
- Full OSC message objectparts
- The OSC address pattern, broken into an array of partsindex
- Which index into the parts array corresponds to this component's childrentrue
if the OSC message was handled and should be considered consumed, false
otherwisepublic LXMidiEngine addMapping(LXMidiMapping mapping)
public LXMidiEngine removeMapping(LXMidiMapping mapping)
mapping
- The mapping to removepublic List<LXMidiMapping> findMappings(LXComponent component)
public LXMidiEngine removeMappings(LXComponent component)
component
- Component to remove any midi mappings frompublic void dispatch()
public void dispatch(LXShortMessage message)
public void save(LX lx, JsonObject object)
LXComponent
super.save(lx, obj)
at the appropriate time.save
in interface LXSerializable
save
in class LXComponent
lx
- LX instanceobject
- Object to serialize intopublic void load(LX lx, JsonObject object)
LXComponent
load
in interface LXSerializable
load
in class LXComponent
lx
- LX instanceobject
- Object to deserializepublic static final void log(String message)
public static final void error(String message)
LX library by Mark C. Slee. © 2012-2020