-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (28 loc) · 950 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Created by ronan on 31/08/2014.
*/
var SoundPlayer = require('./lib/SoundPlayer');
var player = new SoundPlayer();
player.play();
/*
var Timer = require('./lib/Timer');
var timer = new Timer();
timer.addEvent("event_a", 1);
timer.addEvent("event_b", 2);
timer.addEvent("event_c", 3);
timer.addEvent("event_d", 4);
timer.start();
console.log('Expecting ' + timer.getEventList().length + ' events to come')
timer.removeEvent("event_b");
var subscription = timer.subscribe('timedEvent', function(e, identifier){
console.log('automatic all-events subscription found',identifier); // will output "event_a" after 1 second and "event_c" after 5 seconds
});
var subscriptionIndividual = timer.subscribe('event_a', function(e){
console.log('individual subscription found', e);
});
setTimeout(function () {
timer.stop();
console.log('timer duration:', timer.getDuration());
console.log('CTRL+C to quit.');
}, 5001);
*/