Exemplo n.º 1
0
WsAccount::WsAccount(UserProfile & userProfile )
	: WengoWebService(userProfile.getWengoAccount()),
	_userProfile(userProfile)
{
	Config & config = ConfigManager::getInstance().getCurrentConfig();

	//Setup the web service
//	setHostname(config.getWengoServerHostname());

#if 1
//	setHostname( "" );//VOXOX - CJC - 2009.07.05 Set server address
	setHostname( config.getApiHostname() );
	setServicePath( config.getVoxOxSyncWSPath() );
	setHttps(true);
	setPort(443);
#else
	setHostname( "" );
	setServicePath( "" );//VOXOX - CJC - 2009.07.05  Ser server address
	setHttps(false);
	setPort( 80 );
#endif

	setGet(true);	//true = POST in Curl lib.
	setWengoAuthentication(false);

	_userNetworkId = 0;
	_bDeleted	   = false;
}
Exemplo n.º 2
0
WsInfo::WsInfo(WengoAccount * wengoAccount)
	: WengoWebService(wengoAccount) {

	Config & config = ConfigManager::getInstance().getCurrentConfig();

	_wengosCount = false;
	_smsCount = false;
	_activeMail = false;
	_unreadVoiceMail = false;
	_callForward = false;
	_landlineNumber = false;

	//setup info web service
	setHostname(config.getWengoServerHostname());
	//VOXOX CHANGE FIX PROBLEM WITH NOT RESPONDING WEBSERVICE
	//TODO: FIX THIS, WE NEED TO COMPILE OPENSSL TO BE ABLE TO SEND HTTPS TRUE, AND ALSO PASSWORD AND OTHERS SHOULD BE ENCRIPYED
	setGet(false);
	setServicePath(config.getWengoInfoPath());
	setWengoAuthentication(true);

#if 1
	setHttps(true);	//VOXOX - JRT - 2009.10.05 
	setPort(443);
#else
	setHttps(false);
	setPort(80);
#endif

	getCallForwardInfo(false);
}
Exemplo n.º 3
0
bool Socket::connect ( const std::string& host, const unsigned short port )
{
  if ( !is_valid() )
  {
    return false;
  }

  _sockaddr.sin_family = _family;
  _sockaddr.sin_port = htons ( port );

  if ( !setHostname( host ) )
  {
    XBMC->Log(LOG_ERROR, "Socket::setHostname(%s) failed.\n", host.c_str());
    return false;
  }

  int status = ::connect ( _sd, reinterpret_cast<sockaddr*>(&_sockaddr), sizeof ( _sockaddr ) );

  if ( status == SOCKET_ERROR )
  {
    XBMC->Log(LOG_ERROR, "Socket::connect %s:%u\n", host.c_str(), port);
    errormessage( getLastError(), "Socket::connect" );
    return false;
  }

  return true;
}
Exemplo n.º 4
0
void IPBlocksSources::setConfiguration(QHash<QString, QString> conf)
{
    BlocksSource::setConfiguration(conf);

    bool ok = false;

    if (conf.contains(GuiConst::STATE_IP_ADDRESS)) {
        QHostAddress addr;
        addr.setAddress(conf.value(GuiConst::STATE_IP_ADDRESS));
        if (!addr.isNull())
            setHostAddress(addr);
    }

    if (conf.contains(GuiConst::STATE_PORT)) {
        quint16 val = conf.value(GuiConst::STATE_PORT).toUShort(&ok);
        if (ok && val > 1) { // yeah it's an unsigned 16bits no need for < 65535
            setHostPort(val);
        }
    }

    if (conf.contains(GuiConst::STATE_NAME)) {
        QString name = conf.value(GuiConst::STATE_NAME);
        if (!name.isEmpty()) {
            setHostname(name);
        }
    }

    // todo TLS conf X{
}
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    settings = new QSettings("CPSC_6136", "AnonymousClient");

    ui->setupUi(this);
    ui->messageEdit->setDisabled(true);

    debugConsole = new DebugDialog(this);

    connect(ui->action_Debug, SIGNAL(toggled(bool)), SLOT(debug(bool)));
    connect(debugConsole, SIGNAL(finished(int)), ui->action_Debug, SLOT(toggle()));

    connectButton = new QAction(QIcon(":/icons/Chat.png"), tr("Connect"), this);
    connectButton->setEnabled(true);
    disconnectButton = new QAction(QIcon(":/icons/Call.png"), tr("Disconnect"), this);
    disconnectButton->setEnabled(false);

    connect(connectButton, SIGNAL(triggered()), SLOT(connectToHost()));
    connect(disconnectButton, SIGNAL(triggered()), SLOT(disconnectFromhost()));

    ui->mainToolBar->addAction(connectButton);
    ui->mainToolBar->addAction(disconnectButton);

    connect(ui->messageEdit, SIGNAL(returnPressed()), SLOT(returnPressed()));
    connect(ui->actionSet_Hostname, SIGNAL(triggered()), SLOT(setHostname()));
    connect(ui->action_Set_Port, SIGNAL(triggered()), SLOT(setPort()));
    connect(ui->action_About, SIGNAL(triggered()), SLOT(about()));
    connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));;
}
Exemplo n.º 6
0
void SIPAccount::setAccountDetails (std::map<std::string, std::string> details)
{
    // Account setting common to SIP and IAX
    setAlias (details[CONFIG_ACCOUNT_ALIAS]);
    setType (details[CONFIG_ACCOUNT_TYPE]);
    setUsername (details[USERNAME]);
    setHostname (details[HOSTNAME]);
    setEnabled ( (details[CONFIG_ACCOUNT_ENABLE] == "true"));
    setRingtonePath (details[CONFIG_RINGTONE_PATH]);
    setRingtoneEnabled ( (details[CONFIG_RINGTONE_ENABLED] == "true"));
    setMailBox (details[CONFIG_ACCOUNT_MAILBOX]);

    // SIP specific account settings

    // general sip settings
    setDisplayName (details[DISPLAY_NAME]);
    setServiceRoute (details[ROUTESET]);
    setLocalInterface (details[LOCAL_INTERFACE]);
    setPublishedSameasLocal (details[PUBLISHED_SAMEAS_LOCAL] == "true");
    setPublishedAddress (details[PUBLISHED_ADDRESS]);
    setLocalPort (atoi (details[LOCAL_PORT].c_str()));
    setPublishedPort (atoi (details[PUBLISHED_PORT].c_str()));
    setStunServer (details[STUN_SERVER]);
    setStunEnabled (details[STUN_ENABLE] == "true");
    setDtmfType ( (details[ACCOUNT_DTMF_TYPE] == "overrtp") ? OVERRTP : SIPINFO);

    setResolveOnce (details[CONFIG_ACCOUNT_RESOLVE_ONCE] == "true");
    setRegistrationExpire (details[CONFIG_ACCOUNT_REGISTRATION_EXPIRE]);

    setUseragent (details[USERAGENT]);

    // srtp settings
    setSrtpEnable (details[SRTP_ENABLE] == "true");
    setSrtpFallback (details[SRTP_RTP_FALLBACK] == "true");
    setZrtpDisplaySas (details[ZRTP_DISPLAY_SAS] == "true");
    setZrtpDiaplaySasOnce (details[ZRTP_DISPLAY_SAS_ONCE] == "true");
    setZrtpNotSuppWarning (details[ZRTP_NOT_SUPP_WARNING] == "true");
    setZrtpHelloHash (details[ZRTP_HELLO_HASH] == "true");
    setSrtpKeyExchange (details[SRTP_KEY_EXCHANGE]);

    // TLS settings
    // The TLS listener is unique and globally defined through IP2IP_PROFILE
    if (_accountID == IP2IP_PROFILE)
    	setTlsListenerPort (atoi (details[TLS_LISTENER_PORT].c_str()));

    setTlsEnable (details[TLS_ENABLE]);
    setTlsCaListFile (details[TLS_CA_LIST_FILE]);
    setTlsCertificateFile (details[TLS_CERTIFICATE_FILE]);
    setTlsPrivateKeyFile (details[TLS_PRIVATE_KEY_FILE]);
    setTlsPassword (details[TLS_PASSWORD]);
    setTlsMethod (details[TLS_METHOD]);
    setTlsCiphers (details[TLS_CIPHERS]);
    setTlsServerName (details[TLS_SERVER_NAME]);
    setTlsVerifyServer (details[TLS_VERIFY_SERVER] == "true");
    setTlsVerifyClient (details[TLS_VERIFY_CLIENT] == "true");
    setTlsRequireClientCertificate (details[TLS_REQUIRE_CLIENT_CERTIFICATE] == "true");
    setTlsNegotiationTimeoutSec (details[TLS_NEGOTIATION_TIMEOUT_SEC]);
    setTlsNegotiationTimeoutMsec (details[TLS_NEGOTIATION_TIMEOUT_MSEC]);
}
Exemplo n.º 7
0
WsCallForward::WsCallForward(WengoAccount * wengoAccount) : WengoWebService(wengoAccount) {

	Config & config = ConfigManager::getInstance().getCurrentConfig();

	//setup call forward service
	setHostname(config.getWengoServerHostname());
	setGet(true);
	setHttps(true);
	setServicePath(config.getWengoCirpackPath());
	setPort(443);
	setWengoAuthentication(true);
}
Exemplo n.º 8
0
int UIWizardExportAppPageBasic3::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = UIWizardPage::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 1)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 1;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = format(); break;
        case 1: *reinterpret_cast< bool*>(_v) = isManifestSelected(); break;
        case 2: *reinterpret_cast< QString*>(_v) = username(); break;
        case 3: *reinterpret_cast< QString*>(_v) = password(); break;
        case 4: *reinterpret_cast< QString*>(_v) = hostname(); break;
        case 5: *reinterpret_cast< QString*>(_v) = bucket(); break;
        case 6: *reinterpret_cast< QString*>(_v) = path(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setFormat(*reinterpret_cast< QString*>(_v)); break;
        case 1: setManifestSelected(*reinterpret_cast< bool*>(_v)); break;
        case 2: setUserName(*reinterpret_cast< QString*>(_v)); break;
        case 3: setPassword(*reinterpret_cast< QString*>(_v)); break;
        case 4: setHostname(*reinterpret_cast< QString*>(_v)); break;
        case 5: setBucket(*reinterpret_cast< QString*>(_v)); break;
        case 6: setPath(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemplo n.º 9
0
int SafetConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = SafetXmlObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = id(); break;
        case 1: *reinterpret_cast< QString*>(_v) = connectstring(); break;
        case 2: *reinterpret_cast< QString*>(_v) = hostname(); break;
        case 3: *reinterpret_cast< QString*>(_v) = databasename(); break;
        case 4: *reinterpret_cast< QString*>(_v) = username(); break;
        case 5: *reinterpret_cast< QString*>(_v) = driver(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setId(*reinterpret_cast< QString*>(_v)); break;
        case 1: setConnectstring(*reinterpret_cast< QString*>(_v)); break;
        case 2: setHostname(*reinterpret_cast< QString*>(_v)); break;
        case 3: setDatabasename(*reinterpret_cast< QString*>(_v)); break;
        case 4: setUsername(*reinterpret_cast< QString*>(_v)); break;
        case 5: setDriver(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
SocketAddr::SocketAddr( const char* inHostname, unsigned short inPort, bool isIPv6 ) {
    zeroAddress();
    if ( inHostname != NULL ) {
        setHostname( inHostname );
    } else {
#ifdef IPV6
        if ( isIPv6 ) {
            ((sockaddr*)&mAddress)->sa_family = AF_INET6;
        } else {
            ((sockaddr*)&mAddress)->sa_family = AF_INET;
        }
        mIsIPv6 = isIPv6;
#else
        mIsIPv6 = false;
        ((sockaddr*)&mAddress)->sa_family = AF_INET;
#endif
    }
    setPort( inPort );
}
Exemplo n.º 11
0
WsContactUpload::WsContactUpload(UserProfile & userProfile)
	: WengoWebService(userProfile.getWengoAccount()),
	_userProfile(userProfile) {

	Config & config = ConfigManager::getInstance().getCurrentConfig();

	//Setup the web service
	setHostname(config.getWengoServerHostname());
	setGet(true);
	setServicePath(config.getVoxoxContactUploadPath());
	setWengoAuthentication(false);

#if 1
	setHttps(true);	//VOXOX - JRT - 2009.10.05 
	setPort(443);
#else
	setHttps(false);
	setPort(80);
#endif
}
Exemplo n.º 12
0
WsTranslation::WsTranslation(WengoAccount * wengoAccount)
	: WengoWebService(wengoAccount){

	_wsKey = "";
	_userKey = wengoAccount->getIdentity();
	Config & config = ConfigManager::getInstance().getCurrentConfig();
	//	_did = wengoAccount->getIdentity();
	//Setup SMS web service
	//setHostname(config.getApiHostname());
	setHostname(config.getTranslationApiHostname());
	setServicePath(config.getVoxOxTranslationWSPathKey());
	setGet(true);
	setWengoAuthentication(false);

//#if 1
//	setHttps(true);	//VOXOX - JRT - 2009.10.05 
//	setPort(443);
//#else
	setHttps(false);
	setPort(80);
//#endif
}
Exemplo n.º 13
0
bool Socket::connect ( const std::string& host, const unsigned short port )
{
  close();

  if ( !setHostname( host ) )
  {
    KODI->Log(LOG_ERROR, "Socket::setHostname(%s) failed.\n", host.c_str());
    return false;
  }
  _port = port;

  char strPort[16];
  snprintf(strPort, 15, "%hu", port);
  strPort[15] = '\0';

  struct addrinfo hints;
  struct addrinfo* result = NULL;
  struct addrinfo *address = NULL;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = _family;
  hints.ai_socktype = _type;
  hints.ai_protocol = _protocol;

  int retval = getaddrinfo(host.c_str(), strPort, &hints, &result);
  if (retval != 0)
  {
    errormessage(getLastError(), "Socket::connect");
    return false;
  }
  if (result == NULL)
  {
    KODI->Log(LOG_ERROR, "Socket::connect %s:%u: no address info found\n", host.c_str(), port);
    return false;
  }

  for (address = result; address != NULL; address = address->ai_next)
  {
    // Create the socket
    _sd = socket(address->ai_family, address->ai_socktype, address->ai_protocol);

    if (_sd == INVALID_SOCKET)
    {
      errormessage(getLastError(), "Socket::create");
      continue;
    }

    int status = ::connect(_sd, address->ai_addr, static_cast<int>(address->ai_addrlen));
    if (status == SOCKET_ERROR)
    {
      close();
      continue;
    }

    // We have a conection
    break;
  }

  freeaddrinfo(result);

  if (_sd == INVALID_SOCKET)
  {
    return false;
  }

  return true;
}
Exemplo n.º 14
0
void PreferencesDialog::savePreferences() {
    
    MyAvatar* myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();

    bool shouldDispatchIdentityPacket = false;
    
    QString displayNameStr(ui.displayNameEdit->text());
    if (displayNameStr != _displayNameString) {
        myAvatar->setDisplayName(displayNameStr);
        UserActivityLogger::getInstance().changedDisplayName(displayNameStr);
        shouldDispatchIdentityPacket = true;
    }

    if (shouldDispatchIdentityPacket) {
        myAvatar->sendIdentityPacket();
    }
    
    myAvatar->setCollisionSoundURL(ui.collisionSoundURLEdit->text());

    if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableActivityLogger)
        != ui.sendDataCheckBox->isChecked()) {
        Menu::getInstance()->triggerOption(MenuOption::DisableActivityLogger);
    }

    if (!ui.snapshotLocationEdit->text().isEmpty() && QDir(ui.snapshotLocationEdit->text()).exists()) {
        Snapshot::snapshotsLocation.set(ui.snapshotLocationEdit->text());
    }

    if (!ui.scriptsLocationEdit->text().isEmpty() && QDir(ui.scriptsLocationEdit->text()).exists()) {
        qApp->setScriptsLocation(ui.scriptsLocationEdit->text());
    }

    myAvatar->getHead()->setPupilDilation(ui.pupilDilationSlider->value() / (float)ui.pupilDilationSlider->maximum());
    myAvatar->setLeanScale(ui.leanScaleSpin->value());
    myAvatar->setClampedTargetScale(ui.avatarScaleSpin->value());
    
    DependencyManager::get<AvatarManager>()->getMyAvatar()->setRealWorldFieldOfView(ui.realWorldFieldOfViewSpin->value());
    
    qApp->setFieldOfView(ui.fieldOfViewSpin->value());
    
    auto dde = DependencyManager::get<DdeFaceTracker>();
    dde->setEyeClosingThreshold(ui.ddeEyeClosingThresholdSlider->value() / 
                                (float)ui.ddeEyeClosingThresholdSlider->maximum());

    FaceTracker::setEyeDeflection(ui.faceTrackerEyeDeflectionSider->value() /
                                (float)ui.faceTrackerEyeDeflectionSider->maximum());
    
    auto faceshift = DependencyManager::get<Faceshift>();
    faceshift->setHostname(ui.faceshiftHostnameEdit->text());
    
    qApp->setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value());

    qApp->getApplicationCompositor().setHmdUIAngularSize(ui.oculusUIAngularSizeSpin->value());
    
    SixenseManager& sixense = SixenseManager::getInstance();
    sixense.setReticleMoveSpeed(ui.sixenseReticleMoveSpeedSpin->value());
    sixense.setInvertButtons(ui.invertSixenseButtonsCheckBox->isChecked());

    auto audio = DependencyManager::get<AudioClient>();
    MixedProcessedAudioStream& stream = audio->getReceivedAudioStream();
    
    stream.setDynamicJitterBuffers(ui.dynamicJitterBuffersCheckBox->isChecked());
    stream.setStaticDesiredJitterBufferFrames(ui.staticDesiredJitterBufferFramesSpin->value());
    stream.setMaxFramesOverDesired(ui.maxFramesOverDesiredSpin->value());
    stream.setUseStDevForJitterCalc(ui.useStdevForJitterCalcCheckBox->isChecked());
    stream.setWindowStarveThreshold(ui.windowStarveThresholdSpin->value());
    stream.setWindowSecondsForDesiredCalcOnTooManyStarves(ui.windowSecondsForDesiredCalcOnTooManyStarvesSpin->value());
    stream.setWindowSecondsForDesiredReduction(ui.windowSecondsForDesiredReductionSpin->value());
    stream.setRepetitionWithFade(ui.repetitionWithFadeCheckBox->isChecked());

    QMetaObject::invokeMethod(audio.data(), "setOutputBufferSize", Q_ARG(int, ui.outputBufferSizeSpinner->value()));

    audio->setOutputStarveDetectionEnabled(ui.outputStarveDetectionCheckBox->isChecked());
    audio->setOutputStarveDetectionThreshold(ui.outputStarveDetectionThresholdSpinner->value());
    audio->setOutputStarveDetectionPeriod(ui.outputStarveDetectionPeriodSpinner->value());

    Application::getInstance()->resizeGL();

    // LOD items
    auto lodManager = DependencyManager::get<LODManager>();
    lodManager->setDesktopLODDecreaseFPS(ui.desktopMinimumFPSSpin->value());
    lodManager->setHMDLODDecreaseFPS(ui.hmdMinimumFPSSpin->value());
}
Exemplo n.º 15
0
void PreferencesDialog::savePreferences() {
    
    MyAvatar* myAvatar = Application::getInstance()->getAvatar();
    bool shouldDispatchIdentityPacket = false;
    
    QString displayNameStr(ui.displayNameEdit->text());
    if (displayNameStr != _displayNameString) {
        myAvatar->setDisplayName(displayNameStr);
        UserActivityLogger::getInstance().changedDisplayName(displayNameStr);
        shouldDispatchIdentityPacket = true;
    }
    
    QUrl faceModelURL(ui.faceURLEdit->text());
    QString faceModelURLString = faceModelURL.toString();
    if (faceModelURLString != _faceURLString) {
        if (faceModelURLString.isEmpty() || faceModelURLString.toLower().endsWith(".fst")) {
            // change the faceModelURL in the profile, it will also update this user's BlendFace
            myAvatar->setFaceModelURL(faceModelURL);
            UserActivityLogger::getInstance().changedModel("head", faceModelURLString);
            shouldDispatchIdentityPacket = true;
        } else {
            qDebug() << "ERROR: Head model not FST or blank - " << faceModelURLString;
        }
    }

    QUrl skeletonModelURL(ui.skeletonURLEdit->text());
    QString skeletonModelURLString = skeletonModelURL.toString();
    if (skeletonModelURLString != _skeletonURLString) {
        if (skeletonModelURLString.isEmpty() || skeletonModelURLString.toLower().endsWith(".fst")) {
            // change the skeletonModelURL in the profile, it will also update this user's Body
            myAvatar->setSkeletonModelURL(skeletonModelURL);
            UserActivityLogger::getInstance().changedModel("skeleton", skeletonModelURLString);
            shouldDispatchIdentityPacket = true;
        } else {
            qDebug() << "ERROR: Skeleton model not FST or blank - " << skeletonModelURLString;
        }
    }
    
    if (shouldDispatchIdentityPacket) {
        myAvatar->sendIdentityPacket();
    }
    
    if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableActivityLogger)
        != ui.sendDataCheckBox->isChecked()) {
        Menu::getInstance()->triggerOption(MenuOption::DisableActivityLogger);
    }

    if (!ui.snapshotLocationEdit->text().isEmpty() && QDir(ui.snapshotLocationEdit->text()).exists()) {
        SettingHandles::snapshotsLocation.set(ui.snapshotLocationEdit->text());
    }

    if (!ui.scriptsLocationEdit->text().isEmpty() && QDir(ui.scriptsLocationEdit->text()).exists()) {
        qApp->setScriptsLocation(ui.scriptsLocationEdit->text());
    }

    myAvatar->getHead()->setPupilDilation(ui.pupilDilationSlider->value() / (float)ui.pupilDilationSlider->maximum());
    myAvatar->setLeanScale(ui.leanScaleSpin->value());
    myAvatar->setClampedTargetScale(ui.avatarScaleSpin->value());
    
    auto glCanvas = DependencyManager::get<GLCanvas>();
    Application::getInstance()->resizeGL(glCanvas->width(), glCanvas->height());

    qApp->getViewFrustum()->setRealWorldFieldOfView(ui.realWorldFieldOfViewSpin->value());
    
    qApp->getViewFrustum()->setFieldOfView(ui.fieldOfViewSpin->value());
    
    auto faceshift = DependencyManager::get<Faceshift>();
    faceshift->setEyeDeflection(ui.faceshiftEyeDeflectionSider->value() /
                                (float)ui.faceshiftEyeDeflectionSider->maximum());
    
    faceshift->setHostname(ui.faceshiftHostnameEdit->text());
    
    qApp->getOctreeQuery().setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value());

    qApp->getApplicationOverlay().setOculusUIAngularSize(ui.oculusUIAngularSizeSpin->value());
    
    SixenseManager& sixense = SixenseManager::getInstance();
    sixense.setReticleMoveSpeed(ui.sixenseReticleMoveSpeedSpin->value());
    sixense.setInvertButtons(ui.invertSixenseButtonsCheckBox->isChecked());

    auto audio = DependencyManager::get<Audio>();
    MixedProcessedAudioStream& stream = audio->getReceivedAudioStream();
    
    stream.setDynamicJitterBuffers(ui.dynamicJitterBuffersCheckBox->isChecked());
    stream.setStaticDesiredJitterBufferFrames(ui.staticDesiredJitterBufferFramesSpin->value());
    stream.setMaxFramesOverDesired(ui.maxFramesOverDesiredSpin->value());
    stream.setUseStDevForJitterCalc(ui.useStdevForJitterCalcCheckBox->isChecked());
    stream.setWindowStarveThreshold(ui.windowStarveThresholdSpin->value());
    stream.setWindowSecondsForDesiredCalcOnTooManyStarves(ui.windowSecondsForDesiredCalcOnTooManyStarvesSpin->value());
    stream.setWindowSecondsForDesiredReduction(ui.windowSecondsForDesiredReductionSpin->value());
    stream.setRepetitionWithFade(ui.repetitionWithFadeCheckBox->isChecked());

    QMetaObject::invokeMethod(audio.data(), "setOutputBufferSize", Q_ARG(int, ui.outputBufferSizeSpinner->value()));

    audio->setOutputStarveDetectionEnabled(ui.outputStarveDetectionCheckBox->isChecked());
    audio->setOutputStarveDetectionThreshold(ui.outputStarveDetectionThresholdSpinner->value());
    audio->setOutputStarveDetectionPeriod(ui.outputStarveDetectionPeriodSpinner->value());

    Application::getInstance()->resizeGL(glCanvas->width(), glCanvas->height());
}
int MDnsSdListener::Handler::runCommand(SocketClient *cli,
                                        int argc, char **argv) {
    if (argc < 2) {
        char* msg = NULL;
        asprintf( &msg, "Invalid number of arguments to mdnssd: %i", argc);
        ALOGW("%s", msg);
        cli->sendMsg(ResponseCode::CommandParameterError, msg, false);
        free(msg);
        return -1;
    }

    char* cmd = argv[1];

    if (strcmp(cmd, "discover") == 0) {
        if (argc != 4) {
            cli->sendMsg(ResponseCode::CommandParameterError,
                    "Invalid number of arguments to mdnssd discover", false);
            return 0;
        }
        int requestId = atoi(argv[2]);
        char *serviceType = argv[3];

        discover(cli, NULL, serviceType, NULL, requestId, 0);
    } else if (strcmp(cmd, "stop-discover") == 0) {
        stop(cli, argc, argv, "discover");
    } else if (strcmp(cmd, "register") == 0) {
        if (argc != 6) {
            cli->sendMsg(ResponseCode::CommandParameterError,
                    "Invalid number of arguments to mdnssd register", false);
            return 0;
        }
        int requestId = atoi(argv[2]);
        char *serviceName = argv[3];
        char *serviceType = argv[4];
        int port = atoi(argv[5]);
        char *interfaceName = NULL; // will use all
        char *domain = NULL;        // will use default
        char *host = NULL;          // will use default hostname
        int textLen = 0;
        void *textRecord = NULL;

        serviceRegister(cli, requestId, interfaceName, serviceName,
                serviceType, domain, host, port, textLen, textRecord);
    } else if (strcmp(cmd, "stop-register") == 0) {
        stop(cli, argc, argv, "register");
    } else if (strcmp(cmd, "resolve") == 0) {
        if (argc != 6) {
            cli->sendMsg(ResponseCode::CommandParameterError,
                    "Invalid number of arguments to mdnssd resolve", false);
            return 0;
        }
        int requestId = atoi(argv[2]);
        char *interfaceName = NULL;  // will use all
        char *serviceName = argv[3];
        char *regType = argv[4];
        char *domain = argv[5];
        resolveService(cli, requestId, interfaceName, serviceName, regType, domain);
    } else if (strcmp(cmd, "stop-resolve") == 0) {
        stop(cli, argc, argv, "resolve");
    } else if (strcmp(cmd, "start-service") == 0) {
        if (mMonitor->startService()) {
            cli->sendMsg(ResponseCode::CommandOkay, "Service Started", false);
        } else {
            cli->sendMsg(ResponseCode::ServiceStartFailed, "Service already running", false);
        }
    } else if (strcmp(cmd, "stop-service") == 0) {
        if (mMonitor->stopService()) {
            cli->sendMsg(ResponseCode::CommandOkay, "Service Stopped", false);
        } else {
            cli->sendMsg(ResponseCode::ServiceStopFailed, "Service still in use", false);
        }
    } else if (strcmp(cmd, "sethostname") == 0) {
        if (argc != 4) {
            cli->sendMsg(ResponseCode::CommandParameterError,
                    "Invalid number of arguments to mdnssd sethostname", false);
            return 0;
        }
        int requestId = atoi(argv[2]);
        char *hostname = argv[3];
        setHostname(cli, requestId, hostname);
    } else if (strcmp(cmd, "stop-sethostname") == 0) {
        stop(cli, argc, argv, "sethostname");
    } else if (strcmp(cmd, "getaddrinfo") == 0) {
        if (argc != 4) {
            cli->sendMsg(ResponseCode::CommandParameterError,
                    "Invalid number of arguments to mdnssd getaddrinfo", false);
            return 0;
        }
        int requestId = atoi(argv[2]);
        char *hostname = argv[3];
        char *interfaceName = NULL;  // default
        int protocol = 0;            // intelligient heuristic (both v4 + v6)
        getAddrInfo(cli, requestId, interfaceName, protocol, hostname);
    } else if (strcmp(cmd, "stop-getaddrinfo") == 0) {
        stop(cli, argc, argv, "getaddrinfo");
    } else {
        if (VDBG) ALOGE("Unknown cmd %s", cmd);
        cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown mdnssd cmd", false);
        return 0;
    }
    return 0;
}
Exemplo n.º 17
0
SambaServer::nmbdThread::nmbdThread() {
	set_log_callback(xb_smbc_log);
	setHostname(SETTINGS::getInstance().getHostname().c_str());
	init_samba_server(SAMBA_ERROR_LEVEL);
	CreateThread(CPU2_THREAD_1);
}