From 3e62162867023ec73352d4e157b08862624c337b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Fri, 12 Jun 2009 23:22:14 +0000 Subject: [PATCH] * Allow editing keyframable effects in groups: http://kdenlive.org/mantis/view.php?id=814 * Don't add audio effects on video only clips nor video effects on sound clips svn path=/trunk/kdenlive/; revision=3526 --- src/abstractclipitem.cpp | 7 ++++--- src/clipitem.cpp | 2 +- src/customtrackview.cpp | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/abstractclipitem.cpp b/src/abstractclipitem.cpp index 4521e9d7..e58178ea 100644 --- a/src/abstractclipitem.cpp +++ b/src/abstractclipitem.cpp @@ -255,7 +255,8 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, QRectF /*exposedRect*/) double y2; // draw line showing default value - if (isSelected()) { + bool active = isSelected() || (parentItem() && parentItem()->isSelected()); + if (active) { x1 = br.x(); x2 = br.right(); y1 = br.bottom() - m_keyframeDefault * maxh; @@ -285,13 +286,13 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, QRectF /*exposedRect*/) QLineF l(x1, y1, x2, y2); l2 = painter->matrix().map(l); painter->drawLine(l2); - if (isSelected()) { + if (active) { painter->fillRect(l2.x1() - 3, l2.y1() - 3, 6, 6, QBrush(color)); } x1 = x2; y1 = y2; } - if (isSelected()) painter->fillRect(l2.x2() - 3, l2.y2() - 3, 6, 6, QBrush(color)); + if (active) painter->fillRect(l2.x2() - 3, l2.y2() - 3, 6, 6, QBrush(color)); } int AbstractClipItem::mouseOverKeyFrames(QPointF pos) diff --git a/src/clipitem.cpp b/src/clipitem.cpp index ab680d99..1159d343 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -851,7 +851,7 @@ OPERATIONTYPE ClipItem::operationMode(QPointF pos) { if (isItemLocked()) return NONE; - if (isSelected()) { + if (isSelected() || (parentItem() && parentItem()->isSelected())) { m_editedKeyframe = mouseOverKeyFrames(pos); if (m_editedKeyframe != -1) return KEYFRAME; } diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index f73e49c3..180b000b 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -1262,6 +1262,14 @@ void CustomTrackView::slotAddGroupEffect(QDomElement effect, AbstractGroupItem * for (int i = 0; i < itemList.count(); i++) { if (itemList.at(i)->type() == AVWIDGET) { ClipItem *item = static_cast (itemList.at(i)); + 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)) continue; + } else if (effect.hasAttribute("type") == false) { + // Don't add video effect on audio clips + if (item->isAudioOnly() || item->clipType() == AUDIO) continue; + } + if (item->hasEffect(effect.attribute("tag"), effect.attribute("id")) != -1 && effect.attribute("unique", "0") != "0") { emit displayMessage(i18n("Effect already present in clip"), ErrorMessage); continue; @@ -1305,6 +1313,13 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track) for (int i = 0; i < itemList.count(); i++) { if (itemList.at(i)->type() == AVWIDGET) { ClipItem *item = (ClipItem *)itemList.at(i); + 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)) continue; + } else if (effect.hasAttribute("type") == false) { + // Don't add video effect on audio clips + if (item->isAudioOnly() || item->clipType() == AUDIO) continue; + } if (item->hasEffect(effect.attribute("tag"), effect.attribute("id")) != -1 && effect.attribute("unique", "0") != "0") { emit displayMessage(i18n("Effect already present in clip"), ErrorMessage); continue; -- 2.39.2