1115
1115
unsigned long qtractorTrack::clipRecordEnd ( unsigned long iFrameTime ) const
1117
// HACK: Care of punch-out...
1117
// HACK: Care of loop-recording + punch-in/out...
1118
1118
if (m_pSession && m_pSession->isPunching()) {
1119
1119
const unsigned long iLoopStart = m_pSession->loopStart();
1120
1120
const unsigned long iLoopEnd = m_pSession->loopEnd();
1121
unsigned long iPunchIn = m_pSession->punchIn();
1121
1122
unsigned long iPunchOut = m_pSession->punchOut();
1122
#if 1//TEST_PUNCH_LOOP_RECORDING_1
1123
1123
if (iLoopStart < iLoopEnd &&
1124
iLoopStart < iFrameTime &&
1124
iLoopEnd < iFrameTime &&
1125
1125
m_pSession->loopRecordingMode() > 0) {
1126
if (iPunchIn < iLoopStart)
1127
iPunchIn = iLoopStart;
1128
if (iPunchOut > iLoopEnd)
1129
iPunchOut = iLoopEnd;
1126
1130
const unsigned long iLoopLength
1127
1131
= iLoopEnd - iLoopStart;
1128
const unsigned long iLoopCount
1129
= (iFrameTime - iLoopStart) / iLoopLength;
1132
const unsigned int iLoopCount
1133
= (iFrameTime - iPunchIn) / iLoopLength;
1130
1134
iPunchOut += iLoopCount * iLoopLength;
1133
if (iLoopStart < iLoopEnd && iPunchOut >= iLoopEnd)
1134
iPunchOut = iLoopEnd;
1136
1136
// Make sure it's really about to punch-out...
1137
if (iFrameTime >= iPunchOut)
1137
if (iFrameTime > iPunchOut)
1138
1138
return iPunchOut;
1244
1244
// Punch-in/out recording...
1245
1245
if (m_pSession->isPunching()
1246
1246
&& m_pSession->frameTimeEx() < iFrameEnd) {
1247
#if 1//TEST_PUNCH_LOOP_RECORDING_1
1248
1247
const unsigned long iPunchIn = m_pSession->punchIn();
1249
1248
// Punch-in (likely...)
1250
1249
if (iPunchIn < iFrameEnd) {
1251
unsigned int offs = 0;
1250
unsigned int offset = 0;
1252
1251
if (iPunchIn >= iFrameStart) {
1253
offs += (iPunchIn - iFrameStart);
1252
offset += (iPunchIn - iFrameStart);
1254
1253
nframes = (iFrameEnd - iPunchIn);
1256
1255
// Punch-in recording...
1257
1256
pAudioClip->write(
1258
pInputBus->in(), nframes, pInputBus->channels(), offs);
1261
const unsigned long iPunchIn = m_pSession->punchIn();
1262
const unsigned long iPunchOut = m_pSession->punchOut();
1263
if (iPunchIn < iFrameEnd && iPunchOut > iFrameStart) {
1264
unsigned int offs = 0;
1265
// Punch-out (unlikely...)
1266
if (iPunchIn >= iFrameStart) {
1267
offs += (iPunchIn - iFrameStart);
1268
if (iPunchOut < iFrameEnd)
1269
nframes = (iPunchOut - iPunchIn);
1271
nframes = (iFrameEnd - iPunchIn);
1274
// Punch-out (likely...)
1275
if (iPunchOut < iFrameEnd)
1276
nframes = (iPunchOut - iFrameStart);
1277
// Punch-in/out recording...
1279
pInputBus->in(), nframes, pInputBus->channels(), offs);
1257
pInputBus->in(), nframes, pInputBus->channels(), offset);
1283
1260
// Regular full-length recording...
1284
1261
pAudioClip->write(