public abstract class LXMidiSurface extends Object implements LXMidiListener, LXSerializable
Modifier and Type | Class and Description |
---|---|
static interface |
LXMidiSurface.Bidirectional
Marker interface for Midi Surface implementations which require an output
to be functional.
|
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
BooleanParameter |
enabled |
LXMidiInput |
input
The midi input device for this control surface.
|
static String |
KEY_NAME |
protected LX |
lx |
LXMidiOutput |
output
The midi output device for this control surface.
|
Modifier | Constructor and Description |
---|---|
protected |
LXMidiSurface(LX lx,
LXMidiInput input,
LXMidiOutput output) |
Modifier and Type | Method and Description |
---|---|
void |
aftertouchReceived(MidiAftertouch aftertouch) |
void |
controlChangeReceived(MidiControlChange cc) |
LXMidiInput |
getInput() |
String |
getName() |
LXMidiOutput |
getOutput() |
void |
load(LX lx,
JsonObject object)
Restores this instance from a JSON object
|
void |
noteOffReceived(MidiNote note) |
void |
noteOnReceived(MidiNoteOn note) |
protected void |
onEnable(boolean isOn)
Subclasses may override, invoked automatically when surface is enabled/disabled
|
protected void |
onReconnect()
Subclasses may override, invoked when the control surface was disconnected but
has now reconnected.
|
void |
pitchBendReceived(MidiPitchBend pitchBend) |
void |
programChangeReceived(MidiProgramChange pc) |
void |
save(LX lx,
JsonObject object)
Serializes this instance into the JSON object
|
protected void |
sendControlChange(int channel,
int cc,
int value) |
protected void |
sendNoteOn(int channel,
int note,
int velocity) |
protected final LX lx
public final LXMidiInput input
public final LXMidiOutput output
public final BooleanParameter enabled
public static final String KEY_NAME
protected LXMidiSurface(LX lx, LXMidiInput input, LXMidiOutput output)
public String getName()
public LXMidiInput getInput()
public LXMidiOutput getOutput()
protected void onEnable(boolean isOn)
isOn
- Whether surface is enabledprotected void onReconnect()
protected void sendNoteOn(int channel, int note, int velocity)
protected void sendControlChange(int channel, int cc, int value)
public void load(LX lx, JsonObject object)
LXSerializable
load
in interface LXSerializable
lx
- LX instanceobject
- Object to deserializepublic void save(LX lx, JsonObject object)
LXSerializable
save
in interface LXSerializable
lx
- LX instanceobject
- Object to serialize intopublic void noteOnReceived(MidiNoteOn note)
noteOnReceived
in interface LXMidiListener
public void noteOffReceived(MidiNote note)
noteOffReceived
in interface LXMidiListener
public void controlChangeReceived(MidiControlChange cc)
controlChangeReceived
in interface LXMidiListener
public void programChangeReceived(MidiProgramChange pc)
programChangeReceived
in interface LXMidiListener
public void pitchBendReceived(MidiPitchBend pitchBend)
pitchBendReceived
in interface LXMidiListener
public void aftertouchReceived(MidiAftertouch aftertouch)
aftertouchReceived
in interface LXMidiListener
LX library by Mark C. Slee. © 2012-2020