adding a new relay, 'pan'
This commit is contained in:
parent
811d021b4c
commit
64ee2d598b
1 changed files with 12 additions and 1 deletions
13
app.js
13
app.js
|
|
@ -65,7 +65,7 @@ io.on('connection', function(socket) {
|
||||||
//entry log.
|
//entry log.
|
||||||
console.log('someone connected.');
|
console.log('someone connected.');
|
||||||
|
|
||||||
//on 'sound' --> relay the message to everybody INCLUDING sender
|
//on 'sound'
|
||||||
// var soundactive = false;
|
// var soundactive = false;
|
||||||
socket.on('sound', function(sound) {
|
socket.on('sound', function(sound) {
|
||||||
|
|
||||||
|
|
@ -78,6 +78,17 @@ io.on('connection', function(socket) {
|
||||||
console.log('sound.group :' + sound.group);
|
console.log('sound.group :' + sound.group);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//on 'pan'
|
||||||
|
socket.on('pan', function(pan) {
|
||||||
|
|
||||||
|
//relay the message to everybody EXCEPT the sender
|
||||||
|
socket.broadcast.emit('pan', pan);
|
||||||
|
|
||||||
|
//DEBUG
|
||||||
|
console.log('pan.width :' + pan.width);
|
||||||
|
console.log('pan.speed :' + pan.speed);
|
||||||
|
});
|
||||||
|
|
||||||
//on 'clap' --> relay the message to everybody INCLUDING sender
|
//on 'clap' --> relay the message to everybody INCLUDING sender
|
||||||
socket.on('clap', function(clap) {
|
socket.on('clap', function(clap) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue