Skip to content

Commit

Permalink
Fixin buggies
Browse files Browse the repository at this point in the history
removed some unused imports
made some references static, so the warning goes bye bye
  • Loading branch information
Rusettsten committed Jan 1, 2022
1 parent e8b4111 commit d360706
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class OscInterpreter implements OSCMessageListener{
/*
* VARIABLES
*/
@SuppressWarnings("unused")
private Photon photon;
private OSCPortIn oscReceiver;
private int portNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class OscListener implements Runnable {
* VARIABLES
*/
private UUID uuid;
@SuppressWarnings("unused")
private Photon photon;
private String addressListener;
private Consumer<OSCMessage> consumer;
Expand Down Expand Up @@ -56,7 +57,7 @@ public void run() {
try {
consumer.accept(message);
}catch(NumberFormatException | ClassCastException | IndexOutOfBoundsException e) {
photon.log.error("An Object Conversion Error has occured. Some data may not be recorded.");
Photon.log.error("An Object Conversion Error has occured. Some data may not be recorded.");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import java.util.function.Consumer;

import com.illposed.osc.OSCMessage;
import com.illposed.osc.OSCMessageInfo;
import com.strikete.photon.Photon;
import com.strikete.photon.PhotonDataUtilities;
import com.strikete.photon.exceptions.ObjectNotFoundException;
import com.strikete.photon.objects.BeamPalette;
import com.strikete.photon.objects.Channel;
Expand Down Expand Up @@ -226,7 +224,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
channel = new Channel(channelNum,partNum,index,uid);
isNew = true;
photon.log.info("OBJ: New Channel Object created. CH "+ channelNum + " PT " + partNum);
Photon.log.info("OBJ: New Channel Object created. CH "+ channelNum + " PT " + partNum);
}

try {
Expand Down Expand Up @@ -256,20 +254,6 @@ private void createInfoListeners() {
photon.channels.add(channel);
}
};

Consumer<OSCMessage> oscTemp = message -> {
OSCMessageInfo msgInfo = message.getInfo();
System.out.println("BEGIN NEW MESSAGE");
System.out.println(message.getAddress());
System.out.println(msgInfo.getArgumentTypeTags());

List<Object> argList = message.getArguments();

for(int x = 0; x < argList.size(); x++) {
System.out.println(argList.get(x));
}
int index = (int) argList.get(0);
};
listeners.add(new OscListener(photon, OscIncoming.RETURN_PATCH, patchInfoConsumer, true));

Consumer<OSCMessage> patchNoteConsumer = message -> { //PATCH INFO CONSUMER (2/2) notes
Expand All @@ -291,7 +275,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
channel = new Channel(channelNum,partNum,index,uid);
isNew = true;
photon.log.info("OBJ: New Channel Object created. CH "+ channelNum + " PT " + partNum);
Photon.log.info("OBJ: New Channel Object created. CH "+ channelNum + " PT " + partNum);
}

channel.setNotes(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -319,7 +303,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
cuelist = new Cuelist(cuelistNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Cuelist Object created. Cuelist #" + cuelistNum);
Photon.log.info("OBJ: New Cuelist Object created. Cuelist #" + cuelistNum);
}

cuelist.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -357,7 +341,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
cuelist = new Cuelist(cuelistNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Cuelist Object created. Cuelist #" + cuelistNum);
Photon.log.info("OBJ: New Cuelist Object created. Cuelist #" + cuelistNum);
}

try {
Expand Down Expand Up @@ -392,7 +376,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
cue = new Cue(cueNum, index, uid, cuelistNum, partNum);
isNew = true;
photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
Photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
}

cue.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -446,7 +430,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
cue = new Cue(cueNum, index, uid, cuelistNum, partNum);
isNew = true;
photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
Photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
}

try {
Expand Down Expand Up @@ -480,7 +464,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
cue = new Cue(cueNum, index, uid, cuelistNum, partNum);
isNew = true;
photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
Photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
}

try {
Expand Down Expand Up @@ -514,7 +498,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
cue = new Cue(cueNum, index, uid, cuelistNum, partNum);
isNew = true;
photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
Photon.log.info("OBJ: New Cue Object created. Cue #" + cueNum);
}

try {
Expand Down Expand Up @@ -546,7 +530,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
group = new Group(groupNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Group Object created. Group #" + groupNum);
Photon.log.info("OBJ: New Group Object created. Group #" + groupNum);
}
group.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));

Expand All @@ -573,7 +557,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
group = new Group(groupNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Group Object created. Group #" + groupNum);
Photon.log.info("OBJ: New Group Object created. Group #" + groupNum);
}
group.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));

Expand Down Expand Up @@ -610,7 +594,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
macro = new Macro(macroNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Macro Object created. Macro #" + macroNum);
Photon.log.info("OBJ: New Macro Object created. Macro #" + macroNum);
}
macro.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
macro.setMode(OscNumberInterpreter.oscToString(argList.get(3)));
Expand Down Expand Up @@ -638,7 +622,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
macro = new Macro(macroNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Macro Object created. Macro #" + macroNum);
Photon.log.info("OBJ: New Macro Object created. Macro #" + macroNum);
}

String macroCommand = ""; //Compiles multiple String messages (if necessary) and puts them together
Expand Down Expand Up @@ -670,7 +654,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
sub = new Sub(subNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Sub Object created. Sub #" + subNum);
Photon.log.info("OBJ: New Sub Object created. Sub #" + subNum);
}

sub.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -708,7 +692,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
sub = new Sub(subNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Sub Object created. Sub #" + subNum);
Photon.log.info("OBJ: New Sub Object created. Sub #" + subNum);
}

try {
Expand Down Expand Up @@ -740,7 +724,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
preset = new Preset(presetNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
Photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
}

preset.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -770,7 +754,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
preset = new Preset(presetNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
Photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
}

try {
Expand Down Expand Up @@ -802,7 +786,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
preset = new Preset(presetNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
Photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
}

try {
Expand Down Expand Up @@ -834,7 +818,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
preset = new Preset(presetNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
Photon.log.info("OBJ: New Preset Object created. Preset #" + presetNum);
}

try {
Expand Down Expand Up @@ -866,7 +850,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new IntensityPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Intensity Palette Object created. IP #" + paletteNum);
Photon.log.info("OBJ: New Intensity Palette Object created. IP #" + paletteNum);
}

palette.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -896,7 +880,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new IntensityPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Intensity Palette Object created. IP #" + paletteNum);
Photon.log.info("OBJ: New Intensity Palette Object created. IP #" + paletteNum);
}

palette.setChannelList(OscNumberInterpreter.oscNumberToArray(argList.get(2)));
Expand Down Expand Up @@ -924,7 +908,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new IntensityPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Intensity Palette Object created. IP #" + paletteNum);
Photon.log.info("OBJ: New Intensity Palette Object created. IP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -956,7 +940,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new FocusPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Focus Palette Object created. FP #" + paletteNum);
Photon.log.info("OBJ: New Focus Palette Object created. FP #" + paletteNum);
}

palette.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -986,7 +970,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new FocusPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Focus Palette Object created. FP #" + paletteNum);
Photon.log.info("OBJ: New Focus Palette Object created. FP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -1018,7 +1002,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new FocusPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Focus Palette Object created. FP #" + paletteNum);
Photon.log.info("OBJ: New Focus Palette Object created. FP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -1050,7 +1034,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new ColorPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Color Palette Object created. CP #" + paletteNum);
Photon.log.info("OBJ: New Color Palette Object created. CP #" + paletteNum);
}

palette.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -1080,7 +1064,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new ColorPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Color Palette Object created. CP #" + paletteNum);
Photon.log.info("OBJ: New Color Palette Object created. CP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -1112,7 +1096,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new ColorPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Color Palette Object created. CP #" + paletteNum);
Photon.log.info("OBJ: New Color Palette Object created. CP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -1144,7 +1128,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new BeamPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Beam Palette Object created. BP #" + paletteNum);
Photon.log.info("OBJ: New Beam Palette Object created. BP #" + paletteNum);
}

palette.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -1174,7 +1158,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new BeamPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Beam Palette Object created. BP #" + paletteNum);
Photon.log.info("OBJ: New Beam Palette Object created. BP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -1206,7 +1190,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
palette = new BeamPalette(paletteNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Beam Palette Object created. BP #" + paletteNum);
Photon.log.info("OBJ: New Beam Palette Object created. BP #" + paletteNum);
}

try {
Expand Down Expand Up @@ -1238,7 +1222,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
curve = new Curve(curveNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Curve Object created. Curve #" + curveNum);
Photon.log.info("OBJ: New Curve Object created. Curve #" + curveNum);
}

curve.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -1266,7 +1250,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
effect = new Effect(effectNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Effect Object created. Effect #" + effectNum);
Photon.log.info("OBJ: New Effect Object created. Effect #" + effectNum);
}

effect.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -1299,7 +1283,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
snapshot = new Snapshot(snapshotNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Snapshot Object created. Snapshot #" + snapshotNum);
Photon.log.info("OBJ: New Snapshot Object created. Snapshot #" + snapshotNum);
}

snapshot.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -1327,7 +1311,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
pixelmap = new Pixelmap(pixelmapNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Pixelmap Object created. Pixelmap #" + pixelmapNum);
Photon.log.info("OBJ: New Pixelmap Object created. Pixelmap #" + pixelmapNum);
}

pixelmap.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));
Expand Down Expand Up @@ -1361,7 +1345,7 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
pixelmap = new Pixelmap(pixelmapNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Pixelmap Object created. Pixelmap #" + pixelmapNum);
Photon.log.info("OBJ: New Pixelmap Object created. Pixelmap #" + pixelmapNum);
}

pixelmap.setLayerChannelList(OscNumberInterpreter.oscNumberToArray(argList.get(2)));
Expand Down Expand Up @@ -1389,10 +1373,14 @@ private void createInfoListeners() {
}catch(ObjectNotFoundException e) {
magicSheet = new MagicSheet(magicSheetNum, index, uid);
isNew = true;
photon.log.info("OBJ: New Magic Sheet Object created. Magic Sheet #" + magicSheetNum);
Photon.log.info("OBJ: New Magic Sheet Object created. Magic Sheet #" + magicSheetNum);
}

magicSheet.setLabel(OscNumberInterpreter.oscToString(argList.get(2)));

if(isNew) {
photon.magicSheets.add(magicSheet);
}
};
listeners.add(new OscListener(photon, OscIncoming.RETURN_MAGIC_SHEET, magicSheetInfoConsumer, true));

Expand Down

0 comments on commit d360706

Please sign in to comment.