Permalink
Browse files

add indicator for flashlight activity

- some minor clean-ups
If no other bugs appear this will probably be the next release

Signed-off-by: Stefan Nussbaumer <st9fan@gmail.com>
  • Loading branch information...
nuss committed Jan 25, 2017
1 parent ea43bad commit 2a626eadf1a1cca1b871ed73666cc0559df8fa21
Showing with 26 additions and 15 deletions.
  1. +1 −1 app/build.gradle
  2. BIN app/src/main/assets/light_on.png
  3. +25 −14 app/src/main/java/net/videosc/VideOSCUI.java
View
@@ -16,7 +16,7 @@ android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("app-release", "VideOSC-1.1-rc2")
output.outputFile.name.replace("app-release", "VideOSC-1.1-rc3")
// output.outputFile.name.replace("app-", "VideOSC-")
)
}
Binary file not shown.
@@ -20,6 +20,7 @@
private static PImage startBut;
private static PImage stopBut;
private static PImage lightBut;
private static PImage lightButOn;
private static PImage interaction;
private static PImage interactionplus;
private static PImage infoBut;
@@ -73,6 +74,7 @@ static void loadUIImages(PApplet applet) {
startBut = applet.loadImage("start.png");
stopBut = applet.loadImage("stop.png");
lightBut = applet.loadImage("light.png");
lightButOn = applet.loadImage("light_on.png");
infoBut = applet.loadImage("i.png");
interaction = applet.loadImage("interaction.png");
interactionplus = applet.loadImage("interactionplus.png");
@@ -114,13 +116,20 @@ static void drawRGBUI(PApplet applet) {
applet.stroke(0, 0);
applet.fill(0, 153);
applet.rect(uiXright, 0, 60 * density, applet.height);
if (play) {
applet.image(stopBut, uiXright + dc((stopBut.width / 2) + 20), applet.height / 12, dc(stopBut.width), dc(stopBut.height));
} else {
applet.image(startBut, uiXright + dc((startBut.width / 2) + 20), applet.height / 12, dc(startBut.width), dc(startBut.height));
}
applet.image(lightBut, uiXright + dc((lightBut.width / 2) + 20), applet.height / 6 + applet.height /
12, dc(lightBut.width), dc(lightBut.height));
if (play)
applet.image(stopBut, uiXright + dc((stopBut.width / 2) + 20),
applet.height / 12, dc(stopBut.width), dc(stopBut.height));
else
applet.image(startBut, uiXright + dc((startBut.width / 2) + 20),
applet.height / 12, dc(startBut.width), dc(startBut.height));
if (cam.isFlashEnabled())
applet.image(lightButOn, uiXright + dc((lightBut.width / 2) + 20),
applet.height / 6 + applet.height / 12, dc(lightBut.width), dc(lightBut.height));
else
applet.image(lightBut, uiXright + dc((lightBut.width / 2) + 20),
applet.height / 6 + applet.height / 12, dc(lightBut.width), dc(lightBut.height));
if (negative) {
localRGB = rgbButNeg;
@@ -136,21 +145,23 @@ static void drawRGBUI(PApplet applet) {
rgbButInMenuX = (int) (uiXright + dc((rgbBut.width / 2) + 20));
rgbButInMenuY = applet.height / 6 * 2 + applet.height / 12;
if (rgbMode.equals(RGBModes.RGB)) {
if (rgbMode.equals(RGBModes.RGB))
applet.image(localRGB, rgbButInMenuX, rgbButInMenuY, dc(localRGB.width), dc(localRGB.height));
} else if (rgbMode.equals(RGBModes.R)) {
else if (rgbMode.equals(RGBModes.R))
applet.image(localR, rgbButInMenuX, rgbButInMenuY, dc(localR.width), dc(localR.height));
} else if (rgbMode.equals(RGBModes.G)) {
else if (rgbMode.equals(RGBModes.G))
applet.image(localG, rgbButInMenuX, rgbButInMenuY, dc(localG.width), dc(localG.width));
} else if (rgbMode.equals(RGBModes.B)) {
else if (rgbMode.equals(RGBModes.B))
applet.image(localB, rgbButInMenuX, rgbButInMenuY, dc(localB.width), dc(localB.height));
}
if (mode.equals(InteractionModes.BASIC))
applet.image(interaction, uiXright + dc((infoBut.width / 2) + 20), applet.height / 6 * 3 +
applet.height / 12, dc(interaction.width), dc(interaction.height));
else if (mode.equals(InteractionModes.SINGLE_PIXEL))
applet.image(interactionplus, uiXright + dc((interactionplus.width / 2) + 20), applet.height / 6 * 3 +
applet.height / 12, dc(interactionplus.width), dc(interactionplus.height));
applet.image(infoBut, uiXright + dc((infoBut.width / 2) + 20), applet.height / 6 * 4 + applet.height
/ 12, dc(infoBut.width), dc(infoBut.height));
applet.image(settingsBut, uiXright + dc((settingsBut.width / 2) + 20), applet.height / 6 * 5
@@ -257,9 +268,9 @@ static void processUIClicks(PApplet applet, int x, int y, KetaiSQLite db) {
int leftX = VideOSCSensors.numActiveSensors > 0 ? 400 : 250;
int rightX = VideOSCSensors.numActiveSensors > 0 ? 500 : 350;
if (!rgbMode.equals(RGBModes.RGB) && x <= dc(rightX) && x >= dc(leftX) && y <= uiYtop + dc(50)) {
if (!rgbMode.equals(RGBModes.RGB) && x <= dc(rightX) && x >= dc(leftX) && y <= uiYtop + dc(50))
showFB = !showFB;
}
}
}

0 comments on commit 2a626ea

Please sign in to comment.