Example #1
0
 self.tryNext = function(force) {
   if (!useTryNext && !force) {
     return;
   }
   config = configs.getNextById(config.getId());
   self.connect();
 };
Example #2
0
 self.discover(function (hosts) {
     if (hosts.length > 0) {
         config.host = hosts[0].host;
         self.connect();
     }
     return;
 });
Example #3
0
  function record(id){
    soundRecorder.emit('beginRecord', id)
    var samples = window.context.currentProject.samples

    var stream = WaveRecorder(audioContext)
    soundRecorder.connect(stream.input)

    samples.getFile(Date.now() + '-' + id + '.wav', {create: true}, function(file){

      var fileStream = fs.createWriteStream(file)
      stream.pipe(fileStream)
      fileStream.on('close', function(){

        soundRecorder.emit('endRecord', id)

        // load sample, calculate offset, then update slot
        audioContext.loadSample(file.name, function(buffer){
          launchpad.mainChunk.update({
            id: id,
            sources: [{
              node: 'sample',
              mode: 'hold',
              url: file.name,
              offset: getSoundOffset(buffer) || [0,1]
            }],
            gain: 1
          })
        })

      })
    })
    streams[id] = stream
  }
Example #4
0
	discovery.on('peer', function(addr) {
		if (blocked.contains(addr.split(':')[0])) {
			engine.emit('blocked-peer', addr);
		} else {
			engine.emit('peer', addr);
			engine.connect(addr);
		}
	});
Example #5
0
		table.on('peer', function(addr) {
			var blockedReason = null;
			if (opts.blocklist.length && (blockedReason = isPeerBlocked(addr, opts.blocklist))) {
				engine.emit('blocked-peer', addr, blockedReason);
			} else {
				engine.emit('peer', addr);
				engine.connect(addr);
			}
		});
Example #6
0
 self.discover({address: config.host}, function (err, hosts) {
     if (!err && hosts.length > 0) {
         self.connect(hosts[0]);
     }
     return;
 });
Example #7
0
 self.discover(function (err, hosts) {
     if (!err && hosts.length > 0) {
         self.connect(hosts[0]);
     }
     return;
 });
Example #8
0
			tr.on('peer', function(addr) {
				engine.connect(addr);
			});
Example #9
0
		table.on('peer', function(addr) {
			engine.emit('peer', addr);
			engine.connect(addr);
		});
Example #10
0
omegle.reconnect = function(){
	if (!connected) return;
	omegle.disconnect();
	omegle.connect();
}
Example #11
0
 setTimeout(() => {
   kodi.connect(options)
 }, options.reconnectSleep)