Skip to content

Commit

Permalink
Merge pull request #11 from heronarts/dev
Browse files Browse the repository at this point in the history
Merge 0.2.2 release
  • Loading branch information
mcslee authored Nov 23, 2021
2 parents 243c7ec + 9fab0c9 commit ae278a1
Show file tree
Hide file tree
Showing 23 changed files with 429 additions and 56 deletions.
1 change: 0 additions & 1 deletion .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013-2020 Mark C. Slee, Heron Arts LLC
Copyright 2013-2021 Mark C. Slee, Heron Arts LLC

LX STUDIO SOFTWARE LICENSE AND DISTRIBUTION AGREEMENT

Expand Down
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@ Directly working with the P3LX library is only recommended for advanced users of

### Development Environment ###

The recommended IDE for LX is Eclipse, with simple `ant` tasks for command-line build. Create a folder to work in and clone both the LX and P3LX repositories side-by-side.
The recommended IDE for LX is Eclipse, using `mvn` for command-line build. Create a folder to work in and clone both the LX and P3LX repositories side-by-side.
```
$ mkdir workspace
$ cd workspace
$ git clone https://github.com/heronarts/LX.git
$ git clone https://github.com/heronarts/P3LX.git
```

To build the project:
```
$ cd P3LX/build
$ ant
$ cp ../bin/P3LX.jar <wherever you need it>
```

To open the project in Eclipse:
```
File | Import...
Expand All @@ -36,14 +29,19 @@ Select root directory...

Go through this process for both the LX and P3LX projects, selecting `workspace/LX` and `workspace/P3LX` as the root directories.

#### Alternate build process: Maven ####
#### Maven Build Process ####

First: Install Maven for your platform. Google is your friend.

You'll still want to check out both LX and this repo locally (as of this writing neither is published to a public Maven repo):
P3LX depends upon the Processing core library JAR file, which is not available in Maven central. First, you will need to install this to your local Maven repository using the `mvn validate` command.
```
$ git clone https://github.com/heronarts/LX.git
$ git clone https://github.com/heronarts/P3LX.git
$ cd LX
$ cd P3LX
# mvn validate
```

Once you have done this, you can build and install both the LX and P3LX packages
```
$ cd ../LX
$ mvn install
$ cd ../P3LX
$ mvn install
Expand All @@ -58,6 +56,15 @@ in `P3LX/target`:

The Maven build is IDE-agnostic, so any IDE that can import Maven projects (Eclipse, IntelliJ) should have no problem importing and building this repo.

#### Deployment ####

Deployment requires access to the central Sonatype repository and appropriate GPG keys.

```
$ cd P3LX
$ mvn deploy -Pdeploy
```

### Contact and Collaboration ###

Building a big cool project? I'm probably interested in hearing about it! Want to solicit some help, request new framework features, or just ask a random question? Drop me a line: mark@heronarts.com
Expand Down
6 changes: 6 additions & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.2.2
November 22, 2021
- Refactor to LXFixture output layer
- Enable merging of multiple protocol packets across fixtures
- Various bugfixes

0.2.1
October 22, 2020
- COVID lockdown
Expand Down
4 changes: 2 additions & 2 deletions build/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ classpath.local.location=classpath
# and project classpath, use a comma as delimiter. These jar files must be
# inside your classpath.local.location folder.

classpath.local.include=core-3.3.7.jar,jogl-all-2.3.2.jar
classpath.local.include=core-3.5.4.jar,jogl-all-2.3.2.jar


# Add processing's libraries folder to the classpath.
Expand Down Expand Up @@ -154,4 +154,4 @@ tested.processingVersion=3.0.1

javadoc.java.href=http://docs.oracle.com/javase/8/docs/api/
javadoc.processing.href=https://processing.github.io/processing-javadocs/core/
javadoc.gson.href=https://static.javadoc.io/com.google.code.gson/gson/2.8.6/
javadoc.gson.href=https://static.javadoc.io/com.google.code.gson/gson/2.8.9/
6 changes: 3 additions & 3 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ ${line}

<target name="generate.javadoc">
<!-- create the java reference of the library -->
<javadoc bottom="Processing library ${project.name} by ${author.name}. ${library.copyright}" classpath="${classpath.local.location}/core-3.3.7.jar;${classpath.local.location}/jogl-all-2.3.2.jar;${project.lib}/coremidi4j-1.4.jar;${project.lib}/gson-2.8.0.jar;{project.bin}" destdir="${project.tmp}/${project.name}/reference" verbose="false" stylesheetfile="build/stylesheet.css" doctitle="${project.name} API Specification" version="false" windowtitle="${project.name} API">
<javadoc bottom="Processing library ${project.name} by ${author.name}. ${library.copyright}" classpath="${classpath.local.location}/core-3.5.4.jar;${classpath.local.location}/jogl-all-2.3.2.jar;${project.lib}/coremidi4j-1.6.jar;${project.lib}/gson-2.8.9.jar;{project.bin}" destdir="${project.tmp}/${project.name}/reference" verbose="false" stylesheetfile="build/stylesheet.css" doctitle="${project.name} API Specification" version="false" windowtitle="${project.name} API">

<link href="${javadoc.java.href}" />
<link href="${javadoc.processing.href}" />
Expand Down Expand Up @@ -237,8 +237,8 @@ ${line}
<jar jarfile="${project.bin}/${project.jar.name}" basedir="${project.bin}">
<fileset dir="${basedir}" includes="LICENSE VERSION" />
<fileset dir="${project.resources}" includes="data/**" />
<zipgroupfileset dir="${project.lib}" includes="coremidi4j-1.4.jar" />
<zipgroupfileset dir="${project.lib}" includes="gson-2.8.6.jar" />
<zipgroupfileset dir="${project.lib}" includes="coremidi4j-1.6.jar" />
<zipgroupfileset dir="${project.lib}" includes="gson-2.8.9.jar" />
</jar>
</target>

Expand Down
Binary file removed classpath/core-3.3.7.jar
Binary file not shown.
Binary file added classpath/core-3.5.4.jar
Binary file not shown.
106 changes: 98 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,47 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>heronarts</groupId>
<groupId>com.heronarts</groupId>
<artifactId>p3lx</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<packaging>jar</packaging>

<name>P3LX</name>
<description>Libraries for real-time procedural 3-D lighting animation and control.</description>
<url>http://lx.studio</url>

<licenses>
<license>
<name>LX Studio Software License and Distribution Agreement</name>
<url>http://lx.studio/license</url>
</license>
</licenses>

<developers>
<developer>
<name>Mark Slee</name>
<email>mark@heronarts.com</email>
<organization>Heron Arts</organization>
<organizationUrl>http://github.com/heronarts/</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/heronarts/P3LX.git</connection>
<developerConnection>scm:git:git://github.com/heronarts/P3LX.git</developerConnection>
<url>http://github.com/heronarts/P3LX/tree/master</url>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand All @@ -22,7 +59,7 @@

<dependencies>
<dependency>
<groupId>heronarts</groupId>
<groupId>com.heronarts</groupId>
<artifactId>lx</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
Expand All @@ -38,14 +75,36 @@
<dependency>
<groupId>org.processing</groupId>
<artifactId>core</artifactId>
<version>3.3.7</version>
<version>3.5.4</version>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<groupId>org.processing</groupId>
<artifactId>core</artifactId>
<version>3.5.4</version>
<packaging>jar</packaging>
<file>${basedir}/classpath/core-3.5.4.jar</file>
<generatePom>true</generatePom>
</configuration>
<executions>
<execution>
<id>install-jar-lib</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -71,7 +130,7 @@
</execution>
</executions>
<configuration>
<bottom>P3LX library by Mark C. Slee. (C) 2012-2020</bottom>
<bottom>P3LX library by Mark C. Slee. &#169; 2012-2021</bottom>
<verbose>false</verbose>
<stylesheetfile>build/stylesheet.css</stylesheetfile>
<doctitle>P3LX API Specification</doctitle>
Expand Down Expand Up @@ -114,9 +173,40 @@
</goals>
</execution>
</executions>
</plugin>

</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>deploy</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
35 changes: 21 additions & 14 deletions src/main/java/heronarts/p3lx/P3LX.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static String version() {
public static class Flags extends LX.Flags {
public boolean keyboardTempo = false;
public boolean showFramerate = false;
public boolean headless = false;

public Flags(PApplet applet) {
this.isP3LX = true;
Expand Down Expand Up @@ -121,23 +122,31 @@ public P3LX(PApplet applet, Flags flags, LXModel model) {
this.uiFrame = new LXEngine.Frame(this);
this.engine.getFrameNonThreadSafe(this.uiFrame);

this.ui = buildUI();
LX.initProfiler.log("P3LX: UI");

applet.colorMode(PConstants.HSB, 360, 100, 100, 100);
LX.initProfiler.log("P3LX: colorMode");

applet.registerMethod("draw", this);
applet.registerMethod("dispose", this);
LX.initProfiler.log("P3LX: registerMethod");

if (flags.headless) {
this.ui = null;
} else {
this.ui = buildUI();
LX.initProfiler.log("P3LX: UI");
}

applet.colorMode(PConstants.HSB, 360, 100, 100, 100);
LX.initProfiler.log("P3LX: colorMode");
}

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

/**
Expand All @@ -156,10 +165,8 @@ protected UI buildUI() {
*/
@Override
public void dispose() {
// TODO(mclsee): possible bug here, this is called on the processing UI
// thread but the LX.dispose() method expects to be run on the LX engine
// thread. Not a big deal since we're already quitting at this point,
// but could be slightly improved.
// Stops and joins the LX engine thread, if separate
this.engine.onP3DidDispose();
super.dispose();
}

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/heronarts/p3lx/ui/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,13 @@ public PFont loadFont(String font) {
}

void redraw(UI2dComponent object) {
this.threadSafeRedrawList.add(object);
// NOTE(mcslee): determined empirically that it's worth putting this check here
// to avoid contention on this synchronized list between the UI and engine threads.
// adding the same container to be redrawn loads of times slows down. keeping the
// redraw list short is better.
if (!this.threadSafeRedrawList.contains(object)) {
this.threadSafeRedrawList.add(object);
}
}

public void resize(int width, int height) {
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/heronarts/p3lx/ui/UITheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ public class UITheme {
public final PImage iconPreferences;

UITheme(PApplet applet) {
this.controlFont = applet.loadFont("ArialUnicodeMS-10.vlw");
// this.controlFont = applet.loadFont("ArialUnicodeMS-10.vlw");
this.controlFont = applet.createFont("Inter-SemiBold.ttf", 10);
LX.initProfiler.log("P3LX: UI: Theme: controlFont");
this.labelFont = this.deviceFont = this.windowTitleFont = applet.loadFont("Arial-Black-9.vlw");

// this.labelFont = this.deviceFont = this.windowTitleFont = applet.loadFont("Arial-Black-9.vlw");
this.labelFont = this.deviceFont = this.windowTitleFont = applet.createFont("Inter-Black.ttf", 10);
LX.initProfiler.log("P3LX: UI: Theme: windowTitleFont");

this.iconNote = applet.loadImage("icon-note.png");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public UICollapsibleSection(UI ui, float x, float y, float w, float h) {
setFocusBackgroundColor(ui.theme.getDeviceFocusedBackgroundColor());
setBorderRounding(4);

this.title = new UILabel(PADDING, PADDING + 1, this.width - PADDING - CHEVRON_PADDING, TITLE_LABEL_HEIGHT);
this.title.setTextAlignment(PConstants.LEFT, PConstants.TOP).setTextOffset(0, 1);
this.title = new UILabel(PADDING, PADDING, this.width - PADDING - CHEVRON_PADDING, TITLE_LABEL_HEIGHT);
this.title.setTextAlignment(PConstants.LEFT, PConstants.TOP);
addTopLevelComponent(this.title);

setHeight(this.expandedHeight = (int) Math.max(CLOSED_HEIGHT, h));
Expand Down
Loading

0 comments on commit ae278a1

Please sign in to comment.