Exemplo n.º 1
0
//---------------------------------------------------------------------------
void ofxTSPSPeopleTracker::updateSettings()
{
	setHaarXMLFile(p_Settings->haarFile);

	//check to enable OSC
	if (p_Settings->bSendOsc && !bOscEnabled) setupOsc(p_Settings->oscHost, p_Settings->oscPort);
	else if (!p_Settings->bSendOsc) bOscEnabled = false;
	
	//check to enable TUIO
	if (p_Settings->bSendTuio && !bTuioEnabled) setupTuio(p_Settings->tuioHost, p_Settings->tuioPort);
	else if (!p_Settings->bSendTuio) bTuioEnabled = false;

	//check to enable TCP
	if (p_Settings->bSendTcp && !bTcpEnabled) setupTcp(p_Settings->tcpPort);
	else if (!p_Settings->bSendTcp) bTcpEnabled = false;
        
    //check to enable websockets
    if (p_Settings->bSendWebSockets && !bWebSocketsEnabled){
        setupWebSocket(p_Settings->webSocketPort);
    } else if (!p_Settings->bSendWebSockets){
        bWebSocketsEnabled = false;
        webSocketServer.close();
    }
	//switch camera view if new panel is selected
	if (p_Settings->currentPanel != p_Settings->lastCurrentPanel) setActiveView(p_Settings->currentPanel + 1);

	// Set the current view within the gui so the image can only be warped when in Camera View
	if (cameraView.isActive()) {
		gui.changeGuiCameraView(true);
	} else {
		gui.changeGuiCameraView(false);
	}
}
Exemplo n.º 2
0
bool WebServer::startServer(quint16 port, bool websocket){
  if(!QSslSocket::supportsSsl()){ qDebug() << "No SSL Support on this system!!!"; return false; }
  else{
    qDebug() << "Using SSL Library:";
    qDebug() << " - Version:" << QSslSocket::sslLibraryVersionString();
  }
  bool ok = false;
  if(websocket && BRIDGE_ONLY){ ok = true; }
  else if(websocket){ ok = setupWebSocket(port); }
  else{ ok = setupTcp(port); }
  
  if(ok){ 
    QCoreApplication::processEvents();
    qDebug() << "Server Started:" << QDateTime::currentDateTime().toString(Qt::ISODate);
    qDebug() << " Port:" << port;
    if(WSServer!=0){ qDebug() << " URL:" << WSServer->serverUrl().toString(); }
  }else{ 
    qCritical() << "Could not start server - exiting..."; 
  }
  if(ok && websocket){
    bridgeTimer->start();
    QTimer::singleShot(5, this, SLOT(checkBridges()));
  }
  return ok;
}
Exemplo n.º 3
0
void ofApp::setupWords()
{
  wordReady = true;
  windowsSize.x = size->x * ofGetWindowWidth();
  windowsSize.y = size->y * ofGetWindowHeight();
  words.setup(windowsSize.x, windowsSize.y);
  ofSetFrameRate(60);
  ofBackground(0);
  setupWebSocket();
  resetWords();
  overlay.load("overlayWords.png");
  blur.setup(windowsSize.x, windowsSize.y, 10, .2, 4);
  setupAudio();
  system("open 'http://localhost:9092/'");
}