Exemplo n.º 1
0
void SyncControl::notifySyncModeChanged(SyncMode mode) {
    //qDebug() << "SyncControl::notifySyncModeChanged" << getGroup() << mode;
    // SyncControl has absolutely no say in the matter. This is what EngineSync
    // requires. Bypass confirmation by using setAndConfirm.
    m_masterBpmAdjustFactor = kBpmUnity;
    m_pSyncMode->setAndConfirm(mode);
    m_pSyncEnabled->setAndConfirm(mode != SYNC_NONE);
    m_pSyncMasterEnabled->setAndConfirm(mode == SYNC_MASTER);
    if (mode == SYNC_FOLLOWER) {
        if (m_pVCEnabled && m_pVCEnabled->get()) {
            // If follower mode is enabled, disable vinyl control.
            m_pVCEnabled->set(0.0);
        }
    }
    if (mode != SYNC_NONE && m_pPassthroughEnabled->get()) {
        // If any sync mode is enabled and passthrough was on somehow, disable passthrough.
        // This is very unlikely to happen so this deserves a warning.
        qWarning() << "Notified of sync mode change when passthrough was active -- "
                      "must disable passthrough";
        m_pPassthroughEnabled->set(0.0);
    }
    if (mode == SYNC_MASTER) {
        // Make sure all the followers update based on our current rate.
        slotRateChanged();
        double rateRatio = calcRateRatio();
        m_pEngineSync->notifyBeatDistanceChanged(this, getBeatDistance());
        m_pBpm->set(m_pLocalBpm->get() * rateRatio);
    }
}
Exemplo n.º 2
0
double BpmControl::updateBeatDistance() {
    double beat_distance = getBeatDistance(m_dPreviousSample);
    m_pThisBeatDistance->set(beat_distance);
    if (getSyncMode() == SYNC_NONE) {
        m_dUserOffset = 0.0;
    }
    return beat_distance;
}
Exemplo n.º 3
0
double BpmControl::updateBeatDistance() {
    double beat_distance = getBeatDistance(getSampleOfTrack().current);
    m_pThisBeatDistance->set(beat_distance);
    if (!isSynchronized()) {
        m_dUserOffset.setValue(0.0);
    }
    return beat_distance;
}