-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
196 additions
and
42 deletions.
There are no files selected for viewing
124 changes: 84 additions & 40 deletions
124
photon/src/main/java/com/strikete/photon/objects/Preset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,115 @@ | ||
package com.strikete.photon.objects; | ||
|
||
public class Preset { | ||
import java.util.ArrayList; | ||
|
||
public class Preset implements CsvLevelDataSetter { | ||
|
||
/* | ||
* VARIABLES | ||
*/ | ||
private float presetNum; | ||
private String UID; | ||
private String name; | ||
private int index; | ||
private String uid; | ||
private String label; | ||
private boolean absolute; | ||
private boolean locked; | ||
private Channel[] channels = new Channel[65535]; | ||
private int numOfChannels; | ||
private Effect[] effects = new Effect[512]; | ||
private int numOfEffects; | ||
private ArrayList<Integer> channelList = new ArrayList<Integer>(); | ||
private ArrayList<Integer> byTypeChannelList = new ArrayList<Integer>(); | ||
private ArrayList<Integer> effectList = new ArrayList<Integer>(); | ||
private ArrayList<Integer> channels = new ArrayList<Integer>(); | ||
private ArrayList<String> parameters = new ArrayList<String>(); | ||
private ArrayList<Float> levels = new ArrayList<Float>(); | ||
|
||
|
||
/* | ||
* METHODS | ||
* METHODS - GETTERS | ||
*/ | ||
public float getPresetNum() { | ||
return this.presetNum; | ||
public float getPresetNumber() { | ||
return presetNum; | ||
} | ||
public String getUID() { | ||
return this.UID; | ||
public int getIndexNumber() { | ||
return index; | ||
} | ||
public String getName() { | ||
return this.name; | ||
public String getUid() { | ||
return uid; | ||
} | ||
public String getLabel() { | ||
return label; | ||
} | ||
public boolean getAbsolute() { | ||
return this.absolute; | ||
return absolute; | ||
} | ||
public boolean getLocked() { | ||
return this.locked; | ||
return locked; | ||
} | ||
public Channel getChannel(int indexNum) { | ||
return this.channels[indexNum]; | ||
public ArrayList<Integer> getChannelList() { | ||
return channelList; | ||
} | ||
public int getNumOfChannels() { | ||
return this.numOfChannels; | ||
public ArrayList<Integer> getByTypeChannelList() { | ||
return byTypeChannelList; | ||
} | ||
public Effect getEffect(int indexNum) { | ||
return this.effects[indexNum]; | ||
public ArrayList<Integer> getEffectList() { | ||
return effectList; | ||
} | ||
public int getNumOfEffects() { | ||
return this.numOfEffects; | ||
public ArrayList<Integer> getChannels() { | ||
return channels; | ||
} | ||
|
||
public void addChannel(Channel channelIn) { | ||
this.channels[numOfChannels] = channelIn; | ||
numOfChannels++; | ||
public ArrayList<String> getParameters() { | ||
return parameters; | ||
} | ||
|
||
public void addEffect(Effect effectIn) { | ||
this.effects[numOfEffects] = effectIn; | ||
numOfEffects++; | ||
public ArrayList<Float> getLevels(){ | ||
return levels; | ||
} | ||
|
||
|
||
/* | ||
* CONSTRUCTOR | ||
* METHODS - SETTERS | ||
*/ | ||
public Preset(float presetNumIn, String UIDin, String nameIn, boolean absoluteIn, boolean lockedIn) { | ||
this.presetNum = presetNumIn; | ||
this.UID = UIDin; | ||
this.name = nameIn; | ||
public void setLabel(String labelIn) { | ||
this.label = labelIn; | ||
} | ||
public void setAbsolute(boolean absoluteIn) { | ||
this.absolute = absoluteIn; | ||
} | ||
public void setLocked(boolean lockedIn) { | ||
this.locked = lockedIn; | ||
numOfChannels = 0; | ||
numOfEffects = 0; | ||
} | ||
} | ||
public void setChannelList(ArrayList<Integer> channelListIn) { | ||
this.channelList = channelListIn; | ||
} | ||
public void setByTypeChannelList(ArrayList<Integer> byTypeChannelListIn) { | ||
this.byTypeChannelList = byTypeChannelListIn; | ||
} | ||
public void setEffectList(ArrayList<Integer> effectListIn) { | ||
this.effectList = effectListIn; | ||
} | ||
public void addEffect(int effectIn) { | ||
this.effectList.add(effectIn); | ||
} | ||
public void setChannels(ArrayList<Integer> channelsIn) { | ||
this.channels = channelsIn; | ||
} | ||
public void setParameters(ArrayList<String> parametersIn) { | ||
this.parameters = parametersIn; | ||
} | ||
public void setLevels(ArrayList<Float> levelsIn) { | ||
this.levels = levelsIn; | ||
} | ||
|
||
|
||
/* | ||
* METHODS - INTERFACE | ||
*/ | ||
@Override | ||
public void addCsvLevelData(int channelIn, String parameterIn, float levelIn) { | ||
this.channels.add(channelIn); | ||
this.parameters.add(parameterIn); | ||
this.levels.add(levelIn); | ||
} | ||
|
||
|
||
/* | ||
* CONSTRUCTOR | ||
*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters