Package heronarts.lx.midi.surface
Class LXMidiSurface
java.lang.Object
heronarts.lx.midi.surface.LXMidiSurface
- All Implemented Interfaces:
LXSerializable
,LXMidiListener
,LXParameterListener
- Direct Known Subclasses:
APC40
,APC40Mk2
,APCmini
,DJM900nxs2
,DJMA9
,DJMV10
,MidiFighterTwister
public abstract class LXMidiSurface
extends Object
implements LXMidiListener, LXSerializable, LXParameterListener
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Marker interface for Midi Surface implementations which require an output to be functional.Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Modifier and TypeFieldDescriptionfinal BooleanParameter
final LXMidiInput
The midi input device for this control surface.static final String
static final String
static final String
protected final LX
protected final LXParameter.Collection
protected final LXParameter.Collection
final LXMidiOutput
The midi output device for this control surface.final Map<String,
LXParameter> final Map<String,
LXParameter> -
Constructor Summary
ModifierConstructorDescriptionprotected
LXMidiSurface
(LX lx, LXMidiInput input, LXMidiOutput output) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSetting
(String key, LXListenableParameter setting) protected void
addState
(String key, LXListenableParameter state) void
aftertouchReceived
(MidiAftertouch aftertouch) void
void
dispose()
getInput()
getName()
int
int
boolean
void
load
(LX lx, JsonObject obj) Restores this instance from a JSON objectvoid
noteOffReceived
(MidiNote note) void
noteOnReceived
(MidiNoteOn note) protected void
onEnable
(boolean isOn) Subclasses may override, invoked automatically when surface is enabled/disabledvoid
Invoked when the value of a parameter is changed.protected void
Subclasses may override, invoked when the control surface was disconnected but has now reconnected.void
pitchBendReceived
(MidiPitchBend pitchBend) void
void
save
(LX lx, JsonObject obj) Serializes this instance into the JSON objectprotected void
sendControlChange
(int channel, int cc, int value) protected void
sendNoteOn
(int channel, int note, int velocity)
-
Field Details
-
lx
-
input
The midi input device for this control surface. Never null. -
output
The midi output device for this control surface. May be null in cases where the control surface does not implement the OutputRequired interface -
enabled
-
mutableSettings
-
settings
-
mutableState
-
state
-
KEY_NAME
- See Also:
-
KEY_SETTINGS
- See Also:
-
KEY_STATE
- See Also:
-
-
Constructor Details
-
LXMidiSurface
-
-
Method Details
-
onParameterChanged
Description copied from interface:LXParameterListener
Invoked when the value of a parameter is changed.- Specified by:
onParameterChanged
in interfaceLXParameterListener
- Parameters:
p
- The parameter that has changed its value
-
addSetting
-
addState
-
getName
-
getInput
-
getOutput
-
onEnable
protected void onEnable(boolean isOn) Subclasses may override, invoked automatically when surface is enabled/disabled- Parameters:
isOn
- Whether surface is enabled
-
onReconnect
protected void onReconnect()Subclasses may override, invoked when the control surface was disconnected but has now reconnected. Re-initialization may be necessary. -
sendNoteOn
protected void sendNoteOn(int channel, int note, int velocity) -
sendControlChange
protected void sendControlChange(int channel, int cc, int value) -
getRemoteControlStart
public int getRemoteControlStart() -
getRemoteControlLength
public int getRemoteControlLength() -
isRemoteControlAux
public boolean isRemoteControlAux() -
load
Description copied from interface:LXSerializable
Restores this instance from a JSON object- Specified by:
load
in interfaceLXSerializable
- Parameters:
lx
- LX instanceobj
- Object to deserialize
-
save
Description copied from interface:LXSerializable
Serializes this instance into the JSON object- Specified by:
save
in interfaceLXSerializable
- Parameters:
lx
- LX instanceobj
- Object to serialize into
-
noteOnReceived
- Specified by:
noteOnReceived
in interfaceLXMidiListener
-
noteOffReceived
- Specified by:
noteOffReceived
in interfaceLXMidiListener
-
controlChangeReceived
- Specified by:
controlChangeReceived
in interfaceLXMidiListener
-
programChangeReceived
- Specified by:
programChangeReceived
in interfaceLXMidiListener
-
pitchBendReceived
- Specified by:
pitchBendReceived
in interfaceLXMidiListener
-
aftertouchReceived
- Specified by:
aftertouchReceived
in interfaceLXMidiListener
-
dispose
public void dispose()
-