comparison nodescore.js @ 16:e05eede75e0d

some cleaning up of html css js
author tzara <rc-web@kiben.net>
date Sun, 08 Jul 2012 23:57:13 +0100
parents 0a8133490050
children 9daa1ac0af33
comparison
equal deleted inserted replaced
15:6e6dd1ed032b 16:e05eede75e0d
147 // basic unit is still the second/1000ms - change this to tempoms? no i dont think so 147 // basic unit is still the second/1000ms - change this to tempoms? no i dont think so
148 // count in and count out 148 // count in and count out
149 //////////////////////////////////////////// 149 ////////////////////////////////////////////
150 150
151 var counter = ztime/1000 151 var counter = ztime/1000
152
153 socket.emit('counterText', seq.voice, seq.counter, counter); 152 socket.emit('counterText', seq.voice, seq.counter, counter);
154 153
155 if (counter > 0 && counter <= outcount ) { 154 if (counter > 0 && counter <= outcount ) {
156 socket.broadcast.emit('countinFromServer', seq.voice, counter, "","", "white", "transparent"); 155 socket.broadcast.emit('countinFromServer', seq.voice, counter, "","", "white", "transparent");
157 } 156 }
158 // remove displayed number with " " at end of both countin/out 157 // remove displayed number with " " at end of both countin/out
159 if (counter == 0 ) { 158 if (counter == 0 ) {
160 socket.broadcast.emit('countinFromServer', seq.voice, " ", "","", "white","transparent"); 159 socket.broadcast.emit('countinFromServer', seq.voice, " ", "","", "white","transparent");
161 } 160 }
162 161
163 console.log(counter + "========" + totaltime) 162 // console.log(counter + "========" + totaltime)
164 if (counter > (totaltime)-incount && counter <= totaltime ) { 163 if (counter > (totaltime)-incount && counter <= totaltime ) {
165 socket.broadcast.emit('countinFromServer', seq.voice, counter-(totaltime-incount), "","", "red","gray"); 164 socket.broadcast.emit('countinFromServer', seq.voice, counter-(totaltime-incount), "","", "red","gray");
166 } 165 }
167 166
168 if (counter == (totaltime)-incount ) { 167 if (counter == (totaltime)-incount ) {
169 socket.broadcast.emit('countinFromServer', seq.voice, " ", "","", "red","gray"); 168 socket.broadcast.emit('countinFromServer', seq.voice, " ", "","", "red","gray");
170 } 169 }
171 170
172 // push out the pulse to metronome 171 // push out the pulse to metronome
173 seq.metrobeat = (seq.metrobeat+1)%seq.beatsinbar ; 172 seq.metrobeat = (seq.metrobeat+1)%seq.beatsinbar ;
174 console.log(seq.metrobeat); 173 //console.log(seq.metrobeat);
175 socket.broadcast.emit('metroPulse', tempoms, seq.voice,seq.metrobeat); 174 socket.broadcast.emit('metroPulse', tempoms, seq.voice,seq.metrobeat);
176 socket.emit('metroPulse', tempoms, seq.voice,seq.metrobeat); 175 socket.emit('metroPulse', tempoms, seq.voice,seq.metrobeat);
177 } 176 }
178 177
179 // flip the page 178 // flip the page
180 if (ztime == 0){ 179 if (ztime == 0){
181 socket.emit('counterText', seq.voice, seq.counter, " "); 180 socket.emit('counterText', seq.voice, seq.counter, " ");
182 seq.counter = (seq.counter + 1) % seq.durations.length 181 seq.counter = (seq.counter + 1) % seq.durations.length
183 socket.broadcast.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter); 182 socket.broadcast.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter);
184 socket.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter); 183 socket.emit("pageFlipfromserver", seq.voice, unit, time, seq.mm,seq.counter);
184 delete tock;
185
185 step(seq); 186 step(seq);
186 187
187 } 188 }
188 189
189 if (ztime < 0){} 190 if (ztime < 0){}
190 // decrement the time 191 // decrement the time
191 ztime -= 1000 192 ztime -= 1000