Mercurial > hg > nodescore
changeset 21:aaf429469697
startup script and fixes to thumbnail generation paths
author | tzara <rc-web@kiben.net> |
---|---|
date | Tue, 10 Jul 2012 22:34:11 +0100 |
parents | 9daa1ac0af33 |
children | bb02a593b7d5 |
files | nodescore nodescore.js ss2thumb.sh www/m/img/thumbs/1.png www/m/img/thumbs/2.png www/m/img/thumbs/3.png www/m/img/thumbs/4.png www/m/img/thumbs/5.png www/m/img/thumbs/6.png www/m/js/nodescore-client.js www/m/seta.html www/m/seta/img/1280x800/music1.jpg www/m/seta/img/1280x800/music2.jpg www/m/seta/img/1280x800/music3.jpg www/m/seta/img/1280x800/music4.jpg www/m/seta/img/1280x800/music5.jpg www/m/seta/img/thumbs/1.png www/m/seta/img/thumbs/2.png www/m/seta/img/thumbs/3.png www/m/seta/img/thumbs/4.png www/m/seta/img/thumbs/5.png www/m/seta/img/thumbs/6.png www/m/seta/music.html |
diffstat | 23 files changed, 83 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nodescore Tue Jul 10 22:34:11 2012 +0100 @@ -0,0 +1,24 @@ +#!/bin/bash + +# calls phantomjs to make screenshots +# of each anchor in PROJECT then calls +# imagemagick to resize them for preview +# panel. The size of the screenshot +# is defined in rasterize.js + +# nodescore@kiben.net +# nodescore.kiben.net + +SERVER='http://192.168.1.84:8889' +BASEDIR='www/m' +PROJECT='seta' +THUMBPATH=$BASEDIR/$PROJECT/img/thumbs + +if [ ! -f $BASEDIR/$PROJECT/music.html ]; + then echo create $BASEDIR/$PROJECT/music.html and add some music + exit 0; +fi + +node nodescore.js & +sleep 2; +sh ss2thumb.sh $PROJECT $SERVER; \ No newline at end of file
--- a/nodescore.js Tue Jul 10 14:16:12 2012 +0100 +++ b/nodescore.js Tue Jul 10 22:34:11 2012 +0100 @@ -1,8 +1,12 @@ +/* //////////////////////////////////////////// -// nodescore server -- nodescore.kiben.net + +nodescore server +nodescore.kiben.net +nodescore@kiben.net + //////////////////////////////////////////// -// rc@kiben.net -//////////////////////////////////////////// +*/ var sio = require('socket.io') , http = require('http') @@ -10,7 +14,7 @@ , $ = require('jQuery') , static = require('node-static'); -//////////////////////////////////////////// + // run webserver serving static html //////////////////////////////////////////// @@ -174,6 +178,7 @@ seq.metrobeat = (seq.metrobeat+1)%seq.beatsinbar ; socket.broadcast.emit('metroPulse', tempoms, seq.voice,seq.metrobeat); socket.emit('metroPulse', tempoms, seq.voice,seq.metrobeat); +// socket.broadcast.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter); } // flip the page @@ -182,11 +187,9 @@ socket.emit('counterText', seq.voice, seq.counter, " "); seq.counter = (seq.counter + 1) % seq.durations.length socket.broadcast.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter); - socket.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter); - delete tock; - +// socket.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter); + delete tock; step(seq); - } if (ztime < 0){}
--- a/ss2thumb.sh Tue Jul 10 14:16:12 2012 +0100 +++ b/ss2thumb.sh Tue Jul 10 22:34:11 2012 +0100 @@ -1,11 +1,33 @@ #!/bin/bash -SERVER='http://192.168.1.84:8889' -PROJECT="m/seta.html#" -for each in 1 2 3 4 5 6; +# calls phantomjs to make screenshots +# of each anchor in PROJECT then calls +# imagemagick to resize them for preview +# panel. The size of the screenshot +# is defined in rasterize.js + +# nodescore@kiben.net +# nodescore.kiben.net + +SERVER=$2 +BASEDIR='m' +PROJECT=$1 +THUMBPATH=www/$BASEDIR/$PROJECT/img/thumbs + +if [ ! -d $THUMBPATH ]; + echo creating $THUMBPATH + then mkdir -p $THUMBPATH; +fi + +ANCHORS=`grep '<a' www/$BASEDIR/$PROJECT/music.html|wc -l` + +for each in $(seq 1 $ANCHORS); + do -echo $SERVER/$PROJECT$each -phantomjs rasterize.js $SERVER/$PROJECT$each $each.png -mogrify -scale 30% $each.png -mv $each.png www/m/img/thumbs/ + echo phantomjs rasterize.js $SERVER/$BASEDIR/$PROJECT/music.html#$each $each.png + + phantomjs rasterize.js $SERVER/$BASEDIR/$PROJECT/music.html#$each $each.png + mogrify -scale 30% $each.png + mv $each.png www/$BASEDIR/$PROJECT/img/thumbs/ + done \ No newline at end of file
--- a/www/m/js/nodescore-client.js Tue Jul 10 14:16:12 2012 +0100 +++ b/www/m/js/nodescore-client.js Tue Jul 10 22:34:11 2012 +0100 @@ -101,14 +101,14 @@ } function pageTurnB(unit) { - var units=6 - + var units=6; + var section = "seta/" var next=(((unit+1)%units)+units)%units console.log("HOP TURN" + unit+ "next:" + next); // $("#live").html($("#unit"+unit).html()); - $("#live").load("seta.html #"+unit +" *"); + $("#live").load(section+"music.html #"+unit +" *"); - $("#preview").html('<img src=' + "img/thumbs/"+next + ".png" + '>'); + $("#preview").html('<img src=' + section+"img/thumbs/"+next + ".png" + '>'); } ////////////////////////////////////////////////
--- a/www/m/seta.html Tue Jul 10 14:16:12 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - -</head> - -<body> - <a data-role="page" id="1"><div id="unit01"> <img src="img/1280x800/music1.jpg" width="1280px"/> </div></a> - <a data-role="page" id="2"><div id="unit02"> <img src="img/1280x800/music2.jpg" width="1280px"/> </div></a> - <a data-role="page" id="3"><div id="unit03"> <img src="img/1280x800/music3.jpg" width="1280px"/> </div></a> - <a data-role="page" id="4"><div id="unit04"> <img src="img/1280x800/music4.jpg" width="1280px"/> </div></a> - <a data-role="page" id="5"><div id="unit05"> <img src="img/1280x800/music5.jpg" width="1280px"/> </div></a> - <a data-role="page" id="6"><div id="unit06"> <img src="img/1280x800/music1.jpg" width="1280px"/> </div></a> -</body> -</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/m/seta/music.html Tue Jul 10 22:34:11 2012 +0100 @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<head> + +</head> + +<body> + <a data-role="page" id="1"><div id="unit01"> <img src="img/1280x800/music1.jpg" width="1280px"/> </div></a> + <a data-role="page" id="2"><div id="unit02"> <img src="img/1280x800/music2.jpg" width="1280px"/> </div></a> + <a data-role="page" id="3"><div id="unit03"> <img src="img/1280x800/music3.jpg" width="1280px"/> </div></a> + <a data-role="page" id="4"><div id="unit04"> <img src="img/1280x800/music4.jpg" width="1280px"/> </div></a> + <a data-role="page" id="5"><div id="unit05"> <img src="img/1280x800/music5.jpg" width="1280px"/> </div></a> + <a data-role="page" id="6"><div id="unit06"> <img src="img/1280x800/music1.jpg" width="1280px"/> </div></a> +</body> +</html>