Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #11 from praxis-live/develop
Browse files Browse the repository at this point in the history
Merge develop to master for v4.1.0 release
  • Loading branch information
neilcsmith-net authored Aug 24, 2018
2 parents 851098f + 8edc25c commit cb22635
Show file tree
Hide file tree
Showing 26 changed files with 2,025 additions and 91 deletions.
2 changes: 1 addition & 1 deletion lib.processing/manifest.mf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
OpenIDE-Module: processing.core
OpenIDE-Module-Localizing-Bundle: processing/core/Bundle.properties
OpenIDE-Module-Specification-Version: 3.3.7
OpenIDE-Module-Specification-Version: 3.4.0

Binary file modified lib.processing/release/modules/ext/core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ app.icon=branding/core/core.jar/org/netbeans/core/startup/frame48.gif
app.name=${branding.token}
app.title=praxis
app.conf=praxis.conf
app.version=4.0.0
app.version=4.1.0
auxiliary.org-netbeans-modules-apisupport-installer.license-type=no
auxiliary.org-netbeans-modules-apisupport-installer.os-linux=true
auxiliary.org-netbeans-modules-apisupport-installer.os-macosx=false
Expand Down
2 changes: 1 addition & 1 deletion praxis.audio/src/org/praxislive/audio/AudioPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected final void breakConnection(Input port, Pipe source) {
public static class Provider implements Port.TypeProvider {

@Override
public Stream<Type> types() {
public Stream<Type<?>> types() {
return Stream.of(new Port.Type<>(AudioPort.class));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.praxislive.code.DataPort$Provider
87 changes: 73 additions & 14 deletions praxis.code/src/org/praxislive/code/CodeConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.praxislive.code.userapi.AuxIn;
import org.praxislive.code.userapi.AuxOut;
import org.praxislive.code.userapi.Config;
import org.praxislive.code.userapi.Data;
import org.praxislive.code.userapi.ID;
import org.praxislive.code.userapi.In;
import org.praxislive.code.userapi.Inject;
Expand Down Expand Up @@ -267,11 +268,16 @@ protected void analyseField(Field field) {
}

P prop = field.getAnnotation(P.class);
if (prop != null && analysePropertyField(prop, field)) {
return;
}
if (prop != null && analyseCustomPropertyField(prop, field)) {
return;
if (prop != null) {
if (analyseResourcePropertyField(prop, field)) {
return;
}
if (analysePropertyField(prop, field)) {
return;
}
if (analyseCustomPropertyField(prop, field)) {
return;
}
}
T trig = field.getAnnotation(T.class);
if (trig != null && analyseTriggerField(trig, field)) {
Expand Down Expand Up @@ -327,9 +333,15 @@ private boolean analyseInputField(In ann, Field field) {
addPort(odsc);
addControl(InputPortControl.Descriptor.createInput(odsc.getID(), odsc.getIndex(), odsc));
return true;
} else {
return false;
}

DataPort.InputDescriptor din = DataPort.InputDescriptor.create(this, ann, field);
if (din != null) {
addPort(din);
return true;
}

return false;
}

private boolean analyseAuxInputField(AuxIn ann, Field field) {
Expand All @@ -338,29 +350,49 @@ private boolean analyseAuxInputField(AuxIn ann, Field field) {
addPort(odsc);
addControl(InputPortControl.Descriptor.createAuxInput(odsc.getID(), odsc.getIndex(), odsc));
return true;
} else {
return false;
}

DataPort.InputDescriptor din = DataPort.InputDescriptor.create(this, ann, field);
if (din != null) {
addPort(din);
return true;
}

return false;

}

private boolean analyseOutputField(Out ann, Field field) {
OutputImpl.Descriptor odsc = OutputImpl.createDescriptor(this, ann, field);
if (odsc != null) {
addPort(odsc);
return true;
} else {
return false;
}

DataPort.OutputDescriptor dout = DataPort.OutputDescriptor.create(this, ann, field);
if (dout != null) {
addPort(dout);
return true;
}

return false;
}

private boolean analyseAuxOutputField(AuxOut ann, Field field) {
OutputImpl.Descriptor odsc = OutputImpl.createDescriptor(this, ann, field);
if (odsc != null) {
addPort(odsc);
return true;
} else {
return false;
}

DataPort.OutputDescriptor dout = DataPort.OutputDescriptor.create(this, ann, field);
if (dout != null) {
addPort(dout);
return true;
}

return false;

}

private boolean analyseTriggerField(T ann, Field field) {
Expand All @@ -376,6 +408,22 @@ private boolean analyseTriggerField(T ann, Field field) {
return false;
}
}

private boolean analyseResourcePropertyField(P ann, Field field) {
if (field.getAnnotation(Type.Resource.class) != null &&
String.class.equals(field.getType())) {
ResourceProperty.Descriptor<String> rpd =
ResourceProperty.Descriptor.create(this, ann, field, ResourceProperty.getStringLoader());
if (rpd != null) {
addControl(rpd);
if (shouldAddPort(field)) {
addPort(rpd.createPortDescriptor());
}
return true;
}
}
return false;
}

private boolean analysePropertyField(P ann, Field field) {
PropertyControl.Descriptor pdsc
Expand Down Expand Up @@ -411,9 +459,20 @@ private boolean analyseCustomPropertyField(P ann, Field field) {
private boolean analyseInjectField(Inject ann, Field field) {

if (Ref.class.equals(field.getType())) {
ReferenceDescriptor rdsc = RefImpl.Descriptor.create(this, field);
RefImpl.Descriptor rdsc = RefImpl.Descriptor.create(this, field);
if (rdsc != null) {
addReference(rdsc);
addControl(rdsc.getControlDescriptor());
return true;
} else {
return false;
}
}

if (Data.Sink.class.equals(field.getType())) {
DataSink.Descriptor dsdsc = DataSink.Descriptor.create(this, field);
if (dsdsc != null) {
addReference(dsdsc);
return true;
} else {
return false;
Expand Down
13 changes: 9 additions & 4 deletions praxis.code/src/org/praxislive/code/CodeContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ protected void update(long time) {
}
}
}

public void invoke(long time, Invoker invoker) {
public void invoke(long time, Runnable task) {
if (checkActive()) {
update(time);
try {
invoker.invoke();
task.run();
} catch (Exception ex) {
log.log(LogLevel.ERROR, ex);
}
Expand Down Expand Up @@ -404,9 +404,14 @@ public static interface ClockListener {

}

public static interface Invoker {
@Deprecated
public static interface Invoker extends Runnable {

public void invoke();

public default void run() {
invoke();
}

}

Expand Down
Loading

0 comments on commit cb22635

Please sign in to comment.