Skip to content

Commit

Permalink
ConeDown fixes for new NUC
Browse files Browse the repository at this point in the history
Would be best to plug in some kind of audio like headphones so that the audio device registers.  Otherwise it might cause problems.  I disabled the audio on startup but it will fail again when loading a new file.
  • Loading branch information
kanthian committed Oct 15, 2022
1 parent a04f679 commit ee38abe
Show file tree
Hide file tree
Showing 6 changed files with 844 additions and 8 deletions.
4 changes: 1 addition & 3 deletions conedown.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; SetTimer, CheckForExe, 5000 ;frequency
Loop
{
;Process, Exist, ConeDown
;IfWinExist ConeDown
Sleep 30000 ; Sleep first to avoid machine startup timing issues.
Process, Exist, java.exe
if not Errorlevel {
Run, C:\Users\Rainbow\Documents\ConeDown\conedown.bat, C:\Users\Rainbow\Documents\ConeDown
Run, C:\Users\accou\Documents\GitHub\ConeDown\conedown.bat, C:\Users\accou\Documents\GitHub\ConeDown
Sleep 30000
}
}
4 changes: 2 additions & 2 deletions conedown.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cd C:\Users\Rainbow\Documents\ConeDown
"C:\Program Files\Java\jdk1.8.0_181\bin\java" -jar target/conedown-1.0.0-jar-with-dependencies.jar
cd C:\Users\accou\Documents\GitHub\ConeDown
"C:\Program Files\Eclipse Adoptium\jdk-17.0.4.8-hotspot\bin\java" -jar target/conedown-1.0.0-jar-with-dependencies.jar
24 changes: 22 additions & 2 deletions src/main/java/art/lookingup/ConeDown.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import heronarts.lx.LXPattern;
import heronarts.lx.model.LXModel;
import heronarts.lx.studio.LXStudio;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -74,7 +76,14 @@ public static void addLogFileHandler(String prefix) throws IOException {
private static final Logger logger = Logger.getLogger(ConeDown.class.getName());

public static void main(String[] args) {
PApplet.main(ConeDown.class.getName(), args);

//PApplet.main(ConeDown.class.getName(), args);
String[] newArgs = new String[2];
String[] sketchArgs = {"--density=" + 2, "art.lookingup.ConeDown"};
File hdpiFlag = new File("hdpi");
if (hdpiFlag.exists())
pixelDensity = 2;
PApplet.main(concat(sketchArgs, args));
}

private static final String LOG_FILENAME_PREFIX = "lookinguparts";
Expand Down Expand Up @@ -121,9 +130,20 @@ private enum ProjectionMode {
public static Autodio autoAudio;
public static AutodioUI autoAudioUI;

private static int pixelDensity = 2;
static final public boolean FULLSCREEN = false;
static final public int WIDTH = 1024;
static final public int HEIGHT = 768;


@Override
public void settings() {
size(1600, 800, P3D);
if (FULLSCREEN) {
fullScreen(PApplet.P3D);
} else {
size(WIDTH, HEIGHT, PApplet.P3D);
}
pixelDensity(pixelDensity);
}

// Returns the best currently available projection falling back to MIN if non are ready
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/art/lookingup/ConeFirmata.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public static void reloadFirmata(String portName, int numberPins, int startPin,
pinData = new long[numPins];
startPinNum = startPin;

if (portName != null)
return;
device = new FirmataDevice(portName); // using the name of a port
// IODevice device = new FirmataDevice(new NetworkTransport("192.168.1.18:4334")); // using a network address
// subscribe to events using device.addEventListener(...);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/art/lookingup/ui/UIModeSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void onToggle(boolean on) {

if (lx.engine.audio.input != null) {
if (lx.engine.audio.input.device.getObject().isAvailable()) {
lx.engine.audio.enabled.setValue(true);
//lx.engine.audio.enabled.setValue(true);
lx.engine.addLoopTask(new AudioMonitor());
} else {
logger.warning("Audio Input device is not available!");
Expand Down
Loading

0 comments on commit ee38abe

Please sign in to comment.