changeset 20:9daa1ac0af33

seperated content to external html (seta) and fixed thumbnail generation and preview context
author tzara <rc-web@kiben.net>
date Tue, 10 Jul 2012 14:16:12 +0100
parents a56434dee146
children aaf429469697
files nodescore.js ss2thumb.sh www/m/5.html www/m/img/thumbs/1.html.png www/m/img/thumbs/1.png www/m/img/thumbs/2.html.png www/m/img/thumbs/2.png www/m/img/thumbs/3.html.png www/m/img/thumbs/3.png www/m/img/thumbs/4.html.png www/m/img/thumbs/4.png www/m/img/thumbs/5.html.png www/m/img/thumbs/5.png www/m/img/thumbs/6.png www/m/img/thumbs/controls.html.png www/m/js/nodescore-client.js www/m/seta.html
diffstat 17 files changed, 78 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/nodescore.js	Mon Jul 09 19:18:47 2012 +0100
+++ b/nodescore.js	Tue Jul 10 14:16:12 2012 +0100
@@ -154,12 +154,13 @@
 		if (counter > 0 && counter <= outcount ) {              
 		    socket.broadcast.emit('countinFromServer', seq.voice, counter, "","", "white", "transparent");
 		}
+		
 		// remove displayed number with " " at end of both countin/out
+		
 		if (counter == 0 ) {
 		    socket.broadcast.emit('countinFromServer', seq.voice, " ", "","", "white","transparent");
 		}
 		
-	//	console.log(counter + "========" + totaltime)
 		if (counter > (totaltime)-incount  && counter <= totaltime ) {              
 		    socket.broadcast.emit('countinFromServer', seq.voice, counter-(totaltime-incount), "","", "red","gray");	    
 		}
@@ -169,13 +170,14 @@
 		}
 	    	
 		// push out the pulse to metronome	
+
 		seq.metrobeat = (seq.metrobeat+1)%seq.beatsinbar ;
-     		//console.log(seq.metrobeat);
      		socket.broadcast.emit('metroPulse', tempoms, seq.voice,seq.metrobeat); 
 		socket.emit('metroPulse', tempoms, seq.voice,seq.metrobeat);	
 	    }
 	    
 	    // flip the page
+
 	    if (ztime == 0){
 		socket.emit('counterText', seq.voice, seq.counter, " ");
 		seq.counter = (seq.counter + 1) % seq.durations.length	    		
@@ -201,8 +203,6 @@
 	    stopChr();
 	});
 
-
-
 			  };
     
     step = function (seq) {
@@ -220,8 +220,6 @@
 	else console.log("already started...")
     });
 
-    
-
 
     socket.on('resetSeq', function () { 
 	console.log("rrrrreset")
--- a/ss2thumb.sh	Mon Jul 09 19:18:47 2012 +0100
+++ b/ss2thumb.sh	Tue Jul 10 14:16:12 2012 +0100
@@ -1,11 +1,11 @@
 #!/bin/bash
-SERVER='http://192.168.1.84:8889/'
-PROJECT="m"
+SERVER='http://192.168.1.84:8889'
+PROJECT="m/seta.html#"
 
-for page in `ls www/$PROJECT/*.html`;
+for each in 1 2 3 4 5 6;
 do
-echo $page
-phantomjs rasterize.js $page $page.png
-mogrify -scale 30% $page.png
-mv $page.png www/m/img/thumbs/
+echo $SERVER/$PROJECT$each
+phantomjs rasterize.js $SERVER/$PROJECT$each $each.png
+mogrify -scale 30% $each.png
+mv $each.png www/m/img/thumbs/
 done
\ No newline at end of file
--- a/www/m/5.html	Mon Jul 09 19:18:47 2012 +0100
+++ b/www/m/5.html	Tue Jul 10 14:16:12 2012 +0100
@@ -10,8 +10,8 @@
 
 <body onload='document.getElementById("countinnumber").style.visibility="hidden";'>
 
-  <input type="hidden" id="group" value='1'>
- 
+  <input type="hidden" id="group" value='1'> 
+
   <div class="outermaster"> 
     <div class="metrocase" id="metro">
 	<div id="metronome0"></div>
@@ -22,30 +22,8 @@
     
     <div id="client_chronometer"  style="z-index: 2;">00:00:00.0</div>    
     <div id="countinnumber"></div>
-    
     <div id="live"> </div>    
-    <div id="preview"> <img src="img/thumbs/1.html.png"/> </div>    
-    
-
-<div style="height: 0px; visibility: hidden; display: none;">      
-      <div id="unit01"> <img src="img/1280x800/music1.jpg" width="1280px"/> </div>
-      <div id="unit02"> <img src="img/1280x800/music2.jpg" width="1280px"/> </div>
-      <div id="unit03"> <img src="img/1280x800/music3.jpg" width="1280px"/> </div>
-      <div id="unit04"> <img src="img/1280x800/music4.jpg" width="1280px"/> </div>
-      <div id="unit05"> <img src="img/1280x800/music5.jpg" width="1280px"/> </div>
-      <div id="unit06"> <img src="img/1280x800/music4.jpg" width="1280px"/> </div>
-    </div>  
-
-
-
-
+    <div id="preview"></div>    
   </div>    
-</div>
-
-
-</div>    
-</div> 
-
-
-
-</body></html>
+</body>
+</html>
Binary file www/m/img/thumbs/1.html.png has changed
Binary file www/m/img/thumbs/1.png has changed
Binary file www/m/img/thumbs/2.html.png has changed
Binary file www/m/img/thumbs/2.png has changed
Binary file www/m/img/thumbs/3.html.png has changed
Binary file www/m/img/thumbs/3.png has changed
Binary file www/m/img/thumbs/4.html.png has changed
Binary file www/m/img/thumbs/4.png has changed
Binary file www/m/img/thumbs/5.html.png has changed
Binary file www/m/img/thumbs/5.png has changed
Binary file www/m/img/thumbs/6.png has changed
Binary file www/m/img/thumbs/controls.html.png has changed
--- a/www/m/js/nodescore-client.js	Mon Jul 09 19:18:47 2012 +0100
+++ b/www/m/js/nodescore-client.js	Tue Jul 10 14:16:12 2012 +0100
@@ -38,6 +38,31 @@
     $("div#client_chronometer").text(chron);
 });
 
+
+
+
+/////////////////////////////////////////////////
+// countdown to change
+
+socket.on("countinFromServer", countinClient);
+function countinClient(groupID, currentseconds,mm,text,colour,background){
+    var groupPage=document.getElementById('group').value
+    if (groupID == groupPage) {
+	console.log(currentseconds);
+	document.getElementById("countinnumber").style.visibility="visible";
+	document.getElementById("countinnumber").style.visibility="visible";
+	//$("#countin").text(text);
+	$("#countinnumber").text(currentseconds);
+	$("#countinnumber").css('background-color', background);
+	
+	document.getElementById("countinnumber").style.color=colour;
+
+	if ( currentseconds == 0) {
+	    document.getElementById("countinnumber").style.visibility='hidden';
+//	    document.getElementById("countin").style.visibility='hidden';
+	}
+    }}
+
 /////////////////////////////////////////////////
 
 function pageFlip(unit) {
@@ -67,7 +92,7 @@
 	var g= pad2(group); 
 	var p= pad2(unit);
 //	pageFlip(unit); 
-	pageTurnB(p)
+	pageTurnB(unit)
  
    }
     else { 
@@ -75,20 +100,31 @@
     }
 }
 
-/////////////////////////////////////////////////
-
 function pageTurnB(unit) {
-    console.log("HOP TURN" + unit);
-    $("#live").html($("#unit"+unit).html());
-
+    var units=6
+    
+    var next=(((unit+1)%units)+units)%units
+    console.log("HOP TURN" + unit+ "next:" + next);
+//    $("#live").html($("#unit"+unit).html());
+    $("#live").load("seta.html #"+unit +" *");
+ 
+    $("#preview").html('<img src=' + "img/thumbs/"+next + ".png" + '>');
 }
 
 ////////////////////////////////////////////////
-// keyboard controls 
-// SPACE to toggle visibilty of preview
-// etc
-// etc
-////////////////////////////////////////////////
+
+/* 
+
+keyboard controls 
++++++++++++++++++++++++++
+
+SPACE to toggle visibilty of preview
+m to toggle visibilty of metronome
+s to toggle visibilty of stopwatch
+h to hide all above
+
+*/
+
 function toggle_visibility(id) {
     var e = document.getElementById(id);
     if(e.style.display == 'block')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/m/seta.html	Tue Jul 10 14:16:12 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>