changeset 91:1a706a2880ee

reset bug fixed but still todo unit transect to 0 reset
author Rob Canning <rob@foo.net>
date Thu, 31 Jul 2014 00:16:27 +0100
parents f214909fb108
children fbb3bea47641
files nodescore.js www/8/.#c.html www/8/.#score.html www/emma/.#c.html www/m.a/.#icmc2012.html www/m.a/js/.#controlseq.js www/martin/.#c.html www/martin/css/chat-tablet.css www/martin/css/nodescore.css www/martin/js/controlseq.js www/martin/js/nodescore-client.js
diffstat 11 files changed, 75 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/nodescore.js	Wed Jul 30 10:44:14 2014 +0100
+++ b/nodescore.js	Thu Jul 31 00:16:27 2014 +0100
@@ -80,7 +80,7 @@
 
 //var sequencer = require('./sequencer')
 
-io.set('log level', 4); // reduce logging
+//io.set('log level', 4); // reduce logging
 io.sockets.on('connection', function (socket) {
 
     socket.on('nickname', function (nick, fn) {
@@ -113,10 +113,27 @@
     // chronometer + sequencer controls (all this should be modularised)
     ////////////////////////////////////////////
 
+    sstate=0;
     socket.on('stopWatch', function (state) { stopWatch(state);});
-    socket.on('stopChr', function () { stopChr();  });    
-    socket.on('resetChr', function () { resetChr();});
-    socket.on('startSeq', function () { startChr(); });  
+    socket.on('stopChr',  function () { 
+	//sstate=0;  
+	stopChr(); 
+
+    });    
+   
+    socket.on('resetChr', function () { 
+	//reset currently just restarts current unit
+	//todo: make a total reset that sets unit and transect to 0
+	resetChr();  
+    });
+   
+    socket.on('startSeq', function () { 
+	//if( sstate==0 ){ 
+	    startChr();  
+	  //  sstate=1;
+	//}
+    });  
+    
     var chronstate=0;
 
     // send the date/time every second
@@ -207,15 +224,6 @@
 	    //socket.emit("pageFlipfromserver", voice, unit, time, seq.mm,seq.counter,nextunit );
 	}
 
-	socket.on('resetSeq', function (seq) { 
-	    //var unit=seq.units[seq.transect%numberoftransects][seq.counter];
-	    //resetChr(); 
-	    //socket.emit("pageIni", 1, unit, 0, 60, 0,1 )
-	    //socket.emit("pageIni", 2, 1, 0, 60, 0,1 );
-	    //socket.emit("pageIni", 3, 1, 0, 60, 0,1 );
-	    //socket.emit("pageIni", 4, 1, 0, 60, 0,1 );
-	    console.log("reset message recieved from client");
-	});
 
 	function sequenCer() {
 	    if (ztime >= 0 ){	
@@ -266,16 +274,18 @@
 				    "","playing.. ", "green","transparent",unit);
 		    }
 		}
+		
 		// on each beat do:		
 		// push out the pulse to metronome	
+		
 		seq.metrobeat = (seq.metrobeat+1)%seq.beatsinbar ;
-     		socket.broadcast.emit('metroPulse', tempoms, voice,seq.metrobeat); 
+     		socket.broadcast.emit('metroPulse', tempoms, voice, seq.metrobeat); 
 		socket.emit('metroPulse', tempoms, voice, seq.metrobeat);
-	    	console.log("sdfasfdasdfasdfasf");
-		//socket.emit("pageFlipfromserver", voice, unit, time, seq.mm,seq.counter,nextunit);
+	
 		var nextunit=seq.units[seq.transect%numberoftransects][seq.counter+1];
 	    	socket.broadcast.emit("pageIni", voice, unit, time, seq.mm,seq.counter,nextunit );
 	    }
+
 	    // decrement the time 
 	    ztime -= 1
 	    // this shows undefined counter output - bug related	    
@@ -284,16 +294,21 @@
 	
 	var pulse = setInterval(sequenCer, tempoms);
 	
-
-
-
 	socket.on('stopSeq', function () {
 	    sequenCer.clearInterval
 	    console.log("sequencer stopping...")	    
+	    
 	    // grrr why wont this clearInterval work
+	    
 	    sequencerState = 0
 	    clearInterval(pulse)
-	    sequenCer.clearInterval(pulse)
+
+	    // the below breaks things but maybe this is for the best
+	    // without breakage and nodejs supervisor restart then too many instances
+	    // mount up and slow thinks down until crash
+	    //sequenCer.clearInterval(pulse)
+	    
+
 	    stopChr();	    
 	});
     };
@@ -306,13 +321,13 @@
     };
     
     socket.on('resetSeq', function () { 
+	// start stop reset in sucession to setup page easy never mind the below
 	//var unit=seq.units[seq.transect%numberoftransects][seq.counter];
 	resetChr(); 
 	//socket.emit("pageIni", 1, unit, 0, 60, 0,1 )
 	//socket.emit("pageIni", 2, 1, 0, 60, 0,1 );
 	//socket.emit("pageIni", 3, 1, 0, 60, 0,1 );
 	//socket.emit("pageIni", 4, 1, 0, 60, 0,1 );
-	console.log("reset message recieved from client");
     });
 
     ////////////////////////////////////////////  
@@ -358,8 +373,6 @@
 	socket.emit("latencyFromServer", latency);
     });	      
     
-
-    
     serverTime(1000);
     
     socket.on('disconnect', function(client) {	
--- a/www/8/.#c.html	Wed Jul 30 10:44:14 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rob@tzara.18894:1359303065
\ No newline at end of file
--- a/www/8/.#score.html	Wed Jul 30 10:44:14 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rob@tzara.18894:1359303065
\ No newline at end of file
--- a/www/emma/.#c.html	Wed Jul 30 10:44:14 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rob@tzara.18894:1359303065
\ No newline at end of file
--- a/www/m.a/.#icmc2012.html	Wed Jul 30 10:44:14 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rob@tzara.20446:1345317715
\ No newline at end of file
--- a/www/m.a/js/.#controlseq.js	Wed Jul 30 10:44:14 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rob@tzara.23925:1345317715
\ No newline at end of file
--- a/www/martin/.#c.html	Wed Jul 30 10:44:14 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rob@tzara.18894:1359303065
\ No newline at end of file
--- a/www/martin/css/chat-tablet.css	Wed Jul 30 10:44:14 2014 +0100
+++ b/www/martin/css/chat-tablet.css	Thu Jul 31 00:16:27 2014 +0100
@@ -1,14 +1,5 @@
-
-#nickname {
-background:gray;
-position:absolute;
-left:-445%;
-top:45%;
-height:150px;
-width:200px;
-}
-
 #chat,
+#nickname,
 #messages {
   width: 180px;
   height:90%;
@@ -21,7 +12,8 @@
   border-radius: 15px;
   height:100%;
 }
-#Nickname,
+
+#nickname,
 #connecting {
   position: absolute;
   height: 90%;
@@ -88,7 +80,6 @@
   overflow-x: hidden;
   overflow-y: auto;
 }
-
 #messages #lines::-webkit-scrollbar {
   width: 6px;
   height: 6px;
@@ -116,25 +107,22 @@
   -webkit-border-radius: 3px;
 }
 #send-message {
-  background: gray;
+  background: white;
   border-radius:1px;
+  padding:20px;
   border: 1px dashed green;
   position:relative;
   bottom:30px;
   !padding:5px;
 }
 #send-message input {
-  border: none;
   height: 20px;
-  padding: 0 0px;
+  padding: 5px;
   line-height: 20px;
   vertical-align: middle;
-  width: 160px;
-  background:white;
-  color: black;
-  border-radius:1px;
- 
+  width: 140px;
 }
+
 #send-message input:focus {
   outline: 0;
 }
--- a/www/martin/css/nodescore.css	Wed Jul 30 10:44:14 2014 +0100
+++ b/www/martin/css/nodescore.css	Thu Jul 31 00:16:27 2014 +0100
@@ -47,53 +47,22 @@
 #soloscore.anchor{display: block; position: relative; left: 1250px; visibility: hidden;}
 
 #info{
-position: absolute;
-border-radius:15px;
-float:bottom;
-!top: 450px;
-height: 135px;
-width: 100%;
+    position: absolute;
+    border-radius:15px;
+    float:bottom;
+    !top: 450px;
+    height: 135px;
+    width: 100%;
 }
 
 #comms{
     position:fixed;
     top:12%;
     right: 10px;
-    border-radius: 0px;
     height: 70%;
     width: 180px;
     margin: 0px;
-    border: 0px solid gray;
     color: red;
-    padding: 0px 5px 0px 5px;
-    background:gray;
-    !opacity:0.8;
-    z-index:10000;
-    margin-right:0px;
-}
-
-#xcomms{
-    border-radius: 15px;
-    height: 120px;
-    width: 250px;
-    margin: 0px;
-    border: 1px solid gray;
-    color: black;
-    padding: 5px 5px 5px 5px;
-}
-
-#midfoot{
-    !margin-left:auto; margin-right:auto;
-    border-radius: 15px;
-    height: 120px;
-    width: 30%;
-    margin: 0px;
-    margin-left:6%;
-    border: 1px solid gray;
-    padding: 5px 5px 5px 5px ;
-    opacity:1;
-    float:left;
-    
 }
 
 #preview{
@@ -377,7 +346,7 @@
 
 #map { width: 1200px; 
        height: 600px; 
-       padding: 0px 0px 0px 5px; 
+       padding: 0px 0px 0px 115px; 
      }
 
 #outerpreview { 
--- a/www/martin/js/controlseq.js	Wed Jul 30 10:44:14 2014 +0100
+++ b/www/martin/js/controlseq.js	Thu Jul 31 00:16:27 2014 +0100
@@ -1,21 +1,35 @@
 //////////////////////////////////////////////
 var socket = io.connect();
 //////////////////////////////////////////////
+// Sequencer Controls
+var sstate=0;
 
+function startSeq() {
+    console.log("yeah")
+//    if (sstate==0){
+	socket.emit("startSeq");
+//	var sstate=1;
+    //} 
+}
 
-// Sequencer Controls
-function startSeq() { socket.emit("startSeq") }
-function stopSeq() { socket.emit("stopSeq") }
+function stopSeq() { 
+    //if (sstate==1){
+	socket.emit("stopSeq")
+//	var sstate=0;
+  //  }
+}
+
 function resetSeq() { socket.emit("resetSeq") }
-
 //////////////////////////////////////////////
 // Chron Controls
 function stopWatch(value) { socket.emit("stopWatch", value) }
+
 //////////////////////////////////////////////
 // Metronome Controls
 //socket.on("metroPulse", metronomeTick);
 function metroStart(pulse) {  socket.emit("metroStart", pulse);}
 function metroStop() {  socket.emit("metroStop");}
+
 //////////////////////////////////////////////
 // Latency "Pong"
 socket.on("timeFromServer", function(n) { 
@@ -28,10 +42,13 @@
 function getLatencies(x) { socket.emit("getLatencies", x); }
 //////////////////////////////////////////////
 // Chronometer Controls
+
 function startChr() { socket.emit("startChr"); }
-function stopChr() { socket.emit("stopChr"); }
+function stopChr()  { socket.emit("stopChr"); }
 function resetChr() { socket.emit("resetChr"); 
-		      $("div#client_chronometer").text("00:00:00.0"); }
+		      $("div#client_chronometer").text("00:00:00.0"); 
+		    }
+
 socket.on("chronFromServer", function(chron){ 
     $("div#c_chronometer").text(chron); 
 });
--- a/www/martin/js/nodescore-client.js	Wed Jul 30 10:44:14 2014 +0100
+++ b/www/martin/js/nodescore-client.js	Thu Jul 31 00:16:27 2014 +0100
@@ -193,7 +193,7 @@
     $('#Lines').append($('<p>').append($('<em>').text(msg)));
 });
 
-Socket.on('nicknames', function (nicknames) {
+socket.on('nicknames', function (nicknames) {
     $('#nicknames').empty().append($('<span>Online: </span>'));
     for (var i in nicknames) {
 	$('#nicknames').append($('<b>').text(nicknames[i]));