示例#1
0
文件: Audio.cpp 项目: Menithal/hifi
Audio::Audio() : _devices(_contextIsHMD) {
    auto client = DependencyManager::get<AudioClient>().data();
    connect(client, &AudioClient::muteToggled, this, &Audio::setMuted);
    connect(client, &AudioClient::noiseReductionChanged, this, &Audio::enableNoiseReduction);
    connect(client, &AudioClient::warnWhenMutedChanged, this, &Audio::enableWarnWhenMuted);
    connect(client, &AudioClient::inputLoudnessChanged, this, &Audio::onInputLoudnessChanged);
    connect(client, &AudioClient::inputVolumeChanged, this, &Audio::setInputVolume);
    connect(this, &Audio::contextChanged, &_devices, &AudioDevices::onContextChanged);
    connect(this, &Audio::pushingToTalkChanged, this, &Audio::handlePushedToTalk);
    enableNoiseReduction(enableNoiseReductionSetting.get());
    enableWarnWhenMuted(enableWarnWhenMutedSetting.get());
    onContextChanged();
}
示例#2
0
void ModelSelector::browse() {
    static Setting::Handle<QString> lastModelBrowseLocation("LastModelBrowseLocation",
                                                            QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
    QString filename = QFileDialog::getOpenFileName(NULL, "Select your model file ...",
                                                    lastModelBrowseLocation.get(),
                                                    "Model files (*.fst *.fbx)");
    QFileInfo fileInfo(filename);
    
    if (fileInfo.isFile() && fileInfo.completeSuffix().contains(QRegExp("fst|fbx|FST|FBX"))) {
        _modelFile = fileInfo;
        _browseButton->setText(fileInfo.fileName());
        lastModelBrowseLocation.set(fileInfo.path());
    }
}
示例#3
0
void AddressManager::loadSettings(const QString& lookupString) {
    if (lookupString.isEmpty()) {
        handleUrl(currentAddressHandle.get().toString(), LookupTrigger::StartupFromSettings);
    } else {
        handleUrl(lookupString, LookupTrigger::StartupFromSettings);
    }
}
示例#4
0
文件: native.cpp 项目: birarda/hifi
JNIEXPORT jboolean JNICALL
Java_io_highfidelity_hifiinterface_fragment_SettingsFragment_getHifiSettingBoolean(JNIEnv *env,
                                                                                   jobject instance,
                                                                                   jstring group_,
                                                                                   jstring key_,
                                                                                   jboolean defaultValue) {
    const char *c_group = env->GetStringUTFChars(group_, 0);
    const char *c_key = env->GetStringUTFChars(key_, 0);

    const QString group = QString::fromUtf8(c_group);
    const QString key = QString::fromUtf8(c_key);

    env->ReleaseStringUTFChars(group_, c_group);
    env->ReleaseStringUTFChars(key_, c_key);

    Setting::Handle<bool> setting { QStringList() << group << key , defaultValue};
    return setting.get();
}
示例#5
0
文件: native.cpp 项目: birarda/hifi
JNIEXPORT void JNICALL
Java_io_highfidelity_hifiinterface_fragment_SettingsFragment_updateHifiSetting(JNIEnv *env,
                                                                               jobject instance,
                                                                               jstring group_,
                                                                               jstring key_,
                                                                               jboolean value_) {
    const char *c_group = env->GetStringUTFChars(group_, 0);
    const char *c_key = env->GetStringUTFChars(key_, 0);

    const QString group = QString::fromUtf8(c_group);
    const QString key = QString::fromUtf8(c_key);

    env->ReleaseStringUTFChars(group_, c_group);
    env->ReleaseStringUTFChars(key_, c_key);

    bool value = value_;

    Setting::Handle<bool> setting { QStringList() << group << key , !value };
    setting.set(value);
}
示例#6
0
void LODManager::saveSettings() {
    desktopLODDecreaseFPS.set(getDesktopLODDecreaseFPS());
    hmdLODDecreaseFPS.set(getHMDLODDecreaseFPS());
}
示例#7
0
void LODManager::loadSettings() {
    setDesktopLODDecreaseFPS(desktopLODDecreaseFPS.get());
    setHMDLODDecreaseFPS(hmdLODDecreaseFPS.get());
}
示例#8
0
void AddressManager::storeCurrentAddress() {
    currentAddressHandle.set(currentAddress());
}
示例#9
0
void OctreeQuery::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
    if (maxOctreePPS != _maxOctreePPS) {
        _maxOctreePPS = maxOctreePPS;
        maxOctreePacketsPerSecond.set(_maxOctreePPS);
    }
}
示例#10
0
OctreeQuery::OctreeQuery() {
    _maxOctreePPS = maxOctreePacketsPerSecond.get();
}
示例#11
0
AvatarInputs::AvatarInputs(QQuickItem* parent) :  QQuickItem(parent) {
    INSTANCE = this;
    _mirrorZoomed = rearViewZoomLevel.get() != 0;
}
示例#12
0
void AvatarInputs::toggleZoom() {
    _mirrorZoomed = !_mirrorZoomed;
    rearViewZoomLevel.set(_mirrorZoomed ? 0 : 1);
    emit mirrorZoomedChanged();
}