Skip to content

Commit

Permalink
Merge pull request #10 from heronarts/dev
Browse files Browse the repository at this point in the history
Merge release 0.2.1
  • Loading branch information
mcslee authored Oct 22, 2020
2 parents 88ba91a + e144766 commit 243c7ec
Show file tree
Hide file tree
Showing 24 changed files with 585 additions and 84 deletions.
12 changes: 9 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.2.1
October 22, 2020
- COVID lockdown
- Improvements to fixture/structure/JSON system
- Many tweaks and improvements, new patterns/effects

0.2.0
May 28, 2020
- Lots of API cleanups
Expand All @@ -6,12 +12,12 @@ May 28, 2020

0.1.2
August 20, 2018
- Fix bug with onActive/onInactive messages when pattern is deleted.
-Fix bug with onActive/onInactive messages when pattern is deleted.

0.1.1
August 15, 2018
- Dropping alpha tag, updating release packaging with VERSION and LICENSE files.
-Dropping alpha tag, updating release packaging with VERSION and LICENSE files.

0.1.0-alpha
August 13, 2018
- Initial release cut for tracking versioned changes across the LX repositories.
-Initial release cut for tracking versioned changes across the LX repositories.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>heronarts</groupId>
<artifactId>p3lx</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
<packaging>jar</packaging>

<properties>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/heronarts/p3lx/P3LX.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ public P3LX(PApplet applet, Flags flags, LXModel model) {
LX.initProfiler.log("P3LX: registerMethod");
}

@Override
protected void showConfirmUnsavedProjectDialog(String message, Runnable confirm) {
this.ui.showConfirmDialog(
"Your project has unsaved changes, really " + message + "?",
confirm
);
}

/**
* Subclass may override.
*
Expand Down
23 changes: 0 additions & 23 deletions src/main/java/heronarts/p3lx/ui/CustomDeviceUI.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/heronarts/p3lx/ui/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ private boolean isMapping() {
return this.midiMapping || this.modulationSourceMapping || this.modulationTargetMapping || this.triggerSourceMapping || this.triggerTargetMapping;
}

void setMouseoverHelpText(String helpText) {
public void setMouseoverHelpText(String helpText) {
if (!isMapping()) {
this.contextualHelpText.setValue(helpText);
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/heronarts/p3lx/ui/UI3dContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class UI3dContext extends UIObject implements LXSerializable, UITabFocus
public static final int NUM_CAMERA_POSITIONS = 6;

public static interface MovementListener {
public void reset();
public void translate(float x, float y, float z);
public void rotate(float theta, float phi);
}
Expand Down Expand Up @@ -216,7 +217,7 @@ public String toString() {
*/
private final List<MovementListener> movementListeners = new ArrayList<MovementListener>();

public final void addMovementistener(MovementListener listener) {
public final void addMovementListener(MovementListener listener) {
Objects.requireNonNull(listener, "Cannot add null UI3dContext.MovementListener");
if (this.movementListeners.contains(listener)) {
throw new IllegalStateException("Cannot add duplicate UI3dContext.MovementListener: " + listener);
Expand Down Expand Up @@ -937,6 +938,9 @@ protected void onMousePressed(MouseEvent mouseEvent, float mx, float my) {
if (mouseEvent.getCount() > 1) {
focus(mouseEvent);
}
for (MovementListener listener : this.movementListeners) {
listener.reset();
}
}

private void updateFocusedCamera() {
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/heronarts/p3lx/ui/UIKeyEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Copyright 2018- Mark C. Slee, Heron Arts LLC
*
* This file is part of the LX Studio software library. By using
* LX, you agree to the terms of the LX Studio Software License
* and Distribution Agreement, available at: http://lx.studio/license
*
* Please note that the LX license is not open-source. The license
* allows for free, non-commercial use.
*
* HERON ARTS MAKES NO WARRANTY, EXPRESS, IMPLIED, STATUTORY, OR
* OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF
* MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR A PARTICULAR
* PURPOSE, WITH RESPECT TO THE SOFTWARE.
*
* ##library.name##
* ##library.sentence##
* ##library.url##
*
* @author ##author##
* @modified ##date##
* @version ##library.prettyVersion## (##library.version##)
*/

package heronarts.p3lx.ui;

import processing.core.PConstants;
import processing.event.KeyEvent;

public class UIKeyEvent {
// Should never be instantiated
private UIKeyEvent() {}

public static boolean isCommand(KeyEvent keyEvent) {
return keyEvent.isMetaDown() || keyEvent.isControlDown();
}

public static boolean isDelete(KeyEvent keyEvent, int keyCode) {
// NOTE(mcslee): there is serious hackiness under here, P3D surface uses
// JOGL key codes, and Processing remaps the character values but not the
// key codes...
//
// See PSurfaceJOGL hackToChar:
// https://github.com/processing/processing/blob/4cc297c66908899cd29480c202536ecf749854e8/core/src/processing/opengl/PSurfaceJOGL.java#L1187
return
(keyCode == java.awt.event.KeyEvent.VK_BACK_SPACE) ||
(keyEvent.getKey() == PConstants.DELETE);
}
}
43 changes: 43 additions & 0 deletions src/main/java/heronarts/p3lx/ui/UIMouseEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Copyright 2018- Mark C. Slee, Heron Arts LLC
*
* This file is part of the LX Studio software library. By using
* LX, you agree to the terms of the LX Studio Software License
* and Distribution Agreement, available at: http://lx.studio/license
*
* Please note that the LX license is not open-source. The license
* allows for free, non-commercial use.
*
* HERON ARTS MAKES NO WARRANTY, EXPRESS, IMPLIED, STATUTORY, OR
* OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF
* MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR A PARTICULAR
* PURPOSE, WITH RESPECT TO THE SOFTWARE.
*
* ##library.name##
* ##library.sentence##
* ##library.url##
*
* @author ##author##
* @modified ##date##
* @version ##library.prettyVersion## (##library.version##)
*/

package heronarts.p3lx.ui;

import processing.event.MouseEvent;

public class UIMouseEvent {
private UIMouseEvent() {}

public static boolean isCommand(MouseEvent mouseEvent) {
return mouseEvent.isMetaDown() || mouseEvent.isControlDown();
}

public static boolean isMultiSelect(MouseEvent mouseEvent) {
return mouseEvent.isMetaDown() || mouseEvent.isControlDown();
}

public static boolean isRangeSelect(MouseEvent mouseEvent) {
return mouseEvent.isShiftDown();
}
}
37 changes: 35 additions & 2 deletions src/main/java/heronarts/p3lx/ui/component/UIButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,30 @@ public Action(float w, float h) {
this(0, 0, w, h);
}

public Action(float w, float h, String label) {
this(0, 0, w, h, label);
}

public Action(float x, float y, float w, float h) {
super(x, y, w, h);
setBorderRounding(8);
setMomentary(true);
}

public Action(float x, float y, float w, float h, String label) {
this(x, y, w, h);
setLabel(label);
}

}

public static class Trigger extends UIButton {

public static final int HEIGHT = 12;
public static final int WIDTH = 16;

private LXParameter controlTarget = null;

public Trigger(UI ui, float x, float y) {
this(ui, null, x, y);
}
Expand All @@ -75,6 +87,19 @@ public Trigger(UI ui, BooleanParameter trigger, float x, float y) {
setParameter(trigger);
}
}

public Trigger setControlTarget(LXParameter controlTarget) {
this.controlTarget = controlTarget;
return this;
}

@Override
public LXParameter getControlTarget() {
if (this.controlTarget != null) {
return this.controlTarget;
}
return super.getControlTarget();
}
}

protected boolean active = false;
Expand Down Expand Up @@ -379,13 +404,21 @@ protected UIButton setActive(boolean active, boolean pushToParameter) {
if (pushToParameter) {
if (this.enumParameter != null) {
if (active) {
getLX().command.perform(new LXCommand.Parameter.Increment(this.enumParameter));
if (this.useCommandEngine) {
getLX().command.perform(new LXCommand.Parameter.Increment(this.enumParameter));
} else {
this.enumParameter.increment();
}
}
} else if (this.booleanParameter != null) {
if (this.isMomentary) {
this.booleanParameter.setValue(active);
} else {
getLX().command.perform(new LXCommand.Parameter.SetNormalized(this.booleanParameter, active));
if (this.useCommandEngine) {
getLX().command.perform(new LXCommand.Parameter.SetNormalized(this.booleanParameter, active));
} else {
this.booleanParameter.setValue(active);
}
}

}
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/heronarts/p3lx/ui/component/UIButtonGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,17 @@ public UIButtonGroup(final DiscreteParameter parameter, float x, float y, float
public void onToggle(boolean enabled) {
if (!inParameterUpdate) {
if (enabled) {
getLX().command.perform(new LXCommand.Parameter.SetValue(parameter, iv));
if (this.useCommandEngine) {
getLX().command.perform(new LXCommand.Parameter.SetValue(parameter, iv));
} else {
parameter.setValue(iv);
}
} else if (hideFirst) {
getLX().command.perform(new LXCommand.Parameter.SetValue(parameter, 0));
if (this.useCommandEngine) {
getLX().command.perform(new LXCommand.Parameter.SetValue(parameter, 0));
} else {
parameter.setValue(0);
}
}
}
}
Expand Down
Loading

0 comments on commit 243c7ec

Please sign in to comment.