Commit bab4ef2b authored by Philip Levis's avatar Philip Levis
Browse files

Mixer now working!

parent 7de01609
......@@ -117,13 +117,15 @@ public void onUIReady(LXStudio lx, LXStudio.UI ui) {
System.out.println("Creating UI.");
FlightGui.this.flyerHighlighter = new FlyerHighlighter(lx, flyerConfigurations);
lx.addEffect(flyerHighlighter);
configureUI(ui);
configureUI(lx, ui);
}
void configureUI(LXStudio.UI ui) {
void configureUI(LXStudio lx, LXStudio.UI ui) {
// Don't want all of the standard LXStudio stuff.
ui.bottomTray.setVisible(false);
ui.bottomTray.setPosition(400, 600);
ui.contentPicker.setVisible(false);
ui.helpBar.setVisible(false);
ui.leftPane.setVisible(false);
ui.preview.setVisible(false);
......@@ -161,6 +163,7 @@ void configureUI(LXStudio.UI ui) {
// Adds the control panel for selecting and moving Flyers
ui.addLayer(viewContext);
ui.addLayer(new UIFlyerConfiguration(ui));
ui.addLayer(new UIPatternMixer(lx, ui));
}
@Override
......
......@@ -297,3 +297,20 @@ class UIFlyerConfiguration extends UIWindow {
text.setLabel(config.metadata().text);
}
}
class UIPatternMixer extends UIWindow {
final static int WIDTH = 400;
final static int HEIGHT = 200;
final static int BORDER = 4;
UIPatternMixer(LX thislx, UI ui) {
super(ui, "MIXER",
WIDTH, FlightGui.this.height - (HEIGHT + BORDER),
WIDTH, HEIGHT);
System.out.println("thislx " + thislx);
System.out.println("thislx.engine " + thislx.engine);
System.out.println("thislx.engine.mixer " + thislx.engine.mixer);
new UIMixer(ui, thislx, 0, 0, HEIGHT).addToContainer(this);
}
}
......@@ -30,24 +30,20 @@ import java.util.List;
abstract class FlightEngine {
static final int NUM_CHANNELS = 8;
static final int NUM_CHANNELS = 2;
static final int NUM_AUTOMATION = 4;
// General engine variables
final String projectPath;
final IO io;
final FlightModel model;
final LXMixerEngine mixerEngine;
final LXStudio lx;
EngineController engineController;
Generator generator;
// Automation variables
final FFAutomationClip[] automation = new FFAutomationClip[NUM_AUTOMATION];
// ArrayList<TSPattern> patterns;
/** CONSTRUCTOR **/
FlightEngine(String projectPath, FlightModel model, LXStudio lx) {
this.projectPath = projectPath;
......@@ -55,9 +51,6 @@ abstract class FlightEngine {
this.model = model;
this.lx = lx;
engineController = new EngineController(lx);
mixerEngine = new LXMixerEngine(lx);
/** All engine configuration **/
configureGeneratorOutput();
configureChannels();
......@@ -84,21 +77,13 @@ abstract class FlightEngine {
return model.getFlyerConfigs();
}
/***** PUBLIC FUNCTIONS *****/
public LXMixerEngine getMixerEngine() {
return mixerEngine;
}
/***** PRIVATE FUNCTIONS *****/
/* Adds patterns to the pattern list passed as parameter */
private void addPatterns(ArrayList<LXPattern> patterns) {
// Add patterns here.
// The order here is the order it shows up in the patterns list
// patterns.add(new SolidColor(lx));
// patterns.add(new ClusterLineTest(lx));
// patterns.add(new OrderTest(lx));
patterns.add(new FadeTest(lx));
patterns.add(new BlackPinkTest(lx));
}
/* Returns the pattern list as an array */
......@@ -111,15 +96,15 @@ abstract class FlightEngine {
/* Configures channels */
private void configureChannels() {
for (int i = 0; i < NUM_CHANNELS; ++i) {
//LXChannel channel = new LXChannel(lx, i, getPatternArrayForChannels());
//TODO: Set up the channels
LXChannel channel = lx.engine.mixer.addChannel(i, getPatternArrayForChannels());
//setupChannel(channel, true);
if (i == 0) {
channel.fader.setValue(1);
}
//channel.goPatternIndex(i);
}
}
List<LXAbstractChannel> getChannels() {
return mixerEngine.getChannels();
}
/* configureGeneratorOutput */
void configureGeneratorOutput() {
PrintStream[] outputSockets = new PrintStream[76];
......@@ -165,16 +150,6 @@ abstract class FlightEngine {
}
/** EngineController Class **/
class EngineController {
LX lx;
EngineController(LX lx) {
this.lx = lx;
}
}
/** FFAutomationClip Class **/
class FFAutomationClip extends LXClip {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment