if (effect.attribute("type") == "audio") {
// Don't add audio effects on video clips
if (item->isVideoOnly() || (item->clipType() != AUDIO && item->clipType() != AV && item->clipType() != PLAYLIST)) {
- emit displayMessage(i18n("Cannot add an audio effect to this clip"), ErrorMessage);
+ /* do not show error message when item is part of a group as the user probably knows what he does then
+ * and the message is annoying when working with the split audio feature */
+ if (!item->parentItem() || item->parentItem() == m_selectionGroup)
+ emit displayMessage(i18n("Cannot add an audio effect to this clip"), ErrorMessage);
continue;
}
- } else if (effect.hasAttribute("type") == false) {
+ } else if (effect.attribute("type") == "video" || !effect.hasAttribute("type")) {
// Don't add video effect on audio clips
if (item->isAudioOnly() || item->clipType() == AUDIO) {
- emit displayMessage(i18n("Cannot add a video effect to this clip"), ErrorMessage);
+ /* do not show error message when item is part of a group as the user probably knows what he does then
+ * and the message is annoying when working with the split audio feature */
+ if (!item->parentItem() || item->parentItem() == m_selectionGroup)
+ emit displayMessage(i18n("Cannot add a video effect to this clip"), ErrorMessage);
continue;
}
}
if (item->isItemLocked()) {
continue;
}
+
if (effect.attribute("id") == "freeze" && m_cursorPos > item->startPos().frames(m_document->fps()) && m_cursorPos < item->endPos().frames(m_document->fps())) {
item->initEffect(effect, m_cursorPos - item->startPos().frames(m_document->fps()));
- } else item->initEffect(effect);
+ } else {
+ item->initEffect(effect);
+ }
+
if (effect.attribute("tag") == "ladspa") {
QString ladpsaFile = m_document->getLadspaFile();
initEffects::ladspaEffectFile(ladpsaFile, effect.attribute("ladspaid").toInt(), getLadspaParams(effect));
return;
}
QDomElement effect = insertedEffect.cloneNode().toElement();
+ kDebug() << "// update effect ix: " << effect.attribute("kdenlive_ix");
if (pos < GenTime()) {
// editing a track effect
EffectsParameterList effectParams = getEffectArgs(effect);
}
if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - track, pos, effectParams))
emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
- m_document->setTrackEffect(track - 1, ix, effect);
+ m_document->setTrackEffect(m_document->tracksCount() - track - 1, ix, effect);
+ setDocumentModified();
return;
}
m_pasteEffectsAction->setEnabled(m_copiedItems.count() == 1);
if (items.count() > 1) groupSelectedItems(true);
+ else if (items.count() == 1) m_dragItem = static_cast <ClipItem *>(items.at(0));
event->setDropAction(Qt::MoveAction);
event->accept();
} else QGraphicsView::dropEvent(event);
m_selectionGroupInfo.track = m_selectionGroup->track();
for (int i = 0; i < items.count(); ++i) {
- if (items.at(i)->type() == GROUPWIDGET)
+ if (items.at(i)->type() == GROUPWIDGET) {
rebuildGroup((AbstractGroupItem*)items.at(i));
+ items.removeAt(i);
+ --i;
+ }
}
+ for (int i = 0; i < items.count(); ++i) {
+ if (items.at(i)) {
+ items.at(i)->setSelected(true);
+ if (items.at(i)->parentItem())
+ items.at(i)->parentItem()->setSelected(true);
+ }
+ }
+ groupSelectedItems();
} else {
rebuildGroup((AbstractGroupItem *)group);
}
void CustomTrackView::cutSelectedClips()
{
QList<QGraphicsItem *> itemList = scene()->selectedItems();
+ QList<AbstractGroupItem *> groups;
GenTime currentPos = GenTime(m_cursorPos, m_document->fps());
for (int i = 0; i < itemList.count(); ++i) {
if (!itemList.at(i))
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
if (item->parentItem() && item->parentItem() != m_selectionGroup) {
- // remove all group children from itemList so we do not attempt to cut them twice
- QList <QGraphicsItem *> children = item->parentItem()->childItems();
- QList <int> toRemove;
- for (int j = 0; j < children.count(); ++j) {
- for (int k = 0; k < itemList.count(); ++k) {
- if (children.at(j)->pos() == itemList.at(k)->pos()
- && children.at(j)->boundingRect() == itemList.at(k)->boundingRect()) {
- toRemove.append(k);
- }
- }
- }
- for (int j = 0; j < toRemove.count(); ++j)
- itemList.removeAt(toRemove.at(j));
-
- razorGroup((AbstractGroupItem *)item->parentItem(), currentPos);
+ AbstractGroupItem *group = static_cast <AbstractGroupItem *>(item->parentItem());
+ if (!groups.contains(group))
+ groups << group;
} else if (currentPos > item->startPos() && currentPos < item->endPos()) {
RazorClipCommand *command = new RazorClipCommand(this, item->info(), currentPos);
m_commandStack->push(command);
}
} else if (itemList.at(i)->type() == GROUPWIDGET && itemList.at(i) != m_selectionGroup) {
- // remove all group children from itemList so we do not attempt to cut them twice
AbstractGroupItem *group = static_cast<AbstractGroupItem *>(itemList.at(i));
-
- QList <QGraphicsItem *> children = itemList.at(i)->childItems();
- QList <int> toRemove;
- for (int j = 0; j < children.count(); ++j) {
- for (int k = 0; k < itemList.count(); ++k) {
- if (children.at(j)->pos() == itemList.at(k)->pos()
- && children.at(j)->boundingRect() == itemList.at(k)->boundingRect()) {
- toRemove.append(k);
- }
- }
- }
- for (int j = 0; j < toRemove.count(); ++j)
- itemList.removeAt(toRemove.at(j));
-
- razorGroup(group, currentPos);
+ if (!groups.contains(group))
+ groups << group;
}
}
+
+ for (int i = 0; i < groups.count(); ++i)
+ razorGroup(groups.at(i), currentPos);
}
void CustomTrackView::razorGroup(AbstractGroupItem* group, GenTime cutPos)
else
prod = clip->baseClip()->producer(info.track);
m_document->renderer()->mltInsertClip(info, clip->xml(), prod);
+ for (int i = 0; i < clip->effectsCount(); i++) {
+ m_document->renderer()->mltAddEffect(info.track, info.startPos, getEffectArgs(clip->effectAt(i)), false);
+ }
} else if (item->type() == TRANSITIONWIDGET) {
Transition *tr = static_cast <Transition*>(item);
int newTrack;
if (children.at(i)->parentItem())
rebuildGroup((AbstractGroupItem*)children.at(i)->parentItem());
}
+ clearSelection();
KdenliveSettings::setSnaptopoints(snap);
m_document->renderer()->doRefresh();