Exemplo n.º 1
0
void LoopingControl::slotLoopHalve(double v) {
    if (v > 0.0) {
        // If a beatloop is active then halve should deactive the current
        // beatloop and activate the previous one.
        if (m_pActiveBeatLoop != NULL) {
            int active_index = m_beatLoops.indexOf(m_pActiveBeatLoop);
            if (active_index - 1 >= 0) {
                if (m_bLoopingEnabled) {
                    // If the current position is outside the range of the new loop,
                    // take the current position and subtract the length of the new loop until
                    // it fits.
                    int old_loop_in = m_iLoopStartSample;
                    int old_loop_out = m_iLoopEndSample;
                    slotBeatLoopActivate(m_beatLoops[active_index - 1]);
                    seekInsideAdjustedLoop(
                            old_loop_in, old_loop_out,
                            m_iLoopStartSample, m_iLoopEndSample);
                } else {
                    // Calling scale clears the active beatloop.
                    slotLoopScale(0.5);
                    m_pActiveBeatLoop = m_beatLoops[active_index - 1];
                }
            }
        } else {
            slotLoopScale(0.5);
        }
    }
}
Exemplo n.º 2
0
void LoopingControl::slotLoopDouble(double v) {
    if (v > 0.0) {
        // If a beatloop is active then double should deactive the current
        // beatloop and activate the next one.
        if (m_pActiveBeatLoop != NULL) {
            int active_index = m_beatLoops.indexOf(m_pActiveBeatLoop);
            if (active_index + 1 < m_beatLoops.size()) {
                if (m_bLoopingEnabled) {
                    slotBeatLoopActivate(m_beatLoops[active_index + 1]);
                } else {
                    // Calling scale clears the active beatloop.
                    slotLoopScale(2.0);
                    m_pActiveBeatLoop = m_beatLoops[active_index + 1];
                }
            }
        } else {
            slotLoopScale(2.0);
        }
    }
}
Exemplo n.º 3
0
void LoopingControl::slotLoopHalve(double v) {
    if (v > 0.0) {
        // If a beatloop is active then halve should deactive the current
        // beatloop and activate the previous one.
        if (m_pActiveBeatLoop != NULL) {
            int active_index = m_beatLoops.indexOf(m_pActiveBeatLoop);
            if (active_index - 1 >= 0) {
                if (m_bLoopingEnabled) {
                    slotBeatLoopActivate(m_beatLoops[active_index - 1]);
                } else {
                    // Calling scale clears the active beatloop.
                    slotLoopScale(0.5);
                    m_pActiveBeatLoop = m_beatLoops[active_index - 1];
                }
            }
        } else {
            slotLoopScale(0.5);
        }
    }
}