Package heronarts.lx.midi.template
Class LXMidiTemplate
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.midi.template.LXMidiTemplate
- All Implemented Interfaces:
LXComponent.Renamable
,LXPath
,LXSerializable
,LXMidiListener
,LXParameterListener
- Direct Known Subclasses:
AkaiMidiMix
,AkaiMPD218
,DJTTMidiFighterTwister
,NovationLaunchkeyMk337
public abstract class LXMidiTemplate
extends LXComponent
implements LXComponent.Renamable, LXMidiListener
A MIDI template is a component that holds parameters for a known MIDI device, which
does not implement a full MIDI surface implementation, but rather just exposes those
parameters for modulation mapping via the UI.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Marker interface for MIDI templates that include output back to the devicestatic @interface
static @interface
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
FieldsFields 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, presetFile
Fields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.int
getIndex()
getPath()
Accessor for the path of this object.static String
getTemplateName
(Class<? extends LXMidiTemplate> templateClass) protected void
Subclasses should override this to initialize output values in the case where device synchronization is neededvoid
Subclasses are free to override this if desired.protected void
sendControlChange
(int channel, int cc, int value) protected void
sendNoteOn
(int channel, int note, int velocity) protected void
sendSysex
(byte[] sysex) 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, handleOscMessage, hasParameter, isValidOscParameter, load, loadParameters, loadPreset, removeParameter, removeParameter, removeParameter, removeParameter, save, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.midi.LXMidiListener
aftertouchReceived, controlChangeReceived, midiPanicReceived, noteOffReceived, noteOnReceived, pitchBendReceived, programChangeReceived, sysexReceived
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
sourceDevice
-
destinationDevice
-
connected
-
-
Constructor Details
-
LXMidiTemplate
-
-
Method Details
-
getIndex
public int getIndex() -
getPath
Description copied from class:LXComponent
Accessor for the path of this object. Returns the path this component was registered with. Some subclasses may override this if path structure is dynamic.- Specified by:
getPath
in interfaceLXPath
- Overrides:
getPath
in classLXComponent
- Returns:
- path of this component relative to its parent
-
initializeDefaultIO
-
getTemplateName
-
getTemplateName
-
initializeOutput
protected void initializeOutput()Subclasses should override this to initialize output values in the case where device synchronization is needed -
onParameterChanged
Description copied from class:LXComponent
Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChanged
in interfaceLXParameterListener
- Overrides:
onParameterChanged
in classLXComponent
- Parameters:
p
- Parameter that has a value change
-
sendNoteOn
protected void sendNoteOn(int channel, int note, int velocity) -
sendControlChange
protected void sendControlChange(int channel, int cc, int value) -
sendSysex
protected void sendSysex(byte[] sysex) -
dispose
public void dispose()Description copied from class:LXComponent
Invoked 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:
dispose
in classLXComponent
-