Skip to content

Commit

Permalink
Daily Commit 10-28-2021
Browse files Browse the repository at this point in the history
Added some data utilities, finished adding count Consumers, and added RETURN info Strings in OscIncoming.
  • Loading branch information
Rusettsten committed Oct 28, 2021
1 parent 46591fd commit 04ab7b5
Show file tree
Hide file tree
Showing 5 changed files with 343 additions and 27 deletions.
39 changes: 20 additions & 19 deletions photon/src/main/java/com/strikete/photon/Photon.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,35 @@ public class Photon {
public static final String version = "SNAPSHOT 0.9.0";
public OscSender sender;
public OscInterpreter interpreter;
public PhotonDataUtilities dataUtility;


/*
* VARIABLES - EOS SPECIFIC
*/
private String eosVersion;
public String eosVersion;


/*
* VARIABLES - OBJECTS
*/
private ArrayList<BeamPalette> beamPalettes;
private ArrayList<Channel> channels;
private ArrayList<ColorPalette> colorPalettes;
private ArrayList<Cue> cues;
private ArrayList<Cuelist> cuelists;
private ArrayList<Curve> curves;
private ArrayList<Effect> effects;
private ArrayList<Fixture> fixtures;
private ArrayList<FocusPalette> focusPalettes;
private ArrayList<Group> groups;
private ArrayList<IntensityPalette>intensityPalettes;
private ArrayList<Macro> macros;
private ArrayList<MagicSheet> magicSheets;
private ArrayList<Pixelmap> pixelmaps;
private ArrayList<Preset> presets;
private ArrayList<Snapshot> snapshots;
private ArrayList<Sub> subs;
public ArrayList<BeamPalette> beamPalettes;
public ArrayList<Channel> channels;
public ArrayList<ColorPalette> colorPalettes;
public ArrayList<Cue> cues;
public ArrayList<Cuelist> cuelists;
public ArrayList<Curve> curves;
public ArrayList<Effect> effects;
public ArrayList<Fixture> fixtures;
public ArrayList<FocusPalette> focusPalettes;
public ArrayList<Group> groups;
public ArrayList<IntensityPalette>intensityPalettes;
public ArrayList<Macro> macros;
public ArrayList<MagicSheet> magicSheets;
public ArrayList<Pixelmap> pixelmaps;
public ArrayList<Preset> presets;
public ArrayList<Snapshot> snapshots;
public ArrayList<Sub> subs;


/*
Expand Down Expand Up @@ -145,6 +146,6 @@ public Photon() {
log = Logger.getLogger(Photon.class);
BasicConfigurator.configure();
initializeVariables();

this.dataUtility = new PhotonDataUtilities(this);
}
}
151 changes: 151 additions & 0 deletions photon/src/main/java/com/strikete/photon/PhotonDataUtilities.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package com.strikete.photon;

public class PhotonDataUtilities {

/*
* VARIABLES
*/
private Photon photon;


/*
* METHODS - CHECK EXISTING ARRAY BY EOS-UID
*/
public boolean doesBeamPaletteExist(String uid) {
for(int x = 0; x < photon.beamPalettes.size(); x++) {
if(photon.beamPalettes.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesChannelExist(String uid) {
for(int x = 0; x < photon.channels.size(); x++) {
if(photon.channels.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesColorPaletteExist(String uid) {
for(int x = 0; x < photon.colorPalettes.size(); x++) {
if(photon.colorPalettes.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesCueExist(String uid) {
for(int x = 0; x < photon.cues.size(); x++) {
if(photon.cues.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesCuelistExist(String uid) {
for(int x = 0; x < photon.cuelists.size(); x++) {
if(photon.cuelists.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesCurveExist(String uid) {
for(int x = 0; x < photon.curves.size(); x++) {
if(photon.curves.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesEffectExist(String uid) {
for(int x = 0; x < photon.effects.size(); x++) {
if(photon.effects.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
//FIXTURES DO NOT HAVE A UID
public boolean doesFocusPaletteExist(String uid) {
for(int x = 0; x < photon.focusPalettes.size(); x++) {
if(photon.focusPalettes.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesGroupExist(String uid) {
for(int x = 0; x < photon.groups.size(); x++) {
if(photon.groups.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesIntensityPaletteExist(String uid) {
for(int x = 0; x < photon.intensityPalettes.size(); x++) {
if(photon.intensityPalettes.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesMacroExist(String uid) {
for(int x = 0; x < photon.macros.size(); x++) {
if(photon.macros.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesMagicSheetExist(String uid) {
for(int x = 0; x < photon.magicSheets.size(); x++) {
if(photon.magicSheets.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesPixelmapExist(String uid) {
for(int x = 0; x < photon.pixelmaps.size(); x++) {
if(photon.pixelmaps.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesPresetExist(String uid) {
for(int x = 0; x < photon.presets.size(); x++) {
if(photon.presets.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesSnapshotExist(String uid) {
for(int x = 0; x < photon.snapshots.size(); x++) {
if(photon.snapshots.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}
public boolean doesSubExist(String uid) {
for(int x = 0; x < photon.subs.size(); x++) {
if(photon.subs.get(0).getUid().equals(uid)) {
return true;
}
}
return false;
}


/*
* CONSTRUCTOR
*/
public PhotonDataUtilities(Photon photonIn) {
this.photon = photonIn;
}
}
29 changes: 28 additions & 1 deletion photon/src/main/java/com/strikete/photon/osc/OscIncoming.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ public class OscIncoming {
public static String RETURN_CUE_EFFECTS = "/eos/out/get/cue/[int]/[float]/[int]/fx/list/[int]/[int]";
public static String RETURN_CUE_LINKS = "/eos/out/get/cue/[int]/[float]/[int]/links/list/[int]/[int]";
public static String RETURN_CUE_ACTIONS = "/eos/out/get/cue/[int]/[float]/[int]/actions/list/[int]/[int]";

public static String RETURN_GROUP = "/eos/out/get/group/[float]/list/[int]/[int]";
public static String RETURN_GROUP_CHANNELS = "/eos/out/get/group/[float]/channels/list/[int]/[int]";
public static String RETURN_MACRO = "/eos/out/get/macro/[int]/list/[int]/[int]";
public static String RETURN_MACRO_COMMAND = "/eos/out/get/macro/[int]/text/list/[int]/[int]";
public static String RETURN_SUB = "/eos/out/get/sub/[int]/list/[int]/[int]";
public static String RETURN_SUB_EFFECTS = "/eos/out/get/sub/[int]/fx/list/[int]/[int]";
public static String RETURN_PRESET = "/eos/out/get/preset/[float]/list/[int]/[int]";
public static String RETURN_PRESET_CHANNELS = "/eos/out/get/preset/[float]/channels/list/[int]/[int]";
public static String RETURN_PRESET_CHANNELS_BY_TYPE = "/eos/out/get/preset/[float]/byType/list/[int]/[int]";
public static String RETURN_PRESET_EFFECTS = "/eos/out/get/preset/[float]/fx/list/[int]/[int]";
public static String RETURN_INTENSITY_PALETTE = "/eos/out/get/ip/[float]/list/[int]/[int]";
public static String RETURN_INTENSITY_PALETTE_CHANNELS = "/eos/out/get/ip/[float]/channels/list/[int]/[int]";
public static String RETURN_INTENSITY_PALETTE_CHANNELS_BY_TYPE = "/eos/out/get/ip/[float]/byType/list/[int]/[int]";
public static String RETURN_FOCUS_PALETTE = "/eos/out/get/fp/[float]/list/[int]/[int]";
public static String RETURN_FOCUS_PALETTE_CHANNELS = "/eos/out/get/fp/[float]/channels/list/[int]/[int]";
public static String RETURN_FOCUS_PALETTE_CHANNELS_BY_TYPE = "/eos/out/get/fp/[float]/byType/list/[int]/[int]";
public static String RETURN_COLOR_PALETTE = "/eos/out/get/cp/[float]/list/[int]/[int]";
public static String RETURN_COLOR_PALETTE_CHANNELS = "/eos/out/get/cp/[float]/channels/list/[int]/[int]";
public static String RETURN_COLOR_PALETTE_CHANNELS_BY_TYPE = "/eos/out/get/cp/[float]/byType/list/[int]/[int]";
public static String RETURN_BEAM_PALETTE = "/eos/out/get/bp/[float]/list/[int]/[int]";
public static String RETURN_BEAM_PALETTE_CHANNELS = "/eos/out/get/bp/[float]/channels/list/[int]/[int]";
public static String RETURN_BEAM_PALETTE_CHANNELS_BY_TYPE = "/eos/out/get/bp/[float]/byType/list/[int]/[int]";
public static String RETURN_CURVE = "/eos/out/get/curve/[int]/list/[int]/[int]";
public static String RETURN_EFFECT = "/eos/out/get/fx/[float]/list/[int]/[int]";
public static String RETURN_SNAPSHOT = "/eos/out/get/snap/[int]/list/[int]/[int]";
public static String RETURN_PIXELMAP = "/eos/out/get/pixmap/[int]/list/[int]/[int]";
public static String RETURN_PIXELMAP_CHANNELS = "/eos/out/get/pixmap/[int]/channels/list/[int]/[int]";
public static String RETURN_MAGIC_SHEET = "/eos/out/get/ms/[int]/list/[int]/[int]";

}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void acceptMessage(OSCMessageEvent event) {
if(doArraysMatch(messageAddressArray, listenerAddressArray)) { //Compare the two arrays
oscListeners.get(a).postToConsumer(event.getMessage(), photon);
}
}else { //NON-EXACT MATCHES
}else { //TODO:NON-EXACT MATCHES

}
}
Expand Down
Loading

0 comments on commit 04ab7b5

Please sign in to comment.