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


C++ ConfigKey函数代码示例

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


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

示例1: ConfigValue

void WaveformWidgetFactory::setZoomSync(bool sync) {
    m_zoomSync = sync;
    if (m_config) {
        m_config->set(ConfigKey("[Waveform]","ZoomSynchronization"), ConfigValue(m_zoomSync));
    }

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

    int refZoom = m_waveformWidgetHolders[0].m_waveformWidget->getZoomFactor();
    for (int i = 1; i < m_waveformWidgetHolders.size(); i++) {
        m_waveformWidgetHolders[i].m_waveformViewer->setZoom(refZoom);
    }
}
开发者ID:Vicentecarrillo,项目名称:mixxx,代码行数:15,代码来源:waveformwidgetfactory.cpp

示例2: TEST_F

TEST_F(ControllerEngineTest, connectControl_ByLambda) {
    // Test that connecting with an anonymous function works.
    auto co = std::make_unique<ControlObject>(ConfigKey("[Test]", "co"));
    auto pass = std::make_unique<ControlObject>(ConfigKey("[Test]", "passed"));

    ScopedTemporaryFile script(makeTemporaryFile(
        "var connection = engine.connectControl('[Test]', 'co', function(value) { "
        "  var pass = engine.getValue('[Test]', 'passed');"
        "  engine.setValue('[Test]', 'passed', pass + 1.0); });"
        "connection.trigger();"
        "function disconnect() { "
        "  connection.disconnect();"
        "  engine.trigger('[Test]', 'co'); }"));

    cEngine->evaluate(script->fileName());
    EXPECT_FALSE(cEngine->hasErrors(script->fileName()));
    // ControlObjectScript connections are processed via QueuedConnection. Use
    // processEvents() to cause Qt to deliver them.
    application()->processEvents();
    EXPECT_TRUE(execute("disconnect"));
    application()->processEvents();
    // The counter should have been incremented exactly once.
    EXPECT_DOUBLE_EQ(1.0, pass->get());
}
开发者ID:mixxxdj,项目名称:mixxx,代码行数:24,代码来源:controllerengine_test.cpp

示例3: ConfigKey

// Update the dialog when the crossfader mode is changed
void DlgPrefCrossfader::slotUpdate() {
    if (radioButtonAdditive->isChecked()) {
        m_xFaderMode = MIXXX_XFADER_ADDITIVE;
    }
    if (radioButtonConstantPower->isChecked()) {
        m_xFaderMode = MIXXX_XFADER_CONSTPWR;
        double sliderTransform = m_config->getValueString(
                ConfigKey(kConfigKey, "xFaderCurve")).toDouble();
        double sliderVal = SliderXFader->maximum()
                / kXFaderSteepnessCoeff * (sliderTransform - 1.);
        SliderXFader->setValue((int)sliderVal);
    }

    slotUpdateXFader();
}
开发者ID:raulbehl,项目名称:mixxx,代码行数:16,代码来源:dlgprefcrossfader.cpp

示例4: lock

void CueControl::trackLoaded(TrackPointer pTrack) {
    QMutexLocker lock(&m_mutex);
    if (m_pLoadedTrack)
        trackUnloaded(m_pLoadedTrack);

    if (!pTrack) {
        return;
    }

    m_pLoadedTrack = pTrack;
    connect(pTrack.data(), SIGNAL(cuesUpdated()),
            this, SLOT(trackCuesUpdated()),
            Qt::DirectConnection);

    Cue* loadCue = NULL;
    const QList<Cue*>& cuePoints = pTrack->getCuePoints();
    QListIterator<Cue*> it(cuePoints);
    while (it.hasNext()) {
        Cue* pCue = it.next();
        if (pCue->getType() == Cue::LOAD) {
            loadCue = pCue;
        } else if (pCue->getType() != Cue::CUE) {
            continue;
        }
        int hotcue = pCue->getHotCue();
        if (hotcue != -1)
            attachCue(pCue, hotcue);
    }

    double loadCuePoint = 0.0;
    if (loadCue != NULL) {
        m_pCuePoint->set(loadCue->getPosition());

        // If cue recall is ON in the prefs, then we're supposed to seek to the cue
        // point on song load. Note that [Controls],cueRecall == 0 corresponds to "ON", not OFF.
        if (!getConfig()->getValueString(
                ConfigKey("[Controls]","CueRecall")).toInt()) {
            loadCuePoint = loadCue->getPosition();
        }
    } else {
        // If no cue point is stored, set one at track start
        m_pCuePoint->set(0.0);
    }

    // Need to unlock before emitting any signals to prevent deadlock.
    lock.unlock();
    seekExact(loadCuePoint);
}
开发者ID:Gussss,项目名称:mixxx,代码行数:48,代码来源:cuecontrol.cpp

示例5: if

void DlgPrefVinyl::slotUpdate()
{
    // Set vinyl control types in the comboboxes
    int combo_index = ComboBoxVinylType1->findText(config->getValueString(ConfigKey("[Channel1]","vinylcontrol_vinyl_type")));
    if (combo_index != -1)
        ComboBoxVinylType1->setCurrentIndex(combo_index);

    combo_index = ComboBoxVinylType2->findText(config->getValueString(ConfigKey("[Channel2]","vinylcontrol_vinyl_type")));
    if (combo_index != -1)
        ComboBoxVinylType2->setCurrentIndex(combo_index);

    combo_index = ComboBoxVinylSpeed1->findText(config->getValueString(ConfigKey("[Channel1]","vinylcontrol_speed_type")));
    if (combo_index != -1)
        ComboBoxVinylSpeed1->setCurrentIndex(combo_index);

    combo_index = ComboBoxVinylSpeed2->findText(config->getValueString(ConfigKey("[Channel2]","vinylcontrol_speed_type")));
    if (combo_index != -1)
        ComboBoxVinylSpeed2->setCurrentIndex(combo_index);

    // set lead-in time
    LeadinTime->setText (config->getValueString(ConfigKey(VINYL_PREF_KEY,"lead_in_time")) );

    // set Relative mode
    int iMode = config->getValueString(ConfigKey(VINYL_PREF_KEY,"mode")).toInt();
    if (iMode == MIXXX_VCMODE_ABSOLUTE)
        AbsoluteMode->setChecked(true);
    else if (iMode == MIXXX_VCMODE_RELATIVE)
        RelativeMode->setChecked(true);

    // Honour the Needle Skip Prevention setting.
    NeedleSkipEnable->setChecked( (bool)config->getValueString( ConfigKey(VINYL_PREF_KEY, "needle_skip_prevention") ).toInt() );

    SignalQualityEnable->setChecked((bool)config->getValueString(ConfigKey(VINYL_PREF_KEY, "show_signal_quality") ).toInt() );

    //set vinyl control gain
    VinylGain->setValue( config->getValueString(ConfigKey(VINYL_PREF_KEY,"gain")).toInt());

    m_signalWidget1.setVinylActive(m_pVCManager->vinylInputEnabled(0));
    m_signalWidget2.setVinylActive(m_pVCManager->vinylInputEnabled(1));
}
开发者ID:alexpaulzor,项目名称:mixxx,代码行数:40,代码来源:dlgprefvinyl.cpp

示例6: getFileSplitSize

long RecordingManager::getFileSplitSize()
{
     QString fileSizeStr = m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY,"FileSize"));
     if(fileSizeStr == SPLIT_650MB)
         return SIZE_650MB;
     else if(fileSizeStr == SPLIT_700MB)
         return SIZE_700MB;
     else if(fileSizeStr == SPLIT_1024MB)
         return SIZE_1GB;
     else if(fileSizeStr == SPLIT_2048MB)
         return SIZE_2GB;
     else if(fileSizeStr == SPLIT_4096MB)
         return SIZE_4GB;
     else
         return SIZE_650MB;
}
开发者ID:AlbanBedel,项目名称:mixxx,代码行数:16,代码来源:recordingmanager.cpp

示例7: QObject

LibraryControl::LibraryControl(QObject* pParent)
        : QObject(pParent),
          m_pLibraryWidget(NULL),
          m_pSidebarWidget(NULL),
          m_numDecks("[Master]", "num_decks"),
          m_numSamplers("[Master]", "num_samplers"),
          m_numPreviewDecks("[Master]", "num_preview_decks") {

    slotNumDecksChanged(m_numDecks.get());
    slotNumSamplersChanged(m_numSamplers.get());
    slotNumPreviewDecksChanged(m_numPreviewDecks.get());
    connect(&m_numDecks, SIGNAL(valueChanged(double)),
            this, SLOT(slotNumDecksChanged(double)));
    connect(&m_numSamplers, SIGNAL(valueChanged(double)),
            this, SLOT(slotNumSamplersChanged(double)));
    connect(&m_numPreviewDecks, SIGNAL(valueChanged(double)),
            this, SLOT(slotNumPreviewDecksChanged(double)));

    // Make controls for library navigation and track loading. Leaking all these
    // CO's, but oh well?

    m_pSelectNextTrack = new ControlPushButton(ConfigKey("[Playlist]", "SelectNextTrack"));
    connect(m_pSelectNextTrack, SIGNAL(valueChanged(double)),
            this, SLOT(slotSelectNextTrack(double)));

    m_pSelectPrevTrack = new ControlPushButton(ConfigKey("[Playlist]", "SelectPrevTrack"));
    connect(m_pSelectPrevTrack, SIGNAL(valueChanged(double)),
            this, SLOT(slotSelectPrevTrack(double)));

    m_pSelectNextPlaylist = new ControlPushButton(ConfigKey("[Playlist]", "SelectNextPlaylist"));
    connect(m_pSelectNextPlaylist, SIGNAL(valueChanged(double)),
            this, SLOT(slotSelectNextSidebarItem(double)));

    m_pSelectPrevPlaylist = new ControlPushButton(ConfigKey("[Playlist]", "SelectPrevPlaylist"));
    connect(m_pSelectPrevPlaylist, SIGNAL(valueChanged(double)),
            this, SLOT(slotSelectPrevSidebarItem(double)));

    m_pToggleSidebarItem = new ControlPushButton(ConfigKey("[Playlist]", "ToggleSelectedSidebarItem"));
    connect(m_pToggleSidebarItem, SIGNAL(valueChanged(double)),
            this, SLOT(slotToggleSelectedSidebarItem(double)));

    m_pLoadSelectedIntoFirstStopped = new ControlPushButton(ConfigKey("[Playlist]","LoadSelectedIntoFirstStopped"));
    connect(m_pLoadSelectedIntoFirstStopped, SIGNAL(valueChanged(double)),
            this, SLOT(slotLoadSelectedIntoFirstStopped(double)));

    m_pSelectTrackKnob = new ControlPushButton(ConfigKey("[Playlist]","SelectTrackKnob"));
    connect(m_pSelectTrackKnob, SIGNAL(valueChanged(double)),
            this, SLOT(slotSelectTrackKnob(double)));
}
开发者ID:Gussss,项目名称:mixxx,代码行数:49,代码来源:librarycontrol.cpp

示例8: tr

void DlgPrefRecord::slotBrowseRecordingsDir() {
    QString fd = QFileDialog::getExistingDirectory(
            this, tr("Choose recordings directory"),
            m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY,
                                                "Directory")));

    if (fd != "") {
        // The user has picked a new directory via a file dialog. This means the
        // system sandboxer (if we are sandboxed) has granted us permission to
        // this folder. Create a security bookmark while we have permission so
        // that we can access the folder on future runs. We need to canonicalize
        // the path so we first wrap the directory string with a QDir.
        QDir directory(fd);
        Sandbox::createSecurityToken(directory);
        LineEditRecordings->setText(fd);
    }
}
开发者ID:MLudgate,项目名称:mixxx,代码行数:17,代码来源:dlgprefrecord.cpp

示例9: ChannelInfo

void EngineMaster::addChannel(EngineChannel* pChannel) {
    ChannelInfo* pChannelInfo = new ChannelInfo();
    pChannelInfo->m_pChannel = pChannel;
    pChannelInfo->m_pVolumeControl = new ControlLogpotmeter(
        ConfigKey(pChannel->getGroup(), "volume"), 1.0);
    pChannelInfo->m_pVolumeControl->setDefaultValue(1.0);
    pChannelInfo->m_pVolumeControl->set(1.0);
    pChannelInfo->m_pBuffer = SampleUtil::alloc(MAX_BUFFER_LEN);
    SampleUtil::applyGain(pChannelInfo->m_pBuffer, 0, MAX_BUFFER_LEN);
    m_channels.push_back(pChannelInfo);

    EngineBuffer* pBuffer = pChannelInfo->m_pChannel->getEngineBuffer();
    if (pBuffer != NULL) {
        pBuffer->bindWorkers(m_pWorkerScheduler);
        pBuffer->setEngineMaster(this);
    }
}
开发者ID:bkgood,项目名称:mixxx,代码行数:17,代码来源:enginemaster.cpp

示例10: m_pController

MidiOutputHandler::MidiOutputHandler(QString group, QString key,
                                     MidiController *controller,
                                     float min, float max,
                                     unsigned char status, unsigned char midino,
                                     unsigned char on, unsigned char off)
        : m_pController(controller),
          m_cobj(ControlObject::getControl(ConfigKey(group, key))),
          m_min(min),
          m_max(max),
          m_status(status),
          m_midino(midino),
          m_on(on),
          m_off(off),
          m_lastVal(0) {
    connect(&m_cobj, SIGNAL(valueChanged(double)),
            this, SLOT(controlChanged(double)));
}
开发者ID:bkgood,项目名称:mixxx,代码行数:17,代码来源:midioutputhandler.cpp

示例11: ConfigKey

void DlgPreferences::onShow() {
    // init m_geometry
    if (m_geometry.length() < 4) {
        // load default values (optimum size)
        m_geometry = m_pConfig->getValue(
                    ConfigKey("[Preferences]", "geometry")).split(",");
        if (m_geometry.length() < 4) {
            // Warning! geometry does NOT include the frame/title.
            QRect defaultGeometry = getDefaultGeometry();
            m_geometry.clear();
            m_geometry.append(QString::number(defaultGeometry.left()));
            m_geometry.append(QString::number(defaultGeometry.top()));
            m_geometry.append(QString::number(defaultGeometry.width()));
            m_geometry.append(QString::number(defaultGeometry.height()));
        }
    }
    int newX = m_geometry[0].toInt();
    int newY = m_geometry[1].toInt();
    newX = std::max(0, std::min(newX, QApplication::desktop()->screenGeometry().width()- m_geometry[2].toInt()));
    newY = std::max(0, std::min(newY, QApplication::desktop()->screenGeometry().height() - m_geometry[3].toInt()));
    m_geometry[0] = QString::number(newX);
    m_geometry[1] = QString::number(newY);

    // Update geometry with last values
#ifdef __WINDOWS__
    resize(m_geometry[2].toInt(), m_geometry[3].toInt());
#else
    // On linux, when the window is opened for the first time by the window manager, QT does not have
    // information about the frame size so the offset is zero. As such, the first time it opens the window
    // does not include the offset, so it is moved from the last position it had.
    // Excluding the offset from the saved value tries to fix that.
    int offsetX = geometry().left() - frameGeometry().left();
    int offsetY = geometry().top() - frameGeometry().top();
    newX += offsetX;
    newY += offsetY;
    setGeometry(newX,  // x position
                newY,  // y position
                m_geometry[2].toInt(),  // width
                m_geometry[3].toInt()); // height
#endif
    // Move is also needed on linux.
    move(newX, newY);

    // Notify children that we are about to show.
    emit(showDlg());
}
开发者ID:WaylonR,项目名称:mixxx,代码行数:46,代码来源:dlgpreferences.cpp

示例12: 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

示例13: DBG

void TrackCollection::run() {
    QThread::currentThread()->setObjectName("TrackCollection");
    DBG() << "id=" << QThread::currentThreadId()
          << "name=" << QThread::currentThread()->objectName();

    qRegisterMetaType<QSet<int> >("QSet<int>");

    DBG() << "Initializing DAOs inside TrackCollection's thread";

    createAndPopulateDbConnection();

    m_trackDao->initialize();
    m_playlistDao->initialize();
    m_crateDao->initialize();
    m_cueDao->initialize();

    m_pCOTPlaylistIsBusy = new ControlObjectThread(ConfigKey("[Playlist]", "isBusy"));
    Q_ASSERT(m_pCOTPlaylistIsBusy!=NULL);

    emit(initialized()); // to notify that Daos can be used

    func lambda;
    // main TrackCollection's loop
    while (!m_stop) {
        if (!m_semLambdasReadyToCall.tryAcquire(1)) {
            // no Lambda available, so unlock GUI.
            m_pCOTPlaylistIsBusy->set(0.0);
            m_semLambdasReadyToCall.acquire(1); // Sleep until new Lambdas have arrived
        }
        // got lambda on queue (or needness to stop thread)
        if (m_stop) {
            DBG() << "Need to stop thread";
            break;
        }
        if (!m_lambdas.isEmpty()) {
            m_lambdasQueueMutex.lock();
            lambda = m_lambdas.dequeue();
            m_lambdasQueueMutex.unlock();
            lambda();
            m_semLambdasFree.release(1);
        }
    }
    deleteLater();
    DBG() << " ### Thread ended ###";
}
开发者ID:troyane,项目名称:mixxx,代码行数:45,代码来源:trackcollection.cpp

示例14: ConfigKey

bool BrowseTableModel::isTrackInUse(const QString &track_location) const {
    int decks = ControlObject::getControl(
        ConfigKey("[Master]", "num_decks"))->get();
    // check if file is loaded to a deck
    for (int i = 1; i <= decks; ++i) {
        TrackPointer loaded_track = PlayerInfo::Instance().getTrackInfo(
            QString("[Channel%1]").arg(i));
        if (loaded_track && (loaded_track->getLocation() == track_location)) {
            return true;
        }
    }

    if (m_pRecordingManager->getRecordingLocation() == track_location) {
        return true;
    }

    return false;
}
开发者ID:alexpaulzor,项目名称:mixxx,代码行数:18,代码来源:browsetablemodel.cpp

示例15: setDefaultShelves

void DlgPrefEQ::loadSettings()
{
    QString highEqCourse = m_pConfig->getValueString(ConfigKey(CONFIG_KEY, "HiEQFrequency"));
    QString highEqPrecise = m_pConfig->getValueString(ConfigKey(CONFIG_KEY, "HiEQFrequencyPrecise"));
    QString lowEqCourse = m_pConfig->getValueString(ConfigKey(CONFIG_KEY, "LoEQFrequency"));
    QString lowEqPrecise = m_pConfig->getValueString(ConfigKey(CONFIG_KEY, "LoEQFrequencyPrecise"));

    double lowEqFreq = 0.0;
    double highEqFreq = 0.0;

    // Precise takes precedence over course.
    lowEqFreq = lowEqCourse.isEmpty() ? lowEqFreq : lowEqCourse.toDouble();
    lowEqFreq = lowEqPrecise.isEmpty() ? lowEqFreq : lowEqPrecise.toDouble();
    highEqFreq = highEqCourse.isEmpty() ? highEqFreq : highEqCourse.toDouble();
    highEqFreq = highEqPrecise.isEmpty() ? highEqFreq : highEqPrecise.toDouble();

    if (lowEqFreq == 0.0 || highEqFreq == 0.0 || lowEqFreq == highEqFreq) {
        CheckBoxLoFi->setChecked(true);
        setDefaultShelves();
        lowEqFreq = m_pConfig->getValueString(ConfigKey(CONFIG_KEY, "LoEQFrequencyPrecise")).toDouble();
        highEqFreq = m_pConfig->getValueString(ConfigKey(CONFIG_KEY, "HiEQFrequencyPrecise")).toDouble();
    }

    SliderHiEQ->setValue(
        getSliderPosition(highEqFreq,
                          SliderHiEQ->minimum(),
                          SliderHiEQ->maximum()));
    SliderLoEQ->setValue(
        getSliderPosition(lowEqFreq,
                          SliderLoEQ->minimum(),
                          SliderLoEQ->maximum()));

    CheckBoxLoFi->setChecked(m_pConfig->getValueString(
            ConfigKey(CONFIG_KEY, "LoFiEQs")) == QString("yes"));

    // Default internal EQs to enabled.
    CheckBoxEnbEQ->setChecked(m_pConfig->getValueString(
            ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), "yes") == QString("yes"));

    slotUpdate();
    slotApply();
}
开发者ID:CorgiMan,项目名称:mixxx,代码行数:42,代码来源:dlgprefeq.cpp


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