-
Notifications
You must be signed in to change notification settings - Fork 4
Mapping Outputs
Mark Slee edited this page Nov 24, 2020
·
3 revisions
Output mapping is handled inside of the initialize
callback method. Inside this method, you should construct the appropriate LXOutput and LXDatagram objects and add them to the LX engine.
void initialize(heronarts.lx.studio.LXStudio lx, heronarts.lx.studio.LXStudio.UI ui) {
final String ARTNET_IP = "192.168.1.1";
try {
// Add an ArtNetDatagram which sends all of the points in our model
ArtNetDatagram datagram = new ArtNetDatagram(lx, lx.model);
datagram.setAddress(ARTNET_IP);
lx.addOutput(datagram);
// Here's an example of a custom ArtNetDatagram which only sends specific points
int universeNumber = 0;
int[] first100Points = new int[100];
for (int i = 0; i < first100Points.length; ++i) {
first100Points[i] = i;
}
ArtNetDatagram first100PointsDatagram = new ArtNetDatagram(lx, first100Points, universeNumber);
first100PointsDatagram.setAddress(ARTNET_IP);
lx.addOutput(first100PointsDatagram);
} catch (Exception x) {
x.printStackTrace();
}
}
© 2020 LX Studio — Heron Arts LLC