Beispiel #1
0
void BpmControl::slotUpdatedTrackBeats() {
    TrackPointer pTrack = m_pTrack;
    if (pTrack) {
        resetSyncAdjustment();
        m_pBeats = pTrack->getBeats();
    }
}
Beispiel #2
0
// called from an engine worker thread
void BpmControl::trackLoaded(TrackPointer pNewTrack) {
    if (m_pTrack) {
        disconnect(m_pTrack.get(), &Track::beatsUpdated,
                   this, &BpmControl::slotUpdatedTrackBeats);
    }

    // reset for a new track
    resetSyncAdjustment();

    if (pNewTrack) {
        m_pTrack = pNewTrack;
        m_pBeats = m_pTrack->getBeats();
        connect(m_pTrack.get(), &Track::beatsUpdated,
                this, &BpmControl::slotUpdatedTrackBeats);
    } else {
        m_pTrack.reset();
        m_pBeats.clear();
    }
}
Beispiel #3
0
void BpmControl::trackLoaded(TrackPointer pNewTrack, TrackPointer pOldTrack) {
    Q_UNUSED(pOldTrack);
    if (m_pTrack) {
        disconnect(m_pTrack.get(), SIGNAL(beatsUpdated()),
                   this, SLOT(slotUpdatedTrackBeats()));
    }

    // reset for a new track
    resetSyncAdjustment();

    if (pNewTrack) {
        m_pTrack = pNewTrack;
        m_pBeats = m_pTrack->getBeats();
        connect(m_pTrack.get(), SIGNAL(beatsUpdated()),
                this, SLOT(slotUpdatedTrackBeats()));
    } else {
        m_pTrack.reset();
        m_pBeats.clear();
    }
}
Beispiel #4
0
void BpmControl::slotFileBpmChanged(double file_bpm) {
    // Adjust the file-bpm with the current setting of the rate to get the
    // engine BPM. We only do this for SYNC_NONE decks because EngineSync will
    // set our BPM if the file BPM changes. See SyncControl::fileBpmChanged().
    //qDebug() << "BpmControl::slotFileBpmChanged" << file_bpm;
    BeatsPointer pBeats = m_pBeats;
    if (pBeats) {
        const double beats_bpm =
                pBeats->getBpmAroundPosition(
                        getSampleOfTrack().current, kLocalBpmSpan);
        if (beats_bpm != -1) {
            m_pLocalBpm->set(beats_bpm);
        } else {
            m_pLocalBpm->set(file_bpm);
        }
    } else {
        m_pLocalBpm->set(file_bpm);
    }
    resetSyncAdjustment();
}
Beispiel #5
0
void BpmControl::slotFileBpmChanged(double bpm) {
    Q_UNUSED(bpm);
    // Adjust the file-bpm with the current setting of the rate to get the
    // engine BPM. We only do this for SYNC_NONE decks because EngineSync will
    // set our BPM if the file BPM changes. See SyncControl::fileBpmChanged().
    if (m_pBeats) {
        const double beats_bpm =
                m_pBeats->getBpmAroundPosition(getCurrentSample(),
                                               kLocalBpmSpan);
        if (beats_bpm != -1) {
            m_pLocalBpm->set(beats_bpm);
        } else {
            m_pLocalBpm->set(bpm);
        }
    } else {
        m_pLocalBpm->set(bpm);
    }
    if (getSyncMode() == SYNC_NONE) {
        slotUpdateEngineBpm();
    }
    resetSyncAdjustment();
}
Beispiel #6
0
void BpmControl::slotUpdatedTrackBeats() {
    if (m_pTrack) {
        resetSyncAdjustment();
        m_pBeats = m_pTrack->getBeats();
    }
}