Пример #1
0
void LoopingControl::slotLoopMove(double beats) {
    if (!m_pTrack || !m_pBeats) {
        return;
    }

    double dPosition = getCurrentSample();
    double dBeatLength;
    if (BpmControl::getBeatContext(m_pBeats, dPosition,
                                   NULL, NULL, &dBeatLength, NULL)) {
        int old_loop_in = m_iLoopStartSample;
        int old_loop_out = m_iLoopEndSample;
        int new_loop_in = m_iLoopStartSample + (beats * dBeatLength);
        int new_loop_out = m_iLoopEndSample + (beats * dBeatLength);
        // Should we reject any shift that goes out of bounds?

        m_iLoopStartSample = new_loop_in;
        if (m_pActiveBeatLoop) {
            // Ugly hack -- slotBeatLoop takes "true" to mean "keep starting
            // point".  It gets that in-point from m_iLoopStartSample,
            // which we just changed so that the loop actually shifts.
            slotBeatLoop(m_pActiveBeatLoop->getSize(), true);
        } else {
            m_pCOLoopStartPosition->set(new_loop_in);
            m_iLoopEndSample = new_loop_out;
            m_pCOLoopEndPosition->set(new_loop_out);
        }
        seekInsideAdjustedLoop(old_loop_in, old_loop_out,
                               new_loop_in, new_loop_out);
    }
}
Пример #2
0
void LoopingControl::slotBeatLoopActivateRoll(BeatLoopingControl* pBeatLoopControl) {
     if (!m_pTrack) {
         return;
     }

    //Disregard existing loops
    m_pSlipEnabled->set(1);
    slotBeatLoop(pBeatLoopControl->getSize(), false);
}
Пример #3
0
void LoopingControl::slotBeatLoopActivate(BeatLoopingControl* pBeatLoopControl) {
    if (!m_pTrack) {
        return;
    }

    // Maintain the current start point if there is an active loop currently
    // looping. slotBeatLoop will update m_pActiveBeatLoop if applicable. Note,
    // this used to only maintain the current start point if a beatloop was
    // enabled. See Bug #1159243.
    slotBeatLoop(pBeatLoopControl->getSize(), m_bLoopingEnabled);
}
Пример #4
0
void LoopingControl::slotBeatLoopActivate(BeatLoopingControl* pBeatLoopControl) {
    if (!m_pTrack) {
        return;
    }

    // Maintain the current start point if there is an active beat loop and we
    // are currently looping. slotBeatLoop will update m_pActiveBeatLoop if
    // applicable
    bool beatLoopAlreadyActive = m_pActiveBeatLoop != NULL;
    slotBeatLoop(pBeatLoopControl->getSize(),
                 beatLoopAlreadyActive && m_bLoopingEnabled);
}