Commit f922b502 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix split audio only working on first audio track on non automatic split mode

parent d39d1860
......@@ -6834,27 +6834,29 @@ void CustomTrackView::splitAudio(bool warn, ItemInfo info, int destTrack, QUndoC
if (!info.isValid()) {
// Operate on current selection
selection = scene()->selectedItems();
destTrack = m_timeline->audioTarget;
if (selection.isEmpty()) {
emit displayMessage(i18n("You must select at least one clip for this action"), ErrorMessage);
if (!hasMasterCommand)
delete masterCommand;
return;
}
} else {
new SplitAudioCommand(this, info.track, destTrack, info.startPos, masterCommand);
}
for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWidget) {
ClipItem *clip = static_cast <ClipItem *>(selection.at(i));
if (clip->clipType() == AV || clip->clipType() == Playlist) {
if (clip->parentItem()) {
emit displayMessage(i18n("Cannot split audio of grouped clips"), ErrorMessage);
} else {
new SplitAudioCommand(this, clip->track(), destTrack, clip->startPos(), masterCommand);
if (KdenliveSettings::splitaudio()) {
destTrack = m_timeline->audioTarget;
}
for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWidget) {
ClipItem *clip = static_cast <ClipItem *>(selection.at(i));
if (clip->clipType() == AV || clip->clipType() == Playlist) {
if (clip->parentItem()) {
emit displayMessage(i18n("Cannot split audio of grouped clips"), ErrorMessage);
} else {
new SplitAudioCommand(this, clip->track(), destTrack, clip->startPos(), masterCommand);
}
}
}
}
} else {
new SplitAudioCommand(this, info.track, destTrack, info.startPos, masterCommand);
}
if (masterCommand->childCount()) {
updateTrackDuration(-1, masterCommand);
......
Supports Markdown
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