Fix audio recording not added to timeline.

Fixes #213
parent 99cf7c0a
Pipeline #3957 passed with stage
in 16 minutes and 53 seconds
......@@ -2443,7 +2443,12 @@ void TimelineController::finishRecording(const QString &recordedFile)
bool res = false;
if (m_recordStart.second > 0) {
// Limited space on track
QString binClipId = QString("%1/%2/%3").arg(binId).arg(0).arg(m_recordStart.second - 1);
std::shared_ptr<ProjectClip> clip = pCore->bin()->getBinClip(binId);
if (!clip) {
return;
}
int out = qMin((int)clip->frameDuration() - 1, m_recordStart.second - 1);
QString binClipId = QString("%1/%2/%3").arg(binId).arg(0).arg(out);
res = m_model->requestClipInsertion(binClipId, m_recordTrack, m_recordStart.first, id, true, true, false);
} else {
res = m_model->requestClipInsertion(binId, m_recordTrack, m_recordStart.first, id, true, true, false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment