Commit 93a16484 authored by Michael Murtaugh's avatar Michael Murtaugh

server with displayimage and figlet

parent 22b9b307
#!/bin/bash
feh --no-fehbg --bg-max $1
......@@ -6,7 +6,8 @@ var fs = require("fs"),
nstatic = require('node-static'),
util = require('util'),
extend = require("extend"),
cascadecollage = require("./cascadecollage");
cascadecollage = require("./cascadecollage"),
spawn = require('child_process').spawn;
var opts = {
port: 10987
......@@ -47,7 +48,8 @@ function handler (req, res) {
res.end();
}
} else {
console.log('[static] %s', req.url);
// too much info for the server display
// console.log('[static] %s', req.url);
}
});
}
......@@ -76,33 +78,55 @@ function broadcast (msg, data, exclude) {
}
}
function showimage (path) {
spawn('scripts/showimage', [path]);
}
function figlet (text) {
var f = spawn('figlet', [text]);
f.stdout.setEncoding("utf8")
f.stdout.on("data", function (data) {
console.log(data);
})
}
var cc = cascadecollage(extend(opts, {
cameraimage: function (path) {
broadcast("cameraimage", {src: path});
showimage(path);
},
countdown: function (path) {
broadcast("countdown", {});
},
watch: function (path) {
broadcast("watch", {});
figlet("watching");
},
record: function (path) {
broadcast("record", {});
figlet("recording");
},
analyze: function (path) {
broadcast("analyze", {});
figlet("analyzing");
},
match: function (path) {
broadcast("match", {});
},
collage: function (path) {
broadcast("collage", {});
figlet("creating collage");
},
cleanup: function (path) {
broadcast("cleanup", {});
figlet("cleaning up");
},
imagedata: function (data) {
broadcast("imagedata", data);
},
annotatedcameraframe: function (path) {
broadcast("annotatedcameraframe", {src: path});
showimage(path);
},
archiveframe: function (img, cf, af) {
broadcast("archiveframe", {src: img, cf: cf, af:af});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment