当前位置: 首页>>代码示例>>C++>>正文


C++ ConfigValue函数代码示例

本文整理汇总了C++中ConfigValue函数的典型用法代码示例。如果您正苦于以下问题:C++ ConfigValue函数的具体用法?C++ ConfigValue怎么用?C++ ConfigValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ConfigValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ConfigValue

bool WaveformWidgetFactory::setWidgetType(WaveformWidgetType::Type type) {
    if (type == m_type)
        return true;

    // check if type is acceptable
    for (int i = 0; i < m_waveformWidgetHandles.size(); i++) {
        WaveformWidgetAbstractHandle& handle = m_waveformWidgetHandles[i];
        if (handle.m_type == type) {
            // type is acceptable
            m_type = type;
            if (m_config) {
                m_config->set(ConfigKey("[Waveform]","WaveformType"), ConfigValue((int)m_type));
            }
            return true;
        }
    }

    // fallback
    m_type = WaveformWidgetType::EmptyWaveform;
    if (m_config) {
        m_config->set(ConfigKey("[Waveform]","WaveformType"), ConfigValue((int)m_type));
    }
    return false;
}
开发者ID:MK-42,项目名称:mixxx,代码行数:24,代码来源:waveformwidgetfactory.cpp

示例2: ConfigValue

void WaveformWidgetFactory::setDisplayBeatGrid(bool sync) {
    m_beatGridEnabled = sync;
    if (m_config) {
        m_config->set(ConfigKey("[Waveform]", "beatGridLinesCheckBox"), ConfigValue(m_beatGridEnabled));
    }

    if (m_waveformWidgetHolders.size() == 0) {
        return;
    }

    for (int i = 0; i < m_waveformWidgetHolders.size(); i++) {
        m_waveformWidgetHolders[i].m_waveformWidget->setDisplayBeatGrid(m_beatGridEnabled);
    }

}
开发者ID:DJMaxergy,项目名称:mixxx,代码行数:15,代码来源:waveformwidgetfactory.cpp

示例3: qDebug

void BasePlaylistFeature::slotImportPlaylist() {
    qDebug() << "slotImportPlaylist() row:" ; //<< m_lastRightClickedIndex.data();

    if (!m_pPlaylistTableModel) {
        return;
    }

    QString lastPlaylistDirectory = m_pConfig->getValueString(
            ConfigKey("[Library]", "LastImportExportPlaylistDirectory"),
            QDesktopServices::storageLocation(QDesktopServices::MusicLocation));

    QString playlist_file = QFileDialog::getOpenFileName(
            NULL,
            tr("Import Playlist"),
            lastPlaylistDirectory,
            tr("Playlist Files (*.m3u *.m3u8 *.pls *.csv)"));
    // Exit method if user cancelled the open dialog.
    if (playlist_file.isNull() || playlist_file.isEmpty()) {
        return;
    }

    // Update the import/export playlist directory
    QFileInfo fileName(playlist_file);
    m_pConfig->set(ConfigKey("[Library]","LastImportExportPlaylistDirectory"),
                ConfigValue(fileName.dir().absolutePath()));

    Parser* playlist_parser = NULL;

    if (playlist_file.endsWith(".m3u", Qt::CaseInsensitive) ||
            playlist_file.endsWith(".m3u8", Qt::CaseInsensitive)) {
        playlist_parser = new ParserM3u();
    } else if (playlist_file.endsWith(".pls", Qt::CaseInsensitive)) {
        playlist_parser = new ParserPls();
    } else if (playlist_file.endsWith(".csv", Qt::CaseInsensitive)) {
        playlist_parser = new ParserCsv();
    } else {
        return;
    }
    QList<QString> entries = playlist_parser->parse(playlist_file);

    // Iterate over the List that holds URLs of playlist entires
    m_pPlaylistTableModel->addTracks(QModelIndex(), entries);

    // delete the parser object
    if (playlist_parser) {
        delete playlist_parser;
    }
}
开发者ID:educorzo,项目名称:mixxx,代码行数:48,代码来源:baseplaylistfeature.cpp

示例4: ConfigKey

bool TrackExportWizard::selectDestinationDirectory() {
    QString lastExportDirectory = m_pConfig->getValue(
            ConfigKey("[Library]", "LastTrackCopyDirectory"),
            QStandardPaths::writableLocation(QStandardPaths::MusicLocation));

    QString destDir = QFileDialog::getExistingDirectory(
            NULL, tr("Export Track Files To"), lastExportDirectory);
    if (destDir.isEmpty()) {
        return false;
    }
    m_pConfig->set(ConfigKey("[Library]", "LastTrackCopyDirectory"),
                   ConfigValue(destDir));

    m_worker.reset(new TrackExportWorker(destDir, m_tracks));
    m_dialog.reset(new TrackExportDlg(m_parent, m_pConfig, m_worker.data()));
    return true;
}
开发者ID:WaylonR,项目名称:mixxx,代码行数:17,代码来源:trackexportwizard.cpp

示例5: ConfigValue

void DlgPrefAutoDJ::slotEnableAutoDJRandomQueueComboBox(int a_iValue) {
#ifdef __AUTODJCRATES__
    if (a_iValue == 1) {
        // Requeue is enabled
        m_pConfig->set(ConfigKey("[Auto DJ]", "EnableRandomQueueBuff"),
                ConfigValue(0));
        ComboBoxAutoDjRandomQueue->setCurrentIndex(0);
        ComboBoxAutoDjRandomQueue->setEnabled(false);
        autoDJRandomQueueMinimumSpinBox->setEnabled(false);
    } else {
        ComboBoxAutoDjRandomQueue->setEnabled(true);
        autoDJRandomQueueMinimumSpinBox->setEnabled(
                m_pConfig->getValueString(
                        ConfigKey("[Auto DJ]", "EnableRandomQueueBuff"),"0").toInt());
    }
#endif // __AUTODJCRATES__
}
开发者ID:AndreiRO,项目名称:mixxx,代码行数:17,代码来源:dlgprefautodj.cpp

示例6: slotResetToDefaults

void DlgPrefAutoDJ::slotResetToDefaults() {
    // Re-queue tracks in AutoDJ
    ComboBoxAutoDjRequeue->setCurrentIndex(0);
    m_pConfig->set(ConfigKey("[Auto DJ]", "RequeueBuff"),ConfigValue(0));
    autoDjMinimumAvailableSpinBox->setValue(20);

    autoDjIgnoreTimeEdit->setTime(QTime::fromString(
            "23:59", autoDjIgnoreTimeEdit->displayFormat()));
    autoDjIgnoreTimeCheckBox->setChecked(false);
    m_pConfig->set(ConfigKey("[Auto DJ]", "UseIgnoreTimeBuff"),QString("0"));
    autoDjIgnoreTimeEdit->setEnabled(false);

    autoDJRandomQueueMinimumSpinBox->setValue(5);
    ComboBoxAutoDjRandomQueue->setCurrentIndex(0);
    m_pConfig->set(ConfigKey("[Auto DJ]", "EnableRandomQueueBuff"),QString("0"));
    autoDJRandomQueueMinimumSpinBox->setEnabled(false);
    ComboBoxAutoDjRandomQueue->setEnabled(true);
}
开发者ID:Alppasa,项目名称:mixxx,代码行数:18,代码来源:dlgprefautodj.cpp

示例7: ConfigValue

// Selects the option by its index. If it is a single-element option, 
// index 0 means disabled and 1 enabled.
void EncoderMp3Settings::setGroupOption(QString groupCode, int optionIndex)
{
    bool found=false;
    for (const auto& group : m_radioList) {
        if (groupCode == group.groupCode) {
            found=true;
            if (optionIndex < group.controlNames.size() || optionIndex == 1) {
                m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, ENCODING_MODE_GROUP),
                    ConfigValue(optionIndex));
            } else {
                qWarning() << "Received an index out of range for: " 
                    << groupCode << ", index: " << optionIndex;
            }
        }
    }
    if (!found) {
        qWarning() << "Received an unknown groupCode on setGroupOption: " << groupCode;
    }
}
开发者ID:DJMaxergy,项目名称:mixxx,代码行数:21,代码来源:encodermp3settings.cpp

示例8: ConfigValue

void AnalysisFeature::analyzeTracks(QList<int> trackIds) {
    if (m_pAnalyserQueue == NULL) {
        // Save the old BPM detection prefs setting (on or off)
        m_iOldBpmEnabled = m_pConfig->getValueString(ConfigKey("[BPM]","BPMDetectionEnabled")).toInt();
        // Force BPM detection to be on.
        m_pConfig->set(ConfigKey("[BPM]","BPMDetectionEnabled"), ConfigValue(1));
        // Note: this sucks... we should refactor the prefs/analyser to fix this hacky bit ^^^^.

        m_pAnalyserQueue = AnalyserQueue::createAnalysisFeatureAnalyserQueue(m_pConfig, m_pTrackCollection);

        connect(m_pAnalyserQueue, SIGNAL(trackProgress(int)),
                m_pAnalysisView, SLOT(trackAnalysisProgress(int)));
        connect(m_pAnalyserQueue, SIGNAL(trackFinished(int)),
                this, SLOT(slotProgressUpdate(int)));
        connect(m_pAnalyserQueue, SIGNAL(trackFinished(int)),
                m_pAnalysisView, SLOT(trackAnalysisFinished(int)));

        connect(m_pAnalyserQueue, SIGNAL(queueEmpty()),
                this, SLOT(cleanupAnalyser()));
        emit(analysisActive(true));
    }
开发者ID:AndreiRO,项目名称:mixxx,代码行数:21,代码来源:analysisfeature.cpp

示例9: md5

const ConfigValue
FRTConfigResponseV3::readConfigValue() const
{
    vespalib::string md5(_data->get()[RESPONSE_CONFIG_MD5].asString().make_string());
    CompressionInfo info;
    info.deserialize(_data->get()[RESPONSE_COMPRESSION_INFO]);
    Slime * rawData = new Slime();
    SlimePtr payloadData(rawData);
    DecompressedData data(decompress(((*_returnValues)[1]._data._buf), ((*_returnValues)[1]._data._len), info.compressionType, info.uncompressedSize));
    if (data.memRef.size > 0) {
        size_t consumedSize = JsonFormat::decode(data.memRef, *rawData);
        if (consumedSize == 0) {
            std::string json(make_json(*payloadData, true));
            LOG(error, "Error decoding JSON. Consumed size: %lu, uncompressed size: %u, compression type: %s, assumed uncompressed size(%u), compressed size: %u, slime(%s)", consumedSize, data.size, compressionTypeToString(info.compressionType).c_str(), info.uncompressedSize, ((*_returnValues)[1]._data._len), json.c_str());
            LOG_ABORT("Error decoding JSON");
        }
    }
    if (LOG_WOULD_LOG(spam)) {
        LOG(spam, "read config value md5(%s), payload size: %lu", md5.c_str(), data.memRef.size);
    }
    return ConfigValue(PayloadPtr(new V3Payload(payloadData)), md5);
}
开发者ID:songhtdo,项目名称:vespa,代码行数:22,代码来源:frtconfigresponsev3.cpp

示例10: ConfigValue

void DlgPrefPlaylist::slotApply() {
    m_pconfig->set(ConfigKey("[Promo]","StatTracking"),
                ConfigValue((int)checkBoxPromoStats->isChecked()));
    m_pconfig->set(ConfigKey("[Library]","RescanOnStartup"),
                ConfigValue((int)checkBox_library_scan->isChecked()));
    m_pconfig->set(ConfigKey("[Library]","WriteAudioTags"),
                ConfigValue((int)checkbox_ID3_sync->isChecked()));
    m_pconfig->set(ConfigKey("[Library]","UseRelativePathOnExport"),
                ConfigValue((int)checkBox_use_relative_path->isChecked()));
    m_pconfig->set(ConfigKey("[Library]","ShowRhythmboxLibrary"),
                ConfigValue((int)checkBox_show_rhythmbox->isChecked()));
    m_pconfig->set(ConfigKey("[Library]","ShowITunesLibrary"),
                ConfigValue((int)checkBox_show_itunes->isChecked()));
    m_pconfig->set(ConfigKey("[Library]","ShowTraktorLibrary"),
                ConfigValue((int)checkBox_show_traktor->isChecked()));

    if (LineEditSongfiles->text() !=
            m_pconfig->getValueString(ConfigKey("[Playlist]","Directory"))) {
        m_pconfig->set(ConfigKey("[Playlist]","Directory"), LineEditSongfiles->text());
        emit(apply());
    }
    m_pconfig->Save();
}
开发者ID:AlbanBedel,项目名称:mixxx,代码行数:23,代码来源:dlgprefplaylist.cpp

示例11: QDir


//.........这里部分代码省略.........
        QFile::remove(oldLocation.filePath(".MixxxMIDIDevice.xml")); // Obsolete file, so just delete it
#endif

#ifdef __WINDOWS__
        oldFilePath = oldLocation.filePath("mixxx.cfg");
#else
        oldFilePath = oldLocation.filePath(".mixxx.cfg");
#endif
        newFilePath = newLocation.filePath(SETTINGS_FILE);
        oldFile = new QFile(oldFilePath);
        if (oldFile->copy(newFilePath))
            oldFile->remove();
        else {
                if (oldFile->error()==14) qDebug() << errorText.arg("configuration", oldFilePath, newFilePath) << "The destination file already exists.";
                else qDebug() << errorText.arg("configuration", oldFilePath, newFilePath) << "Error #" << oldFile->error();
            }
        delete oldFile;

    }
    // Tidy up
    delete pre170Config;
    // End pre-1.7.0 code


/***************************************************************************
*                           Post-1.7.0 upgrade code
*
*   Add entries to the IF ladder below if anything needs to change from the
*   previous to the current version. This allows for incremental upgrades
*   in case a user upgrades from a few versions prior.
****************************************************************************/

    // Read the config file from home directory
    UserSettingsPointer config(new ConfigObject<ConfigValue>(
        QDir(settingsPath).filePath(SETTINGS_FILE)));

    QString configVersion = config->getValueString(ConfigKey("[Config]","Version"));

    if (configVersion.isEmpty()) {

#ifdef __APPLE__
        qDebug() << "Config version is empty, trying to read pre-1.9.0 config";
        // Try to read the config from the pre-1.9.0 final directory on OS X (we moved it in 1.9.0 final)
        QScopedPointer<QFile> oldConfigFile(new QFile(QDir::homePath().append("/").append(".mixxx/mixxx.cfg")));
        if (oldConfigFile->exists() && ! CmdlineArgs::Instance().getSettingsPathSet()) {
            qDebug() << "Found pre-1.9.0 config for OS X";
            // Note: We changed SETTINGS_PATH in 1.9.0 final on OS X so it must be hardcoded to ".mixxx" here for legacy.
            config = UserSettingsPointer(new ConfigObject<ConfigValue>(
                QDir::homePath().append("/.mixxx/mixxx.cfg")));
            // Just to be sure all files like logs and soundconfig go with mixxx.cfg
            // TODO(XXX) Trailing slash not needed anymore as we switches from String::append
            // to QDir::filePath elsewhere in the code. This is candidate for removal.
            CmdlineArgs::Instance().setSettingsPath(QDir::homePath().append("/.mixxx/"));
            configVersion = config->getValueString(ConfigKey("[Config]","Version"));
        }
        else {
#elif __WINDOWS__
        qDebug() << "Config version is empty, trying to read pre-1.12.0 config";
        // Try to read the config from the pre-1.12.0 final directory on Windows (we moved it in 1.12.0 final)
        QScopedPointer<QFile> oldConfigFile(new QFile(QDir::homePath().append("/Local Settings/Application Data/Mixxx/mixxx.cfg")));
        if (oldConfigFile->exists() && ! CmdlineArgs::Instance().getSettingsPathSet()) {
            qDebug() << "Found pre-1.12.0 config for Windows";
            // Note: We changed SETTINGS_PATH in 1.12.0 final on Windows so it must be hardcoded to "Local Settings/Application Data/Mixxx/" here for legacy.
            config = UserSettingsPointer(new ConfigObject<ConfigValue>(
                QDir::homePath().append("/Local Settings/Application Data/Mixxx/mixxx.cfg")));
            // Just to be sure all files like logs and soundconfig go with mixxx.cfg
开发者ID:badescunicu,项目名称:mixxx,代码行数:67,代码来源:upgrade.cpp

示例12: ConfigValue

void ReplayGainSettings::setReplayGainReanalyze(bool value) {
    m_pConfig->set(ConfigKey(kConfigKey, kReplayGainReanalyze),
                ConfigValue(value));
}
开发者ID:DJMaxergy,项目名称:mixxx,代码行数:4,代码来源:replaygainsettings.cpp

示例13: ConfigValue

void DlgPrefRecord::slotChangeSplitSize() {
        m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "FileSize"),
                    ConfigValue(comboBoxSplitting->currentText()));

}
开发者ID:MLudgate,项目名称:mixxx,代码行数:5,代码来源:dlgprefrecord.cpp

示例14: ConfigValue

void DlgPrefReplayGain::slotSetRGAnalyserEnabled() {
    int enabled = EnableAnalyser->isChecked() ? 1 : 0;
    config->set(ConfigKey(kConfigKey,"ReplayGainAnalyserEnabled"),
                ConfigValue(enabled));
    slotApply();
}
开发者ID:calabrhoouse,项目名称:mixxx,代码行数:6,代码来源:dlgprefreplaygain.cpp

示例15: while

bool EngineShoutcast::serverConnect() {
    // set to busy in case another thread calls one of the other
    // EngineShoutcast calls
    m_iShoutStatus = SHOUTERR_BUSY;
    m_pShoutcastStatus->set(SHOUTCAST_CONNECTING);
    // reset the number of failures to zero
    m_iShoutFailures = 0;
    // set to a high number to automatically update the metadata
    // on the first change
    m_iMetaDataLife = 31337;
    // clear metadata, to make sure the first track is not skipped
    // because it was sent via an previous connection (see metaDataHasChanged)
    if(m_pMetaData) {
        m_pMetaData.clear();
    }
    //If static metadata is available, we only need to send metadata one time
    m_firstCall = false;

    /*Check if m_encoder is initalized
     * Encoder is initalized in updateFromPreferences which is called always before serverConnect()
     * If m_encoder is NULL, then we propably want to use MP3 streaming, however, lame could not be found
     * It does not make sense to connect
     */
    if(m_encoder == NULL){
        m_pConfig->set(ConfigKey(SHOUTCAST_PREF_KEY,"enabled"),ConfigValue("0"));
        m_pShoutcastStatus->set(SHOUTCAST_DISCONNECTED);
        return false;
    }
    const int iMaxTries = 3;
    while (!m_bQuit && m_iShoutFailures < iMaxTries) {
        if (m_pShout)
            shout_close(m_pShout);

        m_iShoutStatus = shout_open(m_pShout);
        if (m_iShoutStatus == SHOUTERR_SUCCESS)
            m_iShoutStatus = SHOUTERR_CONNECTED;

        if ((m_iShoutStatus == SHOUTERR_BUSY) ||
            (m_iShoutStatus == SHOUTERR_CONNECTED) ||
            (m_iShoutStatus == SHOUTERR_SUCCESS))
            break;

        m_iShoutFailures++;
        qDebug() << "Shoutcast failed connect. Failures:" << m_iShoutFailures;
        sleep(1);
    }
    if (m_iShoutFailures == iMaxTries) {
        if (m_pShout)
            shout_close(m_pShout);
        m_pConfig->set(ConfigKey(SHOUTCAST_PREF_KEY,"enabled"),ConfigValue("0"));
        m_pShoutcastStatus->set(SHOUTCAST_DISCONNECTED);
        return false;
    }
    if (m_bQuit) {
        if (m_pShout)
            shout_close(m_pShout);
        m_pShoutcastStatus->set(SHOUTCAST_DISCONNECTED);
        return false;
    }

    m_iShoutFailures = 0;
    int timeout = 0;
    while (m_iShoutStatus == SHOUTERR_BUSY && timeout < TIMEOUT) {
        qDebug() << "Connection pending. Sleeping...";
        sleep(1);
        m_iShoutStatus = shout_get_connected(m_pShout);
        ++ timeout;
    }
    if (m_iShoutStatus == SHOUTERR_CONNECTED) {
        qDebug() << "***********Connected to Shoutcast server...";
        m_pShoutcastStatus->set(SHOUTCAST_CONNECTED);
        return true;
    }
    //otherwise disable shoutcast in preferences
    m_pConfig->set(ConfigKey(SHOUTCAST_PREF_KEY,"enabled"),ConfigValue("0"));
    if(m_pShout){
        shout_close(m_pShout);
        //errorDialog(tr("Mixxx could not connect to the server"), tr("Please check your connection to the Internet and verify that your username and password are correct."));
    }
    m_pShoutcastStatus->set(SHOUTCAST_DISCONNECTED);
    return false;
}
开发者ID:troyane,项目名称:mixxx,代码行数:82,代码来源:engineshoutcast.cpp


注:本文中的ConfigValue函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。